Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(linting): enable type checked linting #11258

Merged
merged 5 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 36 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,13 @@ module.exports = {
{
files: ['*.ts', '*.mts', '*.tsx'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.eslint.json',
tsconfigRootDir: __dirname,
},
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/stylistic',
'plugin:@typescript-eslint/recommended-type-checked',
'plugin:@typescript-eslint/stylistic-type-checked',
],
rules: {
// This is disabled for now because of our legacy usage of `require`. It should be enabled in the future.
Expand All @@ -192,6 +196,36 @@ module.exports = {
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/prefer-function-type': 'off',
camelcase: 'off',

// TODO(jgmw): Work through these and either keep disabled or fix and re-enable
'@typescript-eslint/prefer-string-starts-ends-with': 'off',
'@typescript-eslint/await-thenable': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/require-await': 'off',
'@typescript-eslint/prefer-nullish-coalescing': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unnecessary-type-assertion': 'off',
'@typescript-eslint/no-unsafe-enum-comparison': 'off',
'@typescript-eslint/dot-notation': 'off',
'@typescript-eslint/only-throw-error': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/prefer-optional-chain': 'off',
'@typescript-eslint/prefer-promise-reject-errors': 'off',
'@typescript-eslint/no-redundant-type-constituents': 'off',
'@typescript-eslint/restrict-plus-operands': 'off',
'@typescript-eslint/no-misused-promises': 'off',
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/prefer-regexp-exec': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/non-nullable-type-assertion-style': 'off',
'@typescript-eslint/no-implied-eval': 'off',
'@typescript-eslint/prefer-includes': 'off',
'@typescript-eslint/no-base-to-string': 'off',
'@typescript-eslint/no-duplicate-type-constituents': 'off',
'@typescript-eslint/unbound-method': 'off',
'@typescript-eslint/prefer-find': 'off',
},
},
{
Expand Down
4 changes: 4 additions & 0 deletions tsconfig.eslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "./tsconfig.compilerOption.json",
"exclude": ["dist", "node_modules", "**/__mocks__"]
}
Loading