-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy patheslint.config.mjs
91 lines (88 loc) · 2.34 KB
/
eslint.config.mjs
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
import globals from "globals";
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";
import pluginVue from "eslint-plugin-vue";
import eslintPluginUnicorn from "eslint-plugin-unicorn";
import importPlugin from "eslint-plugin-import";
import html from "eslint-plugin-html";
import { default as html2 } from "@html-eslint/eslint-plugin";
// import css from "@eslint/css";
/** @type {import('eslint').Linter.Config[]} */
export default [
{
files: ["**/*.{js,mjs,cjs,ts,vue,html}"],
ignores: [
"**/node_modules/**",
"**/dist/**",
"**/build/**",
"**/thirdparty/**",
"**/test_*",
],
},
{
plugins: {
html,
},
settings: {
"import/resolver": {
// You will also need to install and configure the TypeScript resolver
// See also https://github.com/import-js/eslint-import-resolver-typescript#configuration
typescript: true,
node: {
extensions: [".js", ".mjs", ".cjs", ".ts", ".vue"],
},
alias: {
map: [["/static/js", "./kaithem/src/js"]],
extensions: [".ts", ".js", ".jsx", ".json"],
},
},
},
},
html2.configs["flat/recommended"],
eslintPluginUnicorn.configs["flat/recommended"],
{ languageOptions: { globals: globals.browser } },
pluginJs.configs.recommended,
...tseslint.configs.recommended,
...pluginVue.configs["flat/essential"],
importPlugin.flatConfigs.recommended,
// {
// files: ["**/*.css"],
// language: "css/css",
// ...css.configs.recommended,
// },
{
files: ["**/*.vue"],
languageOptions: { parserOptions: { parser: tseslint.parser } },
},
{
rules: {
"import/no-unresolved": "error",
"vue/no-undef-properties": "error",
"unicorn/no-null": "off",
"unicorn/prevent-abbreviations": [
"error",
{
allowList: {
i: true,
j: true,
k: true,
v: true,
ref: true,
},
},
],
"@typescript-eslint/no-unused-vars": [
"error",
{
args: "all",
argsIgnorePattern: "^_",
caughtErrors: "all",
caughtErrorsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
varsIgnorePattern: "^_",
ignoreRestSiblings: true,
},
],
},
},
];