-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.mjs
More file actions
105 lines (102 loc) · 2.63 KB
/
eslint.config.mjs
File metadata and controls
105 lines (102 loc) · 2.63 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
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
import { dirname } from 'path'
import { fileURLToPath } from 'url'
import { FlatCompat } from '@eslint/eslintrc'
import eslint from '@eslint/js'
import fsdPlugin from 'eslint-plugin-fsd-lint'
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
const compat = new FlatCompat({
baseDirectory: __dirname,
})
const config = [
{
ignores: ['.next/*', 'node_modules/*', '!src/**/*'],
},
eslint.configs.recommended,
...compat.extends(
'next/core-web-vitals',
'next/typescript',
'plugin:storybook/recommended',
'prettier',
),
{
files: ['**/*.{ts,tsx}'],
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
{
files: ['**/*.{js,jsx,ts,tsx}'],
settings: {
react: {
version: '19.0.0',
},
},
rules: {
'react/react-in-jsx-scope': 'off',
'import/no-extraneous-dependencies': 'off',
'import/no-internal-modules': 'off',
'no-unused-vars': 'warn',
'no-console': 'warn',
'no-multiple-empty-lines': 'warn',
'no-var': 'error',
'no-duplicate-case': 'error',
'padding-line-between-statements': [
'warn',
{
blankLine: 'always',
prev: '*',
next: 'return',
},
],
eqeqeq: ['warn', 'always'],
'arrow-parens': ['warn', 'as-needed'],
'arrow-spacing': 'warn',
'prefer-destructuring': 'warn',
'react/jsx-curly-brace-presence': 'warn',
'react/prop-types': 'off',
'react-hooks/exhaustive-deps': 'warn',
'react/self-closing-comp': [
'warn',
{
component: true,
html: true,
},
],
'react/destructuring-assignment': 'warn',
'react/jsx-no-useless-fragment': 'warn',
'react/jsx-key': 'error',
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/no-shadow': 'warn',
'@typescript-eslint/no-duplicate-enum-values': 'off',
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal', 'index'],
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
'newlines-between': 'always',
},
],
},
},
{
plugins: {
fsd: fsdPlugin,
},
rules: {
'fsd/forbidden-imports': 'error',
'fsd/no-public-api-sidestep': 'error',
'fsd/no-cross-slice-dependency': 'error',
'fsd/no-ui-in-business-logic': 'error',
'fsd/no-global-store-imports': 'error',
'fsd/ordered-imports': 'warn',
},
},
]
export default config