-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy patheslint.config.js
More file actions
89 lines (79 loc) · 2.42 KB
/
eslint.config.js
File metadata and controls
89 lines (79 loc) · 2.42 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
import js from '@eslint/js';
import globals from 'globals';
import tseslint from 'typescript-eslint';
import reactPlugin from 'eslint-plugin-react';
import reactHooksPlugin from 'eslint-plugin-react-hooks';
import jsxA11yPlugin from 'eslint-plugin-jsx-a11y';
import importPlugin from 'eslint-plugin-import';
import prettierPlugin from 'eslint-plugin-prettier';
import prettierConfig from 'eslint-config-prettier';
export default tseslint.config(
{
ignores: ['node_modules/', 'dist/', 'sample/', '.github/'],
},
js.configs.recommended,
...tseslint.configs.recommended,
reactPlugin.configs.flat.recommended,
jsxA11yPlugin.flatConfigs.recommended,
{
plugins: { 'react-hooks': reactHooksPlugin },
rules: reactHooksPlugin.configs.recommended.rules,
},
{
plugins: { prettier: prettierPlugin },
rules: {
'prettier/prettier': 'off',
},
},
{
files: ['**/*.{js,ts,jsx,tsx}'],
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
globals: { ...globals.browser, ...globals.es2021, window: 'readonly' },
},
plugins: {
import: importPlugin,
prettier: prettierPlugin,
'@typescript-eslint': tseslint.plugin,
},
settings: {
'import/resolver': {
node: {
paths: ['.', 'src'],
extensions: ['.js', '.ts', '.jsx', '.tsx'],
},
},
react: {
version: 'detect',
},
},
rules: {
'import/extensions': 'off',
'import/prefer-default-export': 'off',
'import/no-webpack-loader-syntax': 'off',
'import/no-unresolved': 'off',
'import/no-extraneous-dependencies': 'off',
'no-use-before-define': 'off',
'no-console': 'off',
'no-extend-native': 'off',
'no-param-reassign': 'off',
'class-methods-use-this': 'off',
'dot-notation': ['error', { allowKeywords: true }],
'func-names': 'off',
'no-underscore-dangle': 'off',
camelcase: 'warn',
'no-plusplus': 'off',
'no-nested-ternary': 'off',
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-restricted-types': 'warn',
'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'no-unused-expressions': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-var-requires': 'off',
'prettier/prettier': 'off',
},
},
prettierConfig,
);