Skip to content

Commit

Permalink
feat: enable type checked linting
Browse files Browse the repository at this point in the history
  • Loading branch information
wyattjoh committed Jun 4, 2024
1 parent afac34e commit 2d4bc51
Showing 1 changed file with 54 additions and 17 deletions.
71 changes: 54 additions & 17 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,29 @@
}
},
{ "files": ["**/__tests__/**"], "env": { "jest": true } },
{
"files": ["packages/next/**/*.d.ts"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"sourceType": "module",
"warnOnUnsupportedTypeScriptVersion": false
},
"rules": {
"no-unused-vars": "warn",
"no-dupe-class-members": "warn",
"no-undef": "warn"
}
},
{
"extends": [
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/stylistic"
"plugin:@typescript-eslint/recommended-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked"
],
"files": ["**/*.ts", "**/*.tsx"],
"excludedFiles": ["packages/next/**/*.d.ts"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": true,
"sourceType": "module",
"warnOnUnsupportedTypeScriptVersion": false
},
Expand Down Expand Up @@ -99,11 +114,45 @@
"ignoreRestSiblings": true
}
],
"no-use-before-define": "off",
"no-useless-constructor": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-useless-constructor": "error",
"@typescript-eslint/prefer-literal-enum-member": "error"
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": "warn",
"@typescript-eslint/prefer-literal-enum-member": "error",

"@typescript-eslint/consistent-type-imports": [
"error",
{
"disallowTypeAnnotations": false
}
],
"@typescript-eslint/no-import-type-side-effects": "error",

//
"@typescript-eslint/no-unsafe-assignment": "warn",
"@typescript-eslint/no-unnecessary-type-assertion": "warn",
"@typescript-eslint/prefer-nullish-coalescing": "warn",
"@typescript-eslint/no-unsafe-call": "warn",
"@typescript-eslint/no-unsafe-member-access": "warn",
"@typescript-eslint/prefer-string-starts-ends-with": "warn",
"@typescript-eslint/no-floating-promises": "warn",
"@typescript-eslint/non-nullable-type-assertion-style": "warn",
"@typescript-eslint/no-unsafe-return": "warn",
"@typescript-eslint/prefer-optional-chain": "warn",
"@typescript-eslint/no-redundant-type-constituents": "warn",
"@typescript-eslint/require-await": "warn",
"@typescript-eslint/no-unsafe-argument": "warn",
"@typescript-eslint/dot-notation": "warn",
"@typescript-eslint/no-unsafe-enum-comparison": "warn",
"@typescript-eslint/restrict-template-expressions": "warn",
"@typescript-eslint/unbound-method": "warn",
"@typescript-eslint/no-implied-eval": "warn",
"@typescript-eslint/await-thenable": "warn",
"@typescript-eslint/no-base-to-string": "warn",
"@typescript-eslint/restrict-plus-operands": "warn",
"@typescript-eslint/no-misused-promises": "warn",
"@typescript-eslint/no-duplicate-type-constituents": "warn",
"@typescript-eslint/no-for-in-array": "warn"
}
},
{
Expand Down Expand Up @@ -196,18 +245,6 @@
],
"eslint-plugin/require-meta-docs-url": "error"
}
},
{
"files": ["packages/**/*.tsx", "packages/**/*.ts"],
"rules": {
"@typescript-eslint/consistent-type-imports": [
"error",
{
"disallowTypeAnnotations": false
}
],
"@typescript-eslint/no-import-type-side-effects": "error"
}
}
],
"rules": {
Expand Down

0 comments on commit 2d4bc51

Please sign in to comment.