-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheslint.config.js
76 lines (75 loc) · 1.92 KB
/
eslint.config.js
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
75
76
import tsPlugin from '@typescript-eslint/eslint-plugin';
import tsParser from '@typescript-eslint/parser';
import importPlugin from 'eslint-plugin-import';
import prettierPlugin from 'eslint-plugin-prettier';
import reactPlugin from 'eslint-plugin-react';
import simpleImportSortPlugin from 'eslint-plugin-simple-import-sort';
import storybookPlugin from 'eslint-plugin-storybook';
export default [
{
ignores: ['node_modules', '.next/**/*', 'dist/**/*'],
},
{
files: ['**/*.{js,jsx,ts,tsx}'],
languageOptions: {
parser: tsParser,
parserOptions: {
ecmaFeatures: { jsx: true },
project: './tsconfig.json',
moduleResolution: 'node',
},
},
plugins: {
'@typescript-eslint': tsPlugin,
react: reactPlugin,
prettier: prettierPlugin,
'simple-import-sort': simpleImportSortPlugin,
import: importPlugin,
},
rules: {
'prettier/prettier': 'error',
'react/react-in-jsx-scope': 'off',
'react/jsx-props-no-spreading': 'off',
'react/jsx-filename-extension': [
'warn',
{
extensions: ['.tsx'],
},
],
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
'import/first': 'error',
'import/newline-after-import': 'error',
'import/no-duplicates': 'error',
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
typescript: {},
},
},
},
{
files: ['**/*.stories.@(js|jsx|ts|tsx)'],
plugins: {
storybook: storybookPlugin,
},
extends: [
'eslint:recommended',
'plugin:prettier/recommended',
'plugin:storybook/recommended',
],
},
];