-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy patheslint.config.mjs
More file actions
44 lines (40 loc) · 1.17 KB
/
eslint.config.mjs
File metadata and controls
44 lines (40 loc) · 1.17 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
import importPlugin from 'eslint-plugin-import'
import js from '@eslint/js'
import stylistic from '@stylistic/eslint-plugin'
import tseslint from 'typescript-eslint'
import { includeIgnoreFile } from '@eslint/compat'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
const gitignorePath = path.resolve(__dirname, '.gitignore')
export default [
includeIgnoreFile(gitignorePath),
js.configs.recommended,
importPlugin.flatConfigs.recommended,
...tseslint.configs.recommended,
{
files: ['**/*.{js,mjs,cjs,ts,tsx}'],
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
plugins: {
'@stylistic': stylistic
},
rules: {
'@stylistic/indent': ['warn', 2, { SwitchCase: 1 }],
'@stylistic/quotes': ['error', 'single'],
'@stylistic/semi': ['error', 'never'],
'import/newline-after-import': ['warn', { count: 2 }],
'react/jsx-uses-react': 'off',
'react/react-in-jsx-scope': 'off'
},
settings: {
'import/resolver': {
typescript: true,
node: true,
},
}
},
]