-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy patheslint.config.mjs
More file actions
46 lines (45 loc) · 1.41 KB
/
eslint.config.mjs
File metadata and controls
46 lines (45 loc) · 1.41 KB
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
import eslint from '@eslint/js'
import react from 'eslint-plugin-react'
import reactHooks from 'eslint-plugin-react-hooks'
import storybook from 'eslint-plugin-storybook'
import { defineConfig } from 'eslint/config'
import globals from 'globals'
import typescript from 'typescript-eslint'
export default defineConfig(
eslint.configs.recommended,
typescript.configs.strictTypeChecked,
typescript.configs.stylisticTypeChecked,
react.configs.flat.recommended,
react.configs.flat['jsx-runtime'],
reactHooks.configs.flat.recommended,
storybook.configs['flat/recommended'],
{
rules: {
'no-console': 'error',
'@typescript-eslint/array-type': ['error', { default: 'generic' }],
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
'@typescript-eslint/non-nullable-type-assertion-style': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'react/no-unescaped-entities': 'off',
},
languageOptions: {
globals: {
...globals.browser,
...globals.node,
},
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
settings: {
react: {
version: '19', // avoids auto-detection crash
},
},
},
{
// Note: there must be no other properties in this object
ignores: ['build/', 'coverage/', 'docs/', 'examples/', 'rollup.config.mjs'],
},
)