@ota-meshi/eslint-plugin 0.8.0 → 0.9.0
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/configs/+json.js +1 -0
- package/lib/configs/+md.js +1 -0
- package/lib/configs/+node.js +1 -0
- package/lib/configs/+package-json.js +1 -0
- package/lib/configs/+toml.js +14 -10
- package/lib/configs/+typescript.js +6 -8
- package/lib/configs/+vue2.js +6 -8
- package/lib/configs/+vue3.js +6 -8
- package/lib/configs/+yaml.js +6 -0
- package/lib/utils/module.js +30 -2
- package/package.json +2 -2
package/lib/configs/+json.js
CHANGED
package/lib/configs/+md.js
CHANGED
package/lib/configs/+node.js
CHANGED
package/lib/configs/+toml.js
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
"use strict"
|
|
2
2
|
|
|
3
|
-
module.exports = require("../utils/module").requireOf(
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
{
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
3
|
+
module.exports = require("../utils/module").requireOf(
|
|
4
|
+
[],
|
|
5
|
+
() => ({
|
|
6
|
+
extends: ["plugin:toml/standard"],
|
|
7
|
+
rules: {},
|
|
8
|
+
overrides: [
|
|
9
|
+
{
|
|
10
|
+
files: ["*.toml"],
|
|
11
|
+
extends: [require.resolve("./json-schema/config")],
|
|
12
|
+
},
|
|
13
|
+
],
|
|
14
|
+
}),
|
|
15
|
+
{ files: ["*.toml"] },
|
|
16
|
+
)
|
|
@@ -143,12 +143,10 @@ module.exports = require("../utils/module").requireOf(
|
|
|
143
143
|
},
|
|
144
144
|
],
|
|
145
145
|
}),
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
],
|
|
153
|
-
}),
|
|
146
|
+
{
|
|
147
|
+
files: ["*.ts"],
|
|
148
|
+
fallback: () => ({
|
|
149
|
+
processor: "@ota-meshi/missing-parser",
|
|
150
|
+
}),
|
|
151
|
+
},
|
|
154
152
|
)
|
package/lib/configs/+vue2.js
CHANGED
|
@@ -20,12 +20,10 @@ module.exports = require("../utils/module").requireOf(
|
|
|
20
20
|
},
|
|
21
21
|
],
|
|
22
22
|
}),
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
],
|
|
30
|
-
}),
|
|
23
|
+
{
|
|
24
|
+
files: ["*.vue"],
|
|
25
|
+
fallback: () => ({
|
|
26
|
+
processor: "@ota-meshi/missing-parser",
|
|
27
|
+
}),
|
|
28
|
+
},
|
|
31
29
|
)
|
package/lib/configs/+vue3.js
CHANGED
|
@@ -20,12 +20,10 @@ module.exports = require("../utils/module").requireOf(
|
|
|
20
20
|
},
|
|
21
21
|
],
|
|
22
22
|
}),
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
],
|
|
30
|
-
}),
|
|
23
|
+
{
|
|
24
|
+
files: ["*.vue"],
|
|
25
|
+
fallback: () => ({
|
|
26
|
+
processor: "@ota-meshi/missing-parser",
|
|
27
|
+
}),
|
|
28
|
+
},
|
|
31
29
|
)
|
package/lib/configs/+yaml.js
CHANGED
package/lib/utils/module.js
CHANGED
|
@@ -33,16 +33,44 @@ function has(name) {
|
|
|
33
33
|
/**
|
|
34
34
|
* Checks exists module and return config
|
|
35
35
|
*/
|
|
36
|
-
function requireOf(names, getConfig,
|
|
36
|
+
function requireOf(names, getConfig, fallback) {
|
|
37
37
|
let missings = names.filter((n) => !has(n))
|
|
38
38
|
|
|
39
39
|
if (missings.length) {
|
|
40
|
+
const fb =
|
|
41
|
+
(typeof fallback === "function"
|
|
42
|
+
? {
|
|
43
|
+
fallback,
|
|
44
|
+
}
|
|
45
|
+
: fallback) || {}
|
|
46
|
+
if (fb.fallback) {
|
|
47
|
+
Object.assign(fb, fb.fallback())
|
|
48
|
+
delete fb.fallback
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// getFallback, files
|
|
52
|
+
if (fb.files && fb.files.length) {
|
|
53
|
+
return {
|
|
54
|
+
overrides: [
|
|
55
|
+
{
|
|
56
|
+
plugins: ["@ota-meshi"],
|
|
57
|
+
rules: {
|
|
58
|
+
"@ota-meshi/missing-module-for-config": [
|
|
59
|
+
"error",
|
|
60
|
+
missings,
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
...fb,
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
}
|
|
67
|
+
}
|
|
40
68
|
return {
|
|
41
69
|
plugins: ["@ota-meshi"],
|
|
42
70
|
rules: {
|
|
43
71
|
"@ota-meshi/missing-module-for-config": ["error", missings],
|
|
44
72
|
},
|
|
45
|
-
...
|
|
73
|
+
...fb,
|
|
46
74
|
}
|
|
47
75
|
}
|
|
48
76
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ota-meshi/eslint-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"eslint-plugin-jsonc": "^1.0.0",
|
|
44
44
|
"eslint-plugin-markdown": "^2.0.0",
|
|
45
45
|
"eslint-plugin-node": "^11.1.0",
|
|
46
|
-
"eslint-plugin-node-dependencies": "^0.
|
|
46
|
+
"eslint-plugin-node-dependencies": "^0.5.0",
|
|
47
47
|
"eslint-plugin-prettier": "^3.1.4",
|
|
48
48
|
"eslint-plugin-regexp": "^1.0.0",
|
|
49
49
|
"eslint-plugin-toml": "0.2.0",
|