generated from wopjs/template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
82 lines (80 loc) · 2.48 KB
/
index.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
import jsEslint from "@eslint/js";
import gitignore from "eslint-config-flat-gitignore";
import eslintConfigPrettier from "eslint-config-prettier";
import importX from "eslint-plugin-import-x";
import jsonc from "eslint-plugin-jsonc";
import perfectionist from "eslint-plugin-perfectionist";
import tsEslint from "typescript-eslint";
export const defineConfig = tsEslint.config;
export default tsEslint.config(
gitignore(),
eslintConfigPrettier,
{
extends: [jsEslint.configs.recommended, ...tsEslint.configs.recommended, importX.flatConfigs.recommended],
files: ["**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}"],
languageOptions: {
ecmaVersion: "latest",
globals: {
console: true,
process: true,
},
parser: tsEslint.parser,
sourceType: "module",
},
name: "typescript",
plugins: {
"@typescript-eslint": tsEslint.plugin,
perfectionist: perfectionist,
},
rules: {
"@typescript-eslint/consistent-type-imports": ["error", { fixStyle: "inline-type-imports" }],
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
ignoreRestSiblings: true,
varsIgnorePattern: "^_",
},
],
"import-x/consistent-type-specifier-style": ["error", "prefer-inline"],
"import-x/no-duplicates": ["error", { considerQueryString: true, "prefer-inline": true }],
"import-x/no-unresolved": "off",
"import-x/order": "off",
"perfectionist/sort-imports": [
"error",
{
groups: [
"side-effect-style",
"style",
["builtin-type", "external-type", "internal-type", "parent-type", "sibling-type", "index-type"],
["builtin", "external"],
["internal", "parent", "sibling", "index"],
"object",
"unknown",
],
},
],
"prefer-const": "off",
"sort-imports": "off",
},
},
{
extends: jsonc.configs["flat/recommended-with-json"],
files: [
"src/**/*.json",
"scripts/**/*.json",
"tsconfig.json",
".prettierrc.json",
".prettierrc",
"typedoc.json",
"mangle-cache.json",
],
name: "json",
rules: {
"jsonc/sort-keys": ["error", "asc", { caseSensitive: true, minKeys: 2, natural: true }],
},
},
);