-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint9.config.js
100 lines (93 loc) · 2.85 KB
/
eslint9.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
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
const { FlatCompat } = require("@eslint/eslintrc")
const baseConfig = require("./libs/eslint-config/config.js")
const js = require("@eslint/js")
const regexpPlugin = require("eslint-plugin-regexp")
const pluginVue = require("eslint-plugin-vue")
const globals = require("globals")
// const optimizeRegexAllPlugin = require("eslint-plugin-optimize-regex")
const nounsanitized = require("eslint-plugin-no-unsanitized")
const importPlugin = require("eslint-plugin-import")
const pluginSecurity = require("eslint-plugin-security")
// const airbnbBasePlugin = require("eslint-config-airbnb-base")
const typescriptEslintParser = require("@typescript-eslint/parser")
const vueParcser = require("vue-eslint-parser")
const compat = new FlatCompat({
baseDirectory: __dirname,
})
const ignores = [
"node_modules/**/*",
"dist/**/*",
".nuxt/**/*",
"libs/**/*",
"old_files/**/*",
"static/sw.js",
"src/types/backend/backendApi.ts",
]
module.exports = [
js.configs.recommended,
/** More */
regexpPlugin.configs["flat/recommended"], // Regulars
...compat.extends("plugin:optimize-regex/all"), // Regulars
...compat.extends("plugin:lodash/recommended"), // Makes you use lodash
...compat.extends("plugin:promise/recommended"), // Promises
// importPlugin.flatConfigs.recommended, // Import
...compat.extends(importPlugin.flatConfigs.typescript), // Typescript import
...compat.extends("plugin:eslint-comments/recommended"), // Eslint comments
/** Packs */
// ...compat.extends("airbnb-base"),
// airbnbBasePlugin,
// ...compat.extends("plugin:sonarjs/recommended"),
...compat.extends("plugin:unicorn/all"),
// ...compat.extends("google"),
...compat.extends("prettier"), // Prettier
//
// /** Security */
nounsanitized.configs.recommended,
pluginSecurity.configs.recommended,
...compat.extends("plugin:jsonc/base"),
// /** Core nuxt */
...compat.extends("plugin:jsx-a11y/strict"), // Jsx
...compat.extends("plugin:@typescript-eslint/recommended"),
...compat.extends("plugin:nuxt/recommended"),
...compat.extends("plugin:vue/vue3-recommended"),
...pluginVue.configs["flat/recommended"],
{
...baseConfig,
files: ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"],
languageOptions: {
globals: {
...globals.browser,
...globals.node,
...globals.es2024,
},
parser: typescriptEslintParser,
parserOptions: {
ecmaVersion: 2024,
ecmaFeatures: {
jsx: true,
},
},
},
ignores,
},
{
...baseConfig,
files: ["**/*.vue"],
languageOptions: {
globals: {
...globals.browser,
...globals.node,
...globals.es2024,
},
parser: vueParcser,
parserOptions: {
parser: typescriptEslintParser,
ecmaVersion: 2024,
ecmaFeatures: {
jsx: true,
},
},
},
ignores,
},
]