-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
75 lines (68 loc) · 2.19 KB
/
eslint.config.mjs
File metadata and controls
75 lines (68 loc) · 2.19 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
import { FlatCompat } from '@eslint/eslintrc'
import js from '@eslint/js'
import tsPlugin from '@typescript-eslint/eslint-plugin'
import tsParser from '@typescript-eslint/parser'
import eslintComments from 'eslint-plugin-eslint-comments'
import functionalPlugin from 'eslint-plugin-functional'
import importPlugin from 'eslint-plugin-import'
import globals from 'globals'
import { fileURLToPath } from 'node:url'
import { dirname } from 'node:path'
const functionalPatched = {
...functionalPlugin,
rules: {
...functionalPlugin.rules,
'no-mixed-type': { meta: { schema: [] }, create: () => ({}) }
}
}
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended
})
export default [
{ ignores: ['node_modules/**', 'build/**', 'coverage/**'] },
...compat.extends(
'eslint:recommended',
'plugin:eslint-comments/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:import/typescript',
'prettier'
),
{
files: ['**/*.{ts,tsx}'],
languageOptions: {
parser: tsParser,
ecmaVersion: 'latest',
sourceType: 'module',
globals: {
...globals.node,
BigInt: 'readonly',
console: 'readonly',
WebAssembly: 'readonly'
}
},
plugins: {
'@typescript-eslint': tsPlugin,
import: importPlugin,
'eslint-comments': eslintComments,
functional: functionalPatched
},
rules: {
'@typescript-eslint/explicit-module-boundary-types': 'off',
'comma-dangle': 0,
'eslint-comments/disable-enable-pair': ['error', { allowWholeFile: true }],
'eslint-comments/no-unused-disable': 'error',
'import/order': ['error', { 'newlines-between': 'always', alphabetize: { order: 'asc' } }],
'max-len': [
'error',
{ code: 120, ignoreUrls: true, ignoreStrings: true, ignoreTemplateLiterals: true, ignoreRegExpLiterals: true }
],
semi: 0,
'sort-imports': ['error', { ignoreDeclarationSort: true, ignoreCase: true }],
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-explicit-any': 'off'
}
}
]