-
Notifications
You must be signed in to change notification settings - Fork 245
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1078 from minuteos/feat/migrate-to-eslint
Migrate to ESLint
- Loading branch information
Showing
83 changed files
with
2,854 additions
and
2,396 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"recommendations": [ | ||
"tobermory.es6-string-html", | ||
"ms-vscode.vscode-typescript-tslint-plugin" | ||
"dbaeumer.vscode-eslint" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
import eslint from '@eslint/js'; | ||
import tseslint from 'typescript-eslint'; | ||
import stylistic from '@stylistic/eslint-plugin'; | ||
import globals from 'globals'; | ||
|
||
export default tseslint.config( | ||
{ | ||
ignores: ['out/', 'dist/'], | ||
}, | ||
eslint.configs.recommended, | ||
tseslint.configs.recommendedTypeChecked, | ||
stylistic.configs.customize({ | ||
arrowParens: 'always', | ||
braceStyle: '1tbs', | ||
commaDangle: 'only-multiline', | ||
indent: 4, | ||
quotes: 'single', | ||
semi: 'always', | ||
}), | ||
{ | ||
files: ['resources/*.js'], | ||
languageOptions: { | ||
globals: { | ||
acquireVsCodeApi: true, // available for VSCode WebViews | ||
}, | ||
}, | ||
}, | ||
{ | ||
languageOptions: { | ||
globals: { | ||
...globals.node, | ||
...globals.browser, | ||
}, | ||
parserOptions: { | ||
project: true, | ||
tsconfigRootDir: import.meta.dirname, | ||
}, | ||
}, | ||
|
||
rules: { | ||
'@typescript-eslint/no-base-to-string': 'off', // 1 instance | ||
|
||
'@stylistic/indent-binary-ops': 'off', // this is a weird rule | ||
'@stylistic/max-len': ['error', { | ||
code: 160, | ||
ignoreTrailingComments: true, | ||
}], | ||
'@stylistic/max-statements-per-line': ['error', { | ||
ignoredNodes: ['IfStatement'], | ||
}], | ||
'@stylistic/member-delimiter-style': ['error', { | ||
multiline: { delimiter: 'semi' }, | ||
singleline: { delimiter: 'semi' }, | ||
}], | ||
'@stylistic/no-multi-spaces': ['error', { | ||
ignoreEOLComments: true, | ||
}], | ||
'@stylistic/quote-props': ['error', 'as-needed', { | ||
unnecessary: false, | ||
}], | ||
} | ||
}, | ||
{ | ||
// the following rules are being heavily violated in the current codebase, | ||
// we should work on being able to enable them... | ||
rules: { | ||
'@typescript-eslint/no-unsafe-member-access': 'off', // 742 instances | ||
'@typescript-eslint/no-unsafe-call': 'off', // 432 instances | ||
'@typescript-eslint/no-unsafe-assignment': 'off', // 429 instances | ||
'@typescript-eslint/no-unsafe-argument': 'off', // 401 instances | ||
'@typescript-eslint/no-explicit-any': 'off', // 226 instances | ||
'@typescript-eslint/no-unused-vars': 'off', // 204 instances | ||
'@typescript-eslint/no-unsafe-return': 'off', // 83 instances | ||
'@typescript-eslint/no-misused-promises': 'off', // 57 instances | ||
'@typescript-eslint/no-floating-promises': 'off', // 55 instances | ||
'no-useless-escape': 'off', // 38 instances | ||
'@typescript-eslint/prefer-promise-reject-errors': 'off', // 36 instances | ||
'no-async-promise-executor': 'off', // 29 instances | ||
'@typescript-eslint/no-require-imports': 'off', // 24 instances | ||
'no-cond-assign': 'off', // 21 instances | ||
'@typescript-eslint/require-await': 'off', // 11 instances | ||
} | ||
}, | ||
{ | ||
files: ['**/*.{js,mjs}'], | ||
extends: [tseslint.configs.disableTypeChecked], | ||
}, | ||
); |
Oops, something went wrong.