-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: refine typescript-eslint config (#705)
* chore: remove unnecessary ESLint config * chore: move ESLint config file to js * chore: remove disabled ESLint import rule * chore: linting with type information Configured typescript-eslint to lint with type information: https://typescript-eslint.io/linting/typed-linting * chore: apply a custom message to restricted import
- Loading branch information
Showing
7 changed files
with
84 additions
and
66 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
module.exports = { | ||
root: true, | ||
extends: [ | ||
'kentcdodds', | ||
'plugin:jest/recommended', | ||
'plugin:jest-formatting/recommended', | ||
'prettier', | ||
], | ||
rules: { | ||
// Base | ||
'max-lines-per-function': 'off', | ||
'no-restricted-imports': [ | ||
'error', | ||
{ | ||
patterns: [ | ||
{ | ||
group: ['@typescript-eslint/utils/dist/*'], | ||
message: 'Import from `@typescript-eslint/utils` instead.', | ||
}, | ||
], | ||
}, | ||
], | ||
|
||
// Import | ||
'import/order': [ | ||
'warn', | ||
{ | ||
groups: ['builtin', 'external', 'parent', 'sibling', 'index'], | ||
'newlines-between': 'always', | ||
alphabetize: { | ||
order: 'asc', | ||
caseInsensitive: false, | ||
}, | ||
}, | ||
], | ||
}, | ||
overrides: [ | ||
{ | ||
// TypeScript | ||
files: ['**/*.ts?(x)'], | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
tsconfigRootDir: __dirname, | ||
project: ['./tsconfig.eslint.json'], | ||
}, | ||
extends: [ | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:@typescript-eslint/recommended-requiring-type-checking', | ||
], | ||
rules: { | ||
'@typescript-eslint/explicit-function-return-type': 'off', | ||
'@typescript-eslint/no-unused-vars': [ | ||
'warn', | ||
{ argsIgnorePattern: '^_' }, | ||
], | ||
'@typescript-eslint/no-use-before-define': 'off', | ||
}, | ||
}, | ||
], | ||
}; |
This file was deleted.
Oops, something went wrong.
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
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
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