-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
39 lines (38 loc) · 1.15 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
const { ESLint } = require('eslint');
const typescriptEslintParser = require('@typescript-eslint/parser');
const reactPlugin = require('eslint-plugin-react');
const typescriptEslintPlugin = require('@typescript-eslint/eslint-plugin');
const importPlugin = require('eslint-plugin-import');
const reactRefreshPlugin = require('eslint-plugin-react-refresh');
const reactHooksPlugin = require('eslint-plugin-react-hooks');
const prettierPlugin = require('eslint-plugin-prettier');
module.exports = [
{
files: ['**/*.{js,jsx,ts,tsx}'],
languageOptions: {
parser: typescriptEslintParser,
},
plugins: {
react: reactPlugin,
'@typescript-eslint': typescriptEslintPlugin,
import: importPlugin,
'react-refresh': reactRefreshPlugin,
'react-hooks': reactHooksPlugin,
prettier: prettierPlugin,
},
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
indent: ['error', 2],
'react/jsx-indent': ['error', 2],
'react/jsx-indent-props': ['error', 2],
},
settings: {
react: {
version: 'detect',
},
},
},
];