Repository navigation
Expand file tree
/
Copy patheslint.config.js
More file actions
105 lines (102 loc) · 2.48 KB
/
Copy patheslint.config.js
File metadata and controls
105 lines (102 loc) · 2.48 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
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
101
102
103
104
105
// @ts-check
import hopeConfig, {
config,
globals,
tsParser,
// eslint-disable-next-line import-x/no-unresolved
} from "eslint-config-mister-hope";
export default config(
...hopeConfig,
{
ignores: [
"**/node_modules/**",
"coverage/**",
"packages/*/lib/**",
"packages/*/src/lib/**",
"**/.vuepress/.cache/",
"**/.vuepress/.temp/",
"**/.vuepress/dist/",
"**/.vuepress/snippets/",
"**/__tests__/__fixtures__/**",
],
},
{
languageOptions: {
ecmaVersion: "latest",
sourceType: "module",
parserOptions: {
parser: tsParser,
tsconfigDirName: import.meta.dirname,
projectService: {
allowDefaultProject: [".markdownlint-cli2.mjs", "eslint.config.js"],
},
extraFileExtensions: [".vue"],
},
},
},
{
files: ["**/*.ts"],
rules: {
"@typescript-eslint/naming-convention": [
"warn",
{
selector: "default",
format: ["camelCase"],
leadingUnderscore: "allowSingleOrDouble",
trailingUnderscore: "allow",
},
{
selector: ["variable"],
format: ["camelCase", "PascalCase", "UPPER_CASE"],
leadingUnderscore: "allowSingleOrDouble",
trailingUnderscore: "allowSingleOrDouble",
},
{
selector: ["parameter"],
format: ["camelCase", "PascalCase"],
leadingUnderscore: "allow",
trailingUnderscore: "allow",
},
// allow locales path like `/zh/` and css property like `line-width`
{
selector: ["property"],
format: null,
custom: {
regex: "(^/$|^/.*/$|^[a-z]+(?:-[a-z]+)*?$)",
match: true,
},
filter: "(^/$|^/.*/$|^[a-z]+(?:-[a-z]+)*?$)",
},
{
selector: ["property"],
format: ["camelCase", "PascalCase", "UPPER_CASE"],
leadingUnderscore: "allow",
trailingUnderscore: "allow",
},
{
selector: "import",
format: ["PascalCase", "camelCase"],
},
{
selector: "typeLike",
format: ["PascalCase"],
},
],
},
},
{
files: ["scripts/**.ts", "**/gulpfile.js"],
languageOptions: {
globals: globals.node,
},
},
{
files: ["**/*.cjs"],
languageOptions: {
globals: globals.node,
},
rules: {
"@typescript-eslint/no-var-requires": "off",
},
},
);