-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy patheslint.config.mjs
46 lines (39 loc) · 1.04 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
// @ts-check
import typescriptEslint from 'typescript-eslint';
import globals from 'globals';
import js from '@eslint/js';
import reactPlugin from 'eslint-plugin-react';
import hooksPlugin from 'eslint-plugin-react-hooks';
import jestDom from 'eslint-plugin-jest-dom';
const flatReact = /** @type {NonNullable<typeof reactPlugin.configs.flat>} */ (
reactPlugin.configs.flat
);
export default typescriptEslint.config(
{ ignores: ['dist/*', '.yarn/*', '.pnp.cjs'] },
js.configs.recommended,
...typescriptEslint.configs.recommended,
// @ts-expect-error eslint-plugin-react-hooks and typescriptEslint are fighting
flatReact.recommended,
flatReact['jsx-runtime'],
jestDom.configs['flat/recommended'],
{
plugins: {
'react-hooks': hooksPlugin,
},
languageOptions: {
globals: {
...globals.browser,
},
ecmaVersion: 12,
sourceType: 'module',
},
rules: {
...hooksPlugin.configs.recommended.rules,
},
settings: {
react: {
version: 'detect',
},
},
},
);