-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
eslint.config.js
50 lines (49 loc) · 1.47 KB
/
eslint.config.js
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
import javascriptEslint from '@eslint/js'
import eslintConfigPrettier from 'eslint-config-prettier'
import eslintPluginJsdoc from 'eslint-plugin-jsdoc'
import eslintPluginPrettier from 'eslint-plugin-prettier'
import eslintPluginRegexp from 'eslint-plugin-regexp'
import eslintPluginUnicorn from 'eslint-plugin-unicorn'
import globals from 'globals'
import typescriptEslint from 'typescript-eslint'
export default typescriptEslint.config(
{
// config with just ignores is the replacement for `.eslintignore`
ignores: ['**/build/**', '**/dist/**', '**/.wrangler/**'],
},
javascriptEslint.configs.recommended,
eslintPluginJsdoc.configs['flat/recommended-typescript-error'],
eslintPluginRegexp.configs['flat/recommended'],
...typescriptEslint.configs.strictTypeChecked,
...typescriptEslint.configs.stylisticTypeChecked,
{
languageOptions: {
globals: {
...globals.browser,
...globals.node,
},
},
},
{
plugins: {
'@typescript-eslint': typescriptEslint.plugin,
unicorn: eslintPluginUnicorn,
prettier: eslintPluginPrettier,
},
languageOptions: {
parser: typescriptEslint.parser,
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
...eslintPluginUnicorn.rules.recommended,
},
},
{
files: ['**/*.js'],
...typescriptEslint.configs.disableTypeChecked,
},
eslintConfigPrettier, // eslint-config-prettier last
)