Skip to content

Commit

Permalink
feat: add eslint-wip
Browse files Browse the repository at this point in the history
  • Loading branch information
karannakra committed May 15, 2023
1 parent 81e38d3 commit 3cdeadc
Show file tree
Hide file tree
Showing 4 changed files with 6,054 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.astro/
dist/
src/env.d.ts
64 changes: 64 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
module.exports = {
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:astro/recommended',
'plugin:jsx-a11y/recommended',
'plugin:typescript-sort-keys/recommended',
],
overrides: [
{
extends: [
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:@typescript-eslint/strict',
],
files: ['*.astro'],
parser: 'astro-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
extraFileExtensions: ['.astro'],
},
rules: {
// TODO: Investigate?? :(
'@typescript-eslint/no-unsafe-assignment': 'off',
'deprecation/deprecation': 'off',
},
},
{
files: ['*.ts', '*.tsx'],
extends: ['plugin:@typescript-eslint/recommended-requiring-type-checking'],
},
],
parser: '@typescript-eslint/parser',
parserOptions: {
project: true,
tsconfigRootDir: __dirname,
},
plugins: [
'@typescript-eslint',
'astro',
'deprecation',
'jsx-a11y',
'simple-import-sort',
'typescript-sort-keys',
],
root: true,
rules: {
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
'deprecation/deprecation': 'error',

'@typescript-eslint/no-misused-promises': 'off',
'@typescript-eslint/consistent-type-definitions': 'off',
'@typescript-eslint/no-floating-promises': 'off',
'typescript-sort-keys/interface': 'off',

// Stylistic concerns that don't interfere with Prettier
'padding-line-between-statements': 'off',

'@typescript-eslint/padding-line-between-statements': [
'error',
{ blankLine: 'always', next: '*', prev: 'block-like' },
],
},
};
12 changes: 12 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
"start": "astro dev",
"build": "astro check && tsc --noEmit && astro build",
"preview": "astro preview",
"lint": "eslint . --max-warnings 0 --report-unused-disable-directives",
"fmt": "prettier --write --ignore-unknown .",
"fix": "yarn lint:fix; yarn fmt",
"lint:fix": "yarn lint --fix",
"migrate": "tsx src/db/scripts/migrate",
"astro": "astro"
},
Expand All @@ -34,6 +37,7 @@
"cookie": "^0.5.0",
"drizzle-kit": "^0.17.6",
"drizzle-orm": "^0.25.4",
"eslint": "^8.40.0",
"fogbender-react": "^0.2.11",
"js-cookie": "^3.0.5",
"jsonwebtoken": "^9.0.0",
Expand All @@ -49,6 +53,14 @@
},
"devDependencies": {
"@tailwindcss/typography": "^0.5.9",
"@typescript-eslint/eslint-plugin": "^5.59.6",
"@typescript-eslint/parser": "^5.59.6",
"eslint-plugin-astro": "^0.27.0",
"eslint-plugin-deprecation": "^1.4.1",
"eslint-plugin-jsonc": "^2.8.0",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-typescript-sort-keys": "^2.3.0",
"tailwindcss": "^3.3.2"
}
}
Loading

0 comments on commit 3cdeadc

Please sign in to comment.