-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy patheslint.config.js
50 lines (49 loc) · 1.63 KB
/
eslint.config.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
const js = require('@eslint/js');
const globals = require('globals');
const reactHooks = require('eslint-plugin-react-hooks');
const reactRefresh = require('eslint-plugin-react-refresh');
const tsEslint = require('typescript-eslint');
const eslintPluginPrettierRecommended = require('eslint-plugin-prettier/recommended');
module.exports = tsEslint.config(
{ignores: ['dist']},
{
extends: [
js.configs.recommended,
...tsEslint.configs.recommended,
eslintPluginPrettierRecommended,
],
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
parser: tsEslint.parser,
parserOptions: {
projectService: true,
tsconfigRootDir: __dirname,
},
},
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'@typescript-eslint/no-explicit-any': 'off',
'react-refresh/only-export-components': 'warn',
'prettier/prettier': [
'error',
{
'singleQuote': true,
'semi': true,
'tabWidth': 2,
'bracketSpacing': true,
'trailingComma': 'all',
'arrowParens': 'always',
'endOfLine': 'auto',
},
],
},
},
);