@ota-meshi/eslint-plugin 0.15.3 → 0.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/config-builder/+astro-with-ts.js +38 -0
- package/lib/config-builder/+astro.js +30 -0
- package/lib/config-builder/+eslint-plugin.js +26 -0
- package/lib/config-builder/+json.js +32 -0
- package/lib/config-builder/+md.js +43 -0
- package/lib/config-builder/+node.js +29 -0
- package/lib/config-builder/+package-json.js +29 -0
- package/lib/config-builder/+prettier.js +28 -0
- package/lib/config-builder/+svelte-with-ts.js +42 -0
- package/lib/config-builder/+svelte.js +30 -0
- package/lib/config-builder/+toml.js +32 -0
- package/lib/config-builder/+typescript.js +17 -0
- package/lib/config-builder/+vue2-with-ts.js +38 -0
- package/lib/config-builder/+vue2.js +30 -0
- package/lib/config-builder/+vue3-with-ts.js +38 -0
- package/lib/config-builder/+vue3.js +30 -0
- package/lib/config-builder/+yaml.js +32 -0
- package/lib/config-builder/base-plugins/eslint-comments.js +20 -0
- package/lib/config-builder/base-plugins/regexp.js +20 -0
- package/lib/config-builder/fallback.js +22 -0
- package/lib/config-builder/index.js +50 -0
- package/lib/config-builder/plugins/json-schema.js +30 -0
- package/lib/config-builder/plugins/ts/base-config.js +44 -0
- package/lib/config-builder/plugins/ts/index.js +5 -0
- package/lib/config-builder/recommended.js +38 -0
- package/lib/config-helpers/+astro.js +5 -0
- package/lib/config-helpers/+eslint-plugin.js +102 -0
- package/lib/config-helpers/+json.js +10 -0
- package/lib/config-helpers/+md.js +44 -0
- package/lib/config-helpers/+node.js +25 -0
- package/lib/config-helpers/+package-json.js +4 -0
- package/lib/config-helpers/+prettier.js +44 -0
- package/lib/config-helpers/+svelte.js +16 -0
- package/lib/config-helpers/+toml.js +5 -0
- package/lib/config-helpers/+typescript.js +18 -0
- package/lib/config-helpers/+vue.js +5 -0
- package/lib/config-helpers/+yaml.js +7 -0
- package/lib/config-helpers/base-plugins/eslint-comments.js +7 -0
- package/lib/config-helpers/base-plugins/regexp.js +10 -0
- package/lib/config-helpers/plugins/json-schema.js +31 -0
- package/lib/config-helpers/plugins/ts/base-config.js +114 -0
- package/lib/config-helpers/plugins/ts/index.js +21 -0
- package/lib/config-helpers/recommended.js +241 -0
- package/lib/configs/+eslint-plugin.js +22 -95
- package/lib/configs/+json.js +22 -22
- package/lib/configs/+md.js +30 -29
- package/lib/configs/+node.js +23 -29
- package/lib/configs/+package-json.js +20 -20
- package/lib/configs/+prettier.js +23 -70
- package/lib/configs/+svelte-with-ts.js +47 -25
- package/lib/configs/+svelte.js +23 -32
- package/lib/configs/+toml.js +20 -18
- package/lib/configs/+typescript.js +48 -32
- package/lib/configs/+vue2-with-ts.js +48 -25
- package/lib/configs/+vue2.js +24 -25
- package/lib/configs/+vue3-with-ts.js +48 -25
- package/lib/configs/+vue3.js +24 -25
- package/lib/configs/+yaml.js +22 -22
- package/lib/configs/base-plugins/eslint-comments.js +7 -9
- package/lib/configs/base-plugins/regexp.js +6 -11
- package/lib/configs/fallback.js +15 -0
- package/lib/configs/json-schema/config.js +14 -31
- package/lib/configs/recommended.js +25 -255
- package/lib/configs/ts/base-config.js +10 -118
- package/lib/configs/ts/index.js +4 -16
- package/lib/index.js +15 -23
- package/lib/parsers/any-parser.js +29 -0
- package/lib/rules/missing-module-for-config.js +35 -53
- package/lib/utils/find-root-dir.js +21 -18
- package/lib/utils/get-linters.js +27 -27
- package/lib/utils/module.js +81 -59
- package/package.json +22 -14
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.recommendedTestGlobals = exports.recommendedTestRules = exports.recommendedTestFiles = exports.recommendedRules = void 0;
|
|
4
|
+
exports.recommendedRules = {
|
|
5
|
+
// warns
|
|
6
|
+
"no-warning-comments": "warn",
|
|
7
|
+
"no-console": "warn",
|
|
8
|
+
"no-alert": "warn",
|
|
9
|
+
//
|
|
10
|
+
"no-extra-parens": "error",
|
|
11
|
+
"accessor-pairs": "error",
|
|
12
|
+
"consistent-return": "error",
|
|
13
|
+
eqeqeq: ["error", "always", { null: "ignore" }],
|
|
14
|
+
"no-eval": "error",
|
|
15
|
+
"no-extend-native": "error",
|
|
16
|
+
"no-extra-bind": "error",
|
|
17
|
+
"no-extra-label": "error",
|
|
18
|
+
"no-multi-str": "error",
|
|
19
|
+
"no-new-wrappers": "error",
|
|
20
|
+
"no-octal-escape": "error",
|
|
21
|
+
"no-sequences": "error",
|
|
22
|
+
"no-useless-call": "error",
|
|
23
|
+
"no-useless-concat": "error",
|
|
24
|
+
"no-new-object": "error",
|
|
25
|
+
"no-tabs": "error",
|
|
26
|
+
"require-jsdoc": "error",
|
|
27
|
+
"prefer-template": "error",
|
|
28
|
+
"object-shorthand": "error",
|
|
29
|
+
"array-callback-return": "error",
|
|
30
|
+
camelcase: "error",
|
|
31
|
+
curly: "error",
|
|
32
|
+
"default-case": "error",
|
|
33
|
+
"default-param-last": "error",
|
|
34
|
+
"dot-notation": "error",
|
|
35
|
+
"for-direction": "error",
|
|
36
|
+
"func-style": ["error", "declaration"],
|
|
37
|
+
"getter-return": "error",
|
|
38
|
+
// "init-declarations": "error",
|
|
39
|
+
"linebreak-style": ["error", "unix"],
|
|
40
|
+
"lines-between-class-members": "error",
|
|
41
|
+
"max-statements-per-line": ["error", { max: 1 }],
|
|
42
|
+
"multiline-comment-style": ["error", "separate-lines"],
|
|
43
|
+
"new-cap": "error",
|
|
44
|
+
"no-array-constructor": "error",
|
|
45
|
+
"no-async-promise-executor": "error",
|
|
46
|
+
"no-caller": "error",
|
|
47
|
+
"no-case-declarations": "error",
|
|
48
|
+
"no-compare-neg-zero": "error",
|
|
49
|
+
"no-cond-assign": "error",
|
|
50
|
+
"no-constant-condition": "error",
|
|
51
|
+
"no-control-regex": "error",
|
|
52
|
+
"no-debugger": "error",
|
|
53
|
+
"no-delete-var": "error",
|
|
54
|
+
"no-div-regex": "error",
|
|
55
|
+
"no-dupe-args": "error",
|
|
56
|
+
"no-dupe-keys": "error",
|
|
57
|
+
"no-duplicate-case": "error",
|
|
58
|
+
"no-else-return": "error",
|
|
59
|
+
"no-empty": "error",
|
|
60
|
+
"no-empty-character-class": "error",
|
|
61
|
+
"no-empty-function": "error",
|
|
62
|
+
"no-empty-pattern": "error",
|
|
63
|
+
"no-ex-assign": "error",
|
|
64
|
+
"no-extra-boolean-cast": "error",
|
|
65
|
+
"no-fallthrough": "error",
|
|
66
|
+
"no-func-assign": "error",
|
|
67
|
+
"no-global-assign": "error",
|
|
68
|
+
"no-implicit-coercion": "error",
|
|
69
|
+
"no-implicit-globals": "error",
|
|
70
|
+
"no-implied-eval": "error",
|
|
71
|
+
"no-import-assign": "error",
|
|
72
|
+
"no-inner-declarations": ["error", "functions"],
|
|
73
|
+
"no-invalid-regexp": "error",
|
|
74
|
+
"no-invalid-this": "error",
|
|
75
|
+
"no-irregular-whitespace": [
|
|
76
|
+
"error",
|
|
77
|
+
{
|
|
78
|
+
skipComments: false,
|
|
79
|
+
skipRegExps: false,
|
|
80
|
+
skipStrings: false,
|
|
81
|
+
skipTemplates: false,
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
"no-iterator": "error",
|
|
85
|
+
"no-label-var": "error",
|
|
86
|
+
"no-lone-blocks": "error",
|
|
87
|
+
"no-lonely-if": "error",
|
|
88
|
+
"no-loop-func": "error",
|
|
89
|
+
"no-misleading-character-class": "error",
|
|
90
|
+
"no-mixed-operators": [
|
|
91
|
+
"error",
|
|
92
|
+
{
|
|
93
|
+
groups: [
|
|
94
|
+
["&", "|", "^", "~", "<<", ">>", ">>>"],
|
|
95
|
+
["&&", "||"],
|
|
96
|
+
],
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
"no-new": "error",
|
|
100
|
+
"no-new-require": "error",
|
|
101
|
+
"no-obj-calls": "error",
|
|
102
|
+
"no-octal": "error",
|
|
103
|
+
"no-param-reassign": ["error", { props: false }],
|
|
104
|
+
"no-process-env": "error",
|
|
105
|
+
"no-process-exit": "error",
|
|
106
|
+
"no-prototype-builtins": "error",
|
|
107
|
+
"no-redeclare": ["error", { builtinGlobals: true }],
|
|
108
|
+
"no-regex-spaces": "error",
|
|
109
|
+
"no-restricted-properties": [
|
|
110
|
+
"error",
|
|
111
|
+
{ property: "__count__" },
|
|
112
|
+
{ property: "__noSuchMethod__" },
|
|
113
|
+
{ property: "__parent__" },
|
|
114
|
+
{ property: "__defineGetter__" },
|
|
115
|
+
{ property: "__defineSetter__" },
|
|
116
|
+
{ property: "__lookupGetter__" },
|
|
117
|
+
{ property: "__lookupSetter__" },
|
|
118
|
+
],
|
|
119
|
+
"no-return-assign": "error",
|
|
120
|
+
"no-return-await": "error",
|
|
121
|
+
"no-script-url": "error",
|
|
122
|
+
"no-self-assign": ["error", { props: true }],
|
|
123
|
+
"no-self-compare": "error",
|
|
124
|
+
"no-shadow": ["error", { builtinGlobals: true }],
|
|
125
|
+
"no-shadow-restricted-names": "error",
|
|
126
|
+
"no-sparse-arrays": "error",
|
|
127
|
+
"no-throw-literal": "error",
|
|
128
|
+
"no-undef": ["error", { typeof: true }],
|
|
129
|
+
"no-unexpected-multiline": "error",
|
|
130
|
+
"no-unmodified-loop-condition": "error",
|
|
131
|
+
"no-unneeded-ternary": "error",
|
|
132
|
+
"no-unreachable": "error",
|
|
133
|
+
"no-unsafe-finally": "error",
|
|
134
|
+
"no-unsafe-negation": ["error", { enforceForOrderingRelations: true }],
|
|
135
|
+
"no-unused-expressions": "error",
|
|
136
|
+
"no-unused-labels": "error",
|
|
137
|
+
"no-unused-vars": [
|
|
138
|
+
"error",
|
|
139
|
+
{
|
|
140
|
+
args: "all",
|
|
141
|
+
argsIgnorePattern: "^_(?:[^_].*)?$",
|
|
142
|
+
caughtErrors: "all",
|
|
143
|
+
vars: "all",
|
|
144
|
+
varsIgnorePattern: "^_(?:[^_].*)?$",
|
|
145
|
+
},
|
|
146
|
+
],
|
|
147
|
+
"no-use-before-define": ["error", "nofunc"],
|
|
148
|
+
"no-useless-catch": "error",
|
|
149
|
+
"no-useless-escape": "error",
|
|
150
|
+
"no-useless-return": "error",
|
|
151
|
+
"no-void": ["error", { allowAsStatement: true }],
|
|
152
|
+
"no-with": "error",
|
|
153
|
+
"no-var": "error",
|
|
154
|
+
"one-var": [
|
|
155
|
+
"error",
|
|
156
|
+
{
|
|
157
|
+
initialized: "never",
|
|
158
|
+
uninitialized: "always",
|
|
159
|
+
},
|
|
160
|
+
],
|
|
161
|
+
"padding-line-between-statements": [
|
|
162
|
+
"error",
|
|
163
|
+
{ blankLine: "always", next: "*", prev: "directive" },
|
|
164
|
+
{ blankLine: "always", next: "function", prev: "*" },
|
|
165
|
+
{ blankLine: "always", next: "*", prev: "function" },
|
|
166
|
+
],
|
|
167
|
+
"prefer-promise-reject-errors": "error",
|
|
168
|
+
"prefer-regex-literals": "error",
|
|
169
|
+
quotes: ["error", "double", { avoidEscape: true }],
|
|
170
|
+
radix: "error",
|
|
171
|
+
"require-atomic-updates": "error",
|
|
172
|
+
"require-await": "error",
|
|
173
|
+
"spaced-comment": [
|
|
174
|
+
"error",
|
|
175
|
+
"always",
|
|
176
|
+
{
|
|
177
|
+
block: {
|
|
178
|
+
balanced: true,
|
|
179
|
+
markers: [
|
|
180
|
+
"eslint",
|
|
181
|
+
"eslint-env",
|
|
182
|
+
"eslint-disable",
|
|
183
|
+
"eslint-enable",
|
|
184
|
+
"exported",
|
|
185
|
+
"globals",
|
|
186
|
+
"istanbul",
|
|
187
|
+
],
|
|
188
|
+
},
|
|
189
|
+
line: {
|
|
190
|
+
exceptions: ["-", "="],
|
|
191
|
+
markers: [
|
|
192
|
+
"eslint-disable-line",
|
|
193
|
+
"eslint-disable-next-line",
|
|
194
|
+
"istanbul",
|
|
195
|
+
"TODO:",
|
|
196
|
+
"FIXME:",
|
|
197
|
+
],
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
],
|
|
201
|
+
strict: ["error", "global"],
|
|
202
|
+
"use-isnan": [
|
|
203
|
+
"error",
|
|
204
|
+
{ enforceForIndexOf: true, enforceForSwitchCase: true },
|
|
205
|
+
],
|
|
206
|
+
"valid-typeof": ["error", { requireStringLiterals: true }],
|
|
207
|
+
yoda: ["error", "never", { exceptRange: true }],
|
|
208
|
+
// Enabled rules as warnings.
|
|
209
|
+
complexity: ["warn", { max: 16 }],
|
|
210
|
+
"max-nested-callbacks": ["warn", { max: 4 }],
|
|
211
|
+
"max-params": ["warn", { max: 8 }],
|
|
212
|
+
};
|
|
213
|
+
exports.recommendedTestFiles = [
|
|
214
|
+
"test/**/*.js",
|
|
215
|
+
"tests/**/*.js",
|
|
216
|
+
"test/**/*.cjs",
|
|
217
|
+
"tests/**/*.cjs",
|
|
218
|
+
"test/**/*.mjs",
|
|
219
|
+
"tests/**/*.mjs",
|
|
220
|
+
"test/**/*.ts",
|
|
221
|
+
"tests/**/*.ts",
|
|
222
|
+
"test/**/*.mts",
|
|
223
|
+
"tests/**/*.mts",
|
|
224
|
+
"test/**/*.cts",
|
|
225
|
+
"tests/**/*.cts",
|
|
226
|
+
];
|
|
227
|
+
exports.recommendedTestRules = {
|
|
228
|
+
"require-jsdoc": "off",
|
|
229
|
+
"no-console": "off",
|
|
230
|
+
};
|
|
231
|
+
exports.recommendedTestGlobals = {
|
|
232
|
+
after: "readonly",
|
|
233
|
+
afterEach: "readonly",
|
|
234
|
+
before: "readonly",
|
|
235
|
+
beforeEach: "readonly",
|
|
236
|
+
describe: "readonly",
|
|
237
|
+
it: "readonly",
|
|
238
|
+
mocha: "readonly",
|
|
239
|
+
xdescribe: "readonly",
|
|
240
|
+
xit: "readonly",
|
|
241
|
+
};
|
|
@@ -1,101 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
module.exports =
|
|
6
|
-
["eslint-plugin-eslint-plugin"],
|
|
7
|
-
() => ({
|
|
2
|
+
const module_js_1 = require("../utils/module.js");
|
|
3
|
+
const _eslint_plugin_js_1 = require("../config-helpers/+eslint-plugin.js");
|
|
4
|
+
const fallback_js_1 = require("./fallback.js");
|
|
5
|
+
module.exports = (0, module_js_1.requireOf)(["eslint-plugin-eslint-plugin"], () => ({
|
|
8
6
|
plugins: ["eslint-plugin"],
|
|
9
7
|
overrides: [
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
],
|
|
16
|
-
rules: {
|
|
17
|
-
"eslint-plugin/consistent-output": "error",
|
|
18
|
-
"eslint-plugin/meta-property-ordering": [
|
|
19
|
-
"error",
|
|
20
|
-
[
|
|
21
|
-
"deprecated",
|
|
22
|
-
"docs",
|
|
23
|
-
"fixable",
|
|
24
|
-
"messages",
|
|
25
|
-
"replacedBy",
|
|
26
|
-
"schema",
|
|
27
|
-
"type",
|
|
28
|
-
],
|
|
29
|
-
],
|
|
30
|
-
"eslint-plugin/no-deprecated-context-methods": "error",
|
|
31
|
-
"eslint-plugin/prefer-output-null": "error",
|
|
32
|
-
"eslint-plugin/prefer-placeholders": "error",
|
|
33
|
-
"eslint-plugin/prefer-replace-text": "error",
|
|
34
|
-
"eslint-plugin/report-message-format": ["error", "[^a-z'\"{].*\\.$"],
|
|
35
|
-
"eslint-plugin/require-meta-docs-description": "error",
|
|
36
|
-
"eslint-plugin/require-meta-docs-url": [
|
|
37
|
-
"error",
|
|
38
|
-
{ pattern: rulesDocumentUrl() },
|
|
39
|
-
],
|
|
40
|
-
"eslint-plugin/require-meta-fixable": "error",
|
|
41
|
-
"eslint-plugin/require-meta-schema": "error",
|
|
42
|
-
"eslint-plugin/require-meta-type": "error",
|
|
43
|
-
"eslint-plugin/test-case-property-ordering": [
|
|
44
|
-
"error",
|
|
45
|
-
[
|
|
46
|
-
"filename",
|
|
47
|
-
"code",
|
|
48
|
-
"output",
|
|
49
|
-
"options",
|
|
50
|
-
"parser",
|
|
51
|
-
"parserOptions",
|
|
52
|
-
"globals",
|
|
53
|
-
"env",
|
|
54
|
-
"errors",
|
|
8
|
+
{
|
|
9
|
+
files: _eslint_plugin_js_1.eslintPluginFiles,
|
|
10
|
+
extends: [
|
|
11
|
+
require.resolve("./+node"),
|
|
12
|
+
"plugin:eslint-plugin/recommended",
|
|
55
13
|
],
|
|
56
|
-
|
|
57
|
-
|
|
14
|
+
rules: {
|
|
15
|
+
..._eslint_plugin_js_1.eslintPluginExtendRules,
|
|
16
|
+
},
|
|
58
17
|
},
|
|
59
|
-
},
|
|
60
18
|
],
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
fs.readFileSync(path.join(process.cwd(), "package.json"), "utf8"),
|
|
72
|
-
);
|
|
73
|
-
const baseUrl = getBaseUrl(repository);
|
|
74
|
-
if (baseUrl) {
|
|
75
|
-
return `${baseUrl}/blob/v${version}/docs/rules/{{name}}.md`;
|
|
76
|
-
}
|
|
77
|
-
} catch (_error) {
|
|
78
|
-
// ignore
|
|
79
|
-
}
|
|
80
|
-
return undefined;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Get the base URL from a given repository information.
|
|
85
|
-
* @param {string|{type:string,url:string}} repository The repository information.
|
|
86
|
-
* @returns {string|null} The base URL.
|
|
87
|
-
*/
|
|
88
|
-
function getBaseUrl(repository) {
|
|
89
|
-
if (typeof repository === "string") {
|
|
90
|
-
return `https://github.com/${repository}`;
|
|
91
|
-
}
|
|
92
|
-
if (
|
|
93
|
-
repository &&
|
|
94
|
-
typeof repository.url === "string" &&
|
|
95
|
-
/^git\+.+\.git$/u.test(repository.url)
|
|
96
|
-
) {
|
|
97
|
-
return repository.url.slice(4, -4);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
return null;
|
|
101
|
-
}
|
|
19
|
+
}), (missingList) => {
|
|
20
|
+
return {
|
|
21
|
+
overrides: [
|
|
22
|
+
{
|
|
23
|
+
files: _eslint_plugin_js_1.eslintPluginFiles,
|
|
24
|
+
...(0, fallback_js_1.buildFallbackForLegacy)(missingList),
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
};
|
|
28
|
+
});
|
package/lib/configs/+json.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
const module_js_1 = require("../utils/module.js");
|
|
3
|
+
const _json_js_1 = require("../config-helpers/+json.js");
|
|
4
|
+
const fallback_js_1 = require("./fallback.js");
|
|
5
|
+
module.exports = (0, module_js_1.requireOf)(["eslint-plugin-jsonc"], () => ({
|
|
6
6
|
overrides: [
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
{
|
|
8
|
+
files: _json_js_1.jsonFiles,
|
|
9
|
+
extends: [
|
|
10
|
+
"plugin:jsonc/recommended-with-jsonc",
|
|
11
|
+
require.resolve("./json-schema/config"),
|
|
12
|
+
],
|
|
13
|
+
rules: {
|
|
14
|
+
..._json_js_1.jsonExtendRules,
|
|
15
|
+
},
|
|
15
16
|
},
|
|
16
|
-
},
|
|
17
17
|
],
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
);
|
|
18
|
+
}), (missingList) => ({
|
|
19
|
+
overrides: [
|
|
20
|
+
{
|
|
21
|
+
files: _json_js_1.jsonFiles,
|
|
22
|
+
parser: require.resolve("../parsers/any-parser"),
|
|
23
|
+
...(0, fallback_js_1.buildFallbackForLegacy)(missingList),
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
}));
|
package/lib/configs/+md.js
CHANGED
|
@@ -1,33 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
const module_js_1 = require("../utils/module.js");
|
|
6
|
+
const semver_1 = __importDefault(require("semver"));
|
|
7
|
+
const _md_js_1 = require("../config-helpers/+md.js");
|
|
8
|
+
const fallback_js_1 = require("./fallback.js");
|
|
9
|
+
module.exports = (0, module_js_1.requireOf)(["eslint-plugin-markdown"], () => {
|
|
10
|
+
const version = (0, module_js_1.requireFromCwd)("eslint-plugin-markdown/package.json").version;
|
|
9
11
|
return {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
extends: [
|
|
13
|
+
semver_1.default.satisfies(version, ">=4.0.0")
|
|
14
|
+
? "plugin:markdown/recommended-legacy"
|
|
15
|
+
: "plugin:markdown/recommended",
|
|
16
|
+
],
|
|
17
|
+
overrides: [
|
|
18
|
+
{
|
|
19
|
+
files: _md_js_1.jsInMdFiles,
|
|
20
|
+
rules: {
|
|
21
|
+
..._md_js_1.jsInMdRules,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
};
|
|
26
|
+
}, (missingList) => ({
|
|
27
|
+
overrides: [
|
|
17
28
|
{
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
},
|
|
29
|
+
files: _md_js_1.mdFiles,
|
|
30
|
+
parser: require.resolve("../parsers/any-parser"),
|
|
31
|
+
...(0, fallback_js_1.buildFallbackForLegacy)(missingList),
|
|
22
32
|
},
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
files: ["*.md"],
|
|
28
|
-
fallback: () => ({
|
|
29
|
-
processor: "@ota-meshi/missing-parser",
|
|
30
|
-
parser: require.resolve("espree"),
|
|
31
|
-
}),
|
|
32
|
-
},
|
|
33
|
-
);
|
|
33
|
+
],
|
|
34
|
+
}));
|
package/lib/configs/+node.js
CHANGED
|
@@ -1,33 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
const _node_js_1 = require("../config-helpers/+node.js");
|
|
3
|
+
const module_js_1 = require("../utils/module.js");
|
|
4
|
+
const fallback_js_1 = require("./fallback.js");
|
|
5
|
+
module.exports = (0, module_js_1.requireOf)(["eslint-plugin-n@17.2.0"], () => ({
|
|
6
|
+
extends: ["plugin:n/recommended"],
|
|
6
7
|
overrides: [
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
ecmaVersion: 2020,
|
|
13
|
-
sourceType: "script",
|
|
8
|
+
{
|
|
9
|
+
files: _node_js_1.nodeFiles,
|
|
10
|
+
rules: {
|
|
11
|
+
..._node_js_1.nodeExtendRules,
|
|
12
|
+
},
|
|
14
13
|
},
|
|
15
|
-
rules: {
|
|
16
|
-
"n/exports-style": ["error", "module.exports"],
|
|
17
|
-
"n/file-extension-in-import": [
|
|
18
|
-
"error",
|
|
19
|
-
"always",
|
|
20
|
-
{ ".js": "always", ".ts": "never", ".tsx": "never" },
|
|
21
|
-
],
|
|
22
|
-
"n/prefer-global/buffer": "error",
|
|
23
|
-
"n/prefer-global/console": "error",
|
|
24
|
-
"n/prefer-global/process": "error",
|
|
25
|
-
},
|
|
26
|
-
globals: {
|
|
27
|
-
URL: "readonly",
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
14
|
],
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
15
|
+
settings: {
|
|
16
|
+
..._node_js_1.nodeSettings,
|
|
17
|
+
},
|
|
18
|
+
}), (missingList) => {
|
|
19
|
+
return {
|
|
20
|
+
overrides: [
|
|
21
|
+
{
|
|
22
|
+
files: _node_js_1.nodeFiles,
|
|
23
|
+
...(0, fallback_js_1.buildFallbackForLegacy)(missingList),
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
};
|
|
27
|
+
});
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
const module_js_1 = require("../utils/module.js");
|
|
3
|
+
const _package_json_js_1 = require("../config-helpers/+package-json.js");
|
|
4
|
+
const fallback_js_1 = require("./fallback.js");
|
|
5
|
+
module.exports = (0, module_js_1.requireOf)(["eslint-plugin-node-dependencies"], () => ({
|
|
6
6
|
overrides: [
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
{
|
|
8
|
+
files: _package_json_js_1.packageJsonFiles,
|
|
9
|
+
extends: [
|
|
10
|
+
"plugin:node-dependencies/recommended",
|
|
11
|
+
require.resolve("./+json"),
|
|
12
|
+
],
|
|
13
|
+
},
|
|
14
14
|
],
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
);
|
|
15
|
+
}), (missingList) => ({
|
|
16
|
+
overrides: [
|
|
17
|
+
{
|
|
18
|
+
files: _package_json_js_1.packageJsonFiles,
|
|
19
|
+
parser: require.resolve("../parsers/any-parser"),
|
|
20
|
+
...(0, fallback_js_1.buildFallbackForLegacy)(missingList),
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
}));
|