-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy patheslint.config.js
More file actions
74 lines (69 loc) · 2.17 KB
/
eslint.config.js
File metadata and controls
74 lines (69 loc) · 2.17 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
/*
Eslint doesn't like that this file is using commonjs module syntax.
Hopefully, we will be able to migrate the whole project to ES modules eventually.
In the meantime, the linting of this file is disabled.
*/
/* eslint-disable */
const eslint = require('@eslint/js');
const { defineConfig } = require('eslint/config');
const tseslint = require('typescript-eslint');
const prettierConfig = require('eslint-config-prettier');
const reactPlugin = require('eslint-plugin-react');
const reactHooksPlugin = require('eslint-plugin-react-hooks');
const reactRecommended = require('eslint-plugin-react/configs/recommended');
const vitestPlugin = require('@vitest/eslint-plugin');
module.exports = defineConfig(
eslint.configs.recommended,
...tseslint.configs.recommended,
reactRecommended,
reactHooksPlugin.configs.flat.recommended,
reactPlugin.configs.flat['jsx-runtime'],
prettierConfig,
{
languageOptions: {
parserOptions: {
sourceType: 'module',
ecmaFeatures: {
jsx: true
}
},
},
plugins: {
react: reactPlugin
},
rules: {
'no-console': [1, { allow: ['error', 'info', 'warn'] }],
'@typescript-eslint/camelcase': 0,
'@typescript-eslint/interface-name-prefix': 0,
'@typescript-eslint/prefer-interface': 0,
'@typescript-eslint/explicit-function-return-type': 0,
'@typescript-eslint/explicit-module-boundary-types': 0,
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/no-use-before-define': 0,
'@typescript-eslint/no-unused-vars': ['warn', { args: 'after-used' }],
'react/display-name': 0,
'react/prop-types': 0,
'react/no-unescaped-entities': 0,
'prettier/prettier': 0,
'no-unused-vars': 'off',
'no-unneeded-ternary': 'error',
'no-empty': 'error',
'eqeqeq': 'error'
},
settings: {
react: {
version: 'detect' // Makes eslint-plugin-react automatically detect React version
}
}
},
// settings for eslint-plugin-vitest
{
plugins: {
vitest: vitestPlugin
},
rules: {
...vitestPlugin.configs.recommended.rules,
'vitest/no-focused-tests': 'error'
},
},
);