Repository navigation
Expand file tree
/
Copy patheslint.config.js
More file actions
80 lines (75 loc) · 2.11 KB
/
Copy patheslint.config.js
File metadata and controls
80 lines (75 loc) · 2.11 KB
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
import neostandard, { plugins } from 'neostandard'
import reactHooks from 'eslint-plugin-react-hooks'
export default [
{
// Mirrors the previous .eslintignore plus the old lint scope, which was
// `eslint "**/*.{ts,tsx}"` and so never covered scripts/ or config files.
ignores: [
'dist/**',
'docs/**',
'build/**',
'example/**',
'node_modules/**',
'.snapshots/**',
'**/*.min.js',
'**/*.js',
'**/*.cjs',
'**/*.mjs'
]
},
// neostandard replaces eslint-config-standard + standard-react and bundles
// typescript-eslint, eslint-plugin-react, -n and -promise.
...neostandard({
ts: true,
jsx: true,
noJsx: false,
semi: false
}),
{
files: ['**/*.{ts,tsx}'],
plugins: {
'react-hooks': reactHooks
},
rules: {
...reactHooks.configs.recommended.rules,
// Carried over from the previous .eslintrc.
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['error', {
args: 'all',
argsIgnorePattern: '^_',
caughtErrors: 'all',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
varsIgnorePattern: '^_',
ignoreRestSiblings: true
}],
'no-use-before-define': 'off',
'no-shadow': 'off',
'no-unused-expressions': 'off',
'react/react-in-jsx-scope': 'off',
'react/prop-types': 'off',
'react/jsx-handler-names': 'off',
'react/jsx-fragments': 'off',
'react/no-unused-prop-types': 'off',
'import/export': 'off',
'@stylistic/space-before-function-paren': 'off',
'@stylistic/jsx-indent-props': ['error', 2],
'@stylistic/max-len': ['error', { code: 120 }],
// src/types/index.ts documents the public API with 4-space indented
// members; eslint-config-standard never enforced indent there.
'@stylistic/indent': 'off'
},
settings: {
react: { version: '19' }
}
},
{
files: ['src/__tests__/**/*.{ts,tsx}'],
languageOptions: {
globals: {
...plugins.globals?.node,
jest: 'readonly'
}
}
}
]