forked from testing-library/eslint-plugin-testing-library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
90 lines (88 loc) · 1.95 KB
/
.eslintrc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
module.exports = {
root: true,
env: {
es6: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:import/recommended',
'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,
},
},
],
'import/first': 'error',
'import/no-empty-named-blocks': 'error',
'import/no-extraneous-dependencies': 'error',
'import/no-mutable-exports': 'error',
'import/no-named-default': 'error',
'import/no-relative-packages': 'warn',
},
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',
'plugin:import/typescript',
],
rules: {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{ argsIgnorePattern: '^_' },
],
'@typescript-eslint/no-use-before-define': 'off',
// Import
// Rules enabled by `import/recommended` but are better handled by
// TypeScript and @typescript-eslint.
'import/default': 'off',
'import/export': 'off',
'import/namespace': 'off',
'import/no-unresolved': 'off',
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.ts'],
},
typescript: {
alwaysTryTypes: true,
},
},
},
},
],
};