-
Notifications
You must be signed in to change notification settings - Fork 2
/
eslint.config.mjs
46 lines (42 loc) · 1.31 KB
/
eslint.config.mjs
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
import globals from 'globals';
import tsParser from '@typescript-eslint/parser';
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import pluginReactHooks from 'eslint-plugin-react-hooks';
import pluginReactRefresh from 'eslint-plugin-react-refresh';
/**
* The ESLint configuration in "flat config" format.
*
* Note: This configuration uses helper functions from `typescript-eslint`.
*
* @see {@link https://eslint.org/docs/latest/use/configure/ Configure ESLint}
* @see {@link https://typescript-eslint.io/packages/typescript-eslint typescript-eslint}
*/
export default tseslint.config(
{
files: ['**/*.ts', '**/*.tsx'],
extends: [eslint.configs.recommended, ...tseslint.configs.recommended],
languageOptions: {
globals: {
...globals.browser,
},
parser: tsParser,
},
linterOptions: {
reportUnusedDisableDirectives: 'warn',
},
plugins: {
'react-hooks': pluginReactHooks,
'react-refresh': pluginReactRefresh,
},
rules: {
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
'@typescript-eslint/no-empty-object-type': ['error', { allowWithName: 'Props$' }],
},
},
{
// global ignores
// do not add any other keys to this object
ignores: ['coverage/', 'dist/'],
},
);