-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
51 lines (50 loc) · 1.57 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
51
import js from '@eslint/js';
import eslintConfigPrettier from 'eslint-config-prettier';
import prettierPlugin from 'eslint-plugin-prettier';
import eslintReact from 'eslint-plugin-react';
import eslintReactHooks from 'eslint-plugin-react-hooks';
import eslintReactRefresh from 'eslint-plugin-react-refresh';
import globals from 'globals';
import tseslint from 'typescript-eslint';
export default tseslint.config(
{
plugins: {
'@typescript-eslint': tseslint.plugin,
react: eslintReact,
'react-hooks': eslintReactHooks,
'react-refresh': eslintReactRefresh,
prettier: prettierPlugin,
},
},
{
ignores: ['dist', 'node_modules', 'coverage', 'eslint.config.js'],
},
js.configs.recommended,
...tseslint.configs.recommended,
{
languageOptions: {
globals: {
...globals.browser,
...globals.node,
...globals.es2020,
},
parserOptions: {
project: ['tsconfig.json', 'tsconfig.node.json'],
},
},
},
{
files: ['**/*.{ts,tsx}'],
rules: {
...prettierPlugin.configs.recommended.rules,
...eslintConfigPrettier.rules,
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
'prefer-const': 'error',
'react/jsx-curly-brace-presence': ['warn', { props: 'never', children: 'never' }],
'react/function-component-definition': ['warn', { namedComponents: 'arrow-function' }],
'react/self-closing-comp': ['error', { component: true, html: true }],
'max-lines': ['warn', { max: 124 }],
'max-params': ['error', 3],
},
},
);