-
Notifications
You must be signed in to change notification settings - Fork 7
/
eslint.config.mjs
108 lines (107 loc) · 2.43 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
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
import globals from 'globals';
import json from 'eslint-plugin-json';
import mdxPlugin from 'eslint-plugin-mdx';
import importPlugin from 'eslint-plugin-import';
import reactPlugin from 'eslint-plugin-react';
import jsxA11yPlugin from 'eslint-plugin-jsx-a11y';
import typescriptParser from '@typescript-eslint/parser';
import typescriptPlugin from '@typescript-eslint/eslint-plugin';
import prettierConfig from 'eslint-config-prettier';
import { reactRules, tsRules, jsRules } from './eslint.rules.mjs';
export default [
{
ignores: [
'**/node_modules/',
'**/build/',
'**/dist/',
'**/storybook-static/',
'**/*.min.js',
'scripts/',
'.ncurc.*',
'package-lock.json',
'pnpm-lock.yaml',
],
},
{
languageOptions: {
ecmaVersion: 2020,
sourceType: 'module',
globals: {
...globals.browser,
...globals.node,
},
},
},
{
files: ['**/*.json'],
...json.configs.recommended,
},
{
files: ['*.mdx'],
plugins: {
mdx: mdxPlugin,
import: importPlugin,
react: reactPlugin,
'jsx-a11y': jsxA11yPlugin,
},
settings: {
react: {
version: 'detect',
},
},
rules: {
...jsxA11yPlugin.configs.recommended.rules,
...reactPlugin.configs.recommended.rules,
...prettierConfig.rules,
...jsRules,
...reactRules,
...mdxPlugin.configs.overrides.rules,
},
},
{
files: ['**/*.js', '**/*.jsx', '**/*.mjs'],
plugins: {
import: importPlugin,
react: reactPlugin,
'jsx-a11y': jsxA11yPlugin,
},
settings: {
react: {
version: 'detect',
},
},
rules: {
...jsxA11yPlugin.configs.recommended.rules,
...reactPlugin.configs.recommended.rules,
...prettierConfig.rules,
...jsRules,
...reactRules,
},
},
{
files: ['**/*.ts', '**/*.tsx'],
plugins: {
'@typescript-eslint': typescriptPlugin,
import: importPlugin,
react: reactPlugin,
'jsx-a11y': jsxA11yPlugin,
},
languageOptions: {
parser: typescriptParser,
},
settings: {
react: {
version: 'detect',
},
},
rules: {
...jsxA11yPlugin.configs.recommended.rules,
...reactPlugin.configs.recommended.rules,
...prettierConfig.rules,
...typescriptPlugin.configs.recommended.rules,
...jsRules,
...tsRules,
...reactRules,
},
},
];