-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
112 lines (111 loc) · 2.86 KB
/
eslint.config.js
File metadata and controls
112 lines (111 loc) · 2.86 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
import js from '@eslint/js';
import tseslint from '@typescript-eslint/eslint-plugin';
import tsparser from '@typescript-eslint/parser';
import prettierPlugin from 'eslint-plugin-prettier';
import importPlugin from 'eslint-plugin-import';
import reactPlugin from 'eslint-plugin-react';
import reactHooksPlugin from 'eslint-plugin-react-hooks';
/** @type {import('eslint').Linter.FlatConfig[]} */
export default [
{
ignores: ['node_modules/**', 'dist/**', '*.js.map', 'example/**']
},
{
files: ['**/*.{js,jsx,ts,tsx}'],
languageOptions: {
parser: tsparser,
ecmaVersion: 2020,
sourceType: 'module',
parserOptions: {
ecmaFeatures: {
jsx: true
}
},
globals: {
browser: true,
jest: true,
node: true,
es6: true,
console: 'readonly',
window: 'readonly',
document: 'readonly'
}
},
plugins: {
'@typescript-eslint': tseslint,
import: importPlugin,
prettier: prettierPlugin,
react: reactPlugin,
'react-hooks': reactHooksPlugin
},
rules: {
...js.configs.recommended.rules,
'prettier/prettier': 'error',
'no-confusing-arrow': 'off',
'strict': 'off',
'implicit-arrow-linebreak': 'off',
'import/prefer-default-export': 'off',
'no-debugger': 'off',
'multiple-empty-lines': 'off',
'eol-last': 'off',
'no-spaced-func': 'off',
'func-call-spacing': 'off',
'no-multiple-empty-lines': 'off',
'no-unneeded-ternary': 'off',
'no-case-declarations': 'off',
'arrow-parens': 'off',
'no-useless-escape': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
args: 'after-used',
ignoreRestSiblings: true
}
],
'no-unused-vars': 'off',
'no-redeclare': [
'error',
{
builtinGlobals: false
}
],
'no-plusplus': 'off',
'no-nested-ternary': 'off',
'no-shadow': 'off',
'@typescript-eslint/no-shadow': ['error'],
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'lines-between-class-members': 'off',
'default-param-last': 'off',
'no-undef': 'off',
'radix': 'off',
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never'
}
],
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn'
},
settings: {
react: {
version: 'detect'
},
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx']
},
typescript: {
alwaysTryTypes: true
}
}
}
}
];