-
Notifications
You must be signed in to change notification settings - Fork 41
/
eslint.config.mjs
38 lines (36 loc) · 1.2 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
import { FlatCompat } from '@eslint/eslintrc';
import eslint from '@eslint/js';
import react from 'eslint-plugin-react';
import reactHooks from 'eslint-plugin-react-hooks';
import simpleImportSort from 'eslint-plugin-simple-import-sort';
import storybook from 'eslint-plugin-storybook';
import tseslint from 'typescript-eslint';
const compat = new FlatCompat();
export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended,
{
files: ['**/*.{js,jsx,mjs,cjs,ts,tsx}'],
plugins: { react, 'react-hooks': reactHooks },
settings: {
react: {
version: 'detect',
},
},
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/ban-types': ['error', { types: { '{}': false }, extendDefaults: true }],
'@typescript-eslint/no-loss-of-precision': 'off',
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
...reactHooks.configs.recommended.rules,
},
},
...compat.config(storybook.configs.recommended),
{
plugins: { 'simple-import-sort': simpleImportSort },
rules: {
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
},
},
);