-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
eslint.config.js
109 lines (107 loc) · 3.14 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
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
106
107
108
109
"use strict"
/** @type {import('eslint').Linter.FlatConfig[]} */
const config = [
{
ignores: [
".nyc_output/",
"coverage/",
"!docs/.vitepress",
"docs/.vitepress/dist/",
"docs/.vitepress/cache/",
"node_modules/",
],
},
{
plugins: {
my: require("./eslint-internal/my-plugin.js"),
},
},
...require("./eslint-internal/config/es2020.js"),
...require("./eslint-internal/config/+eslint-plugin.js"),
{
rules: {
"no-restricted-properties": [
"error",
{
object: "context",
property: "getSourceCode",
message: "Use eslint-compat-utils",
},
{
object: "context",
property: "getFilename",
message: "Use eslint-compat-utils",
},
{
object: "context",
property: "getPhysicalFilename",
message: "Use eslint-compat-utils",
},
{
object: "context",
property: "getCwd",
message: "Use eslint-compat-utils",
},
{
object: "context",
property: "getScope",
message: "Use sourceCode.getScope(node)",
},
{
object: "context",
property: "parserServices",
message: "Use sourceCode.parserServices",
},
{
object: "context",
property: "getDeclaredVariables",
message: "Use sourceCode.getDeclaredVariables(node)",
},
],
},
},
{
files: ["lib/rules/**/*.js"],
rules: {
"eslint-plugin/require-meta-docs-url": [
"error",
{
pattern:
"http://eslint-community.github.io/eslint-plugin-es-x/rules/{{name}}.html",
},
],
},
},
{
files: ["docs/.vitepress/**"],
rules: {
"n/no-missing-import": "off",
"n/no-extraneous-import": "off",
"n/file-extension-in-import": "off",
"n/no-extraneous-require": "off",
},
languageOptions: {
globals: {
window: "readonly",
document: "readonly",
},
},
},
{
files: ["docs/.vitepress/**/*.vue"],
rules: {
"vue/multiline-html-element-content-newline": "off",
"vue/singleline-html-element-content-newline": "off",
"vue/component-definition-name-casing": "off",
"vue/html-self-closing": "off",
"vue/comma-dangle": "off",
},
},
{
files: ["scripts/**/*.js"],
rules: {
"n/no-unsupported-features/node-builtins": "off",
},
},
]
module.exports = config