-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy patheslint.config.mjs
More file actions
94 lines (92 loc) · 2.43 KB
/
Copy patheslint.config.mjs
File metadata and controls
94 lines (92 loc) · 2.43 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
import js from '@eslint/js';
import globals from 'globals';
import reactPlugin from 'eslint-plugin-react';
import reactHooksPlugin from 'eslint-plugin-react-hooks';
import prettierConfig from 'eslint-config-prettier';
export default [
js.configs.recommended,
prettierConfig,
{
files: ['**/*.{js,jsx}'],
plugins: {
react: reactPlugin,
'react-hooks': reactHooksPlugin,
},
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
globals: {
...globals.browser,
...globals.node,
...globals.jest,
...globals.mocha,
},
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},
settings: {
react: {
version: 'detect',
},
},
rules: {
// React rules
...reactPlugin.configs.recommended.rules,
...reactHooksPlugin.configs.recommended.rules,
'react/jsx-filename-extension': ['warn', { extensions: ['.js', '.jsx'] }],
'react/function-component-definition': 'off',
'react/jsx-props-no-spreading': 'off',
'react/require-default-props': 'off',
'react/forbid-prop-types': 'warn',
'react/no-array-index-key': 'warn',
'react/no-unstable-nested-components': 'warn',
'react/no-unescaped-entities': 'warn',
'react/button-has-type': 'warn',
'react/prop-types': 'warn',
'react/jsx-no-constructed-context-values': 'warn',
'react/react-in-jsx-scope': 'off', // Not needed in React 17+
// General rules
'no-underscore-dangle': 'off',
'no-console': 'off',
'no-plusplus': 'off',
'no-use-before-define': 'off',
'no-param-reassign': 'off',
'consistent-return': 'off',
'no-bitwise': 'off',
'no-shadow': 'off',
'no-tabs': 'off',
indent: ['error', 'tab'],
'no-unused-vars': ['warn', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
'no-restricted-exports': 'off',
'no-unsafe-optional-chaining': 'warn',
'global-require': 'warn',
camelcase: 'warn',
'no-restricted-syntax': 'warn',
'class-methods-use-this': 'warn',
'no-useless-escape': 'warn',
'no-lonely-if': 'warn',
'no-control-regex': 'warn',
'no-unused-expressions': 'warn',
'no-nested-ternary': 'warn',
'no-promise-executor-return': 'warn',
'no-await-in-loop': 'warn',
'no-restricted-globals': 'warn',
'no-setter-return': 'warn',
'no-loop-func': 'warn',
'no-return-await': 'warn',
'prefer-destructuring': 'warn',
},
},
{
ignores: [
'node_modules/**',
'dist/**',
'coverage/**',
'*.min.js',
'webpack.config*.js',
],
},
];