-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheslint.config.ts
49 lines (43 loc) · 1.13 KB
/
eslint.config.ts
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
import eslint from '@eslint/js';
import reactPlugin from 'eslint-plugin-react';
import storybook from 'eslint-plugin-storybook';
import tseslint from 'typescript-eslint';
// @ts-ignore
import hooksPlugin from 'eslint-plugin-react-hooks';
// ? https://typescript-eslint.io/getting-started#step-2-configuration
export default tseslint.config(
eslint.configs.recommended,
tseslint.configs.recommended,
{
rules: {
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'no-duplicate-imports': 'off',
},
},
{
files: ['**/*.ts', '**/*.tsx'],
plugins: {
react: reactPlugin,
'react-hooks': hooksPlugin,
},
rules: {
...reactPlugin.configs['jsx-runtime'].rules,
...hooksPlugin.configs.recommended.rules,
},
settings: {
react: {
version: 'detect',
},
},
},
...(storybook.configs['flat/recommended'] as any),
{
files: ['**/*.stories.@(ts|tsx|js|jsx|mjs|cjs)'],
},
// ignore files
{
ignores: ['**/*/dist/', '**/node_modules/', '*.config.*'],
},
);