@ota-meshi/eslint-plugin 0.8.0 → 0.10.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/configs/+eslint-plugin.js +4 -4
- 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 +13 -13
|
@@ -6,13 +6,13 @@ module.exports = require("../utils/module").requireOf(
|
|
|
6
6
|
["eslint-plugin-eslint-plugin"],
|
|
7
7
|
() => ({
|
|
8
8
|
plugins: ["eslint-plugin"],
|
|
9
|
-
extends: [
|
|
10
|
-
require.resolve("./+node"),
|
|
11
|
-
"plugin:eslint-plugin/recommended",
|
|
12
|
-
],
|
|
13
9
|
overrides: [
|
|
14
10
|
{
|
|
15
11
|
files: ["**/rules/**", "**/internal-rules/**"],
|
|
12
|
+
extends: [
|
|
13
|
+
require.resolve("./+node"),
|
|
14
|
+
"plugin:eslint-plugin/recommended",
|
|
15
|
+
],
|
|
16
16
|
rules: {
|
|
17
17
|
"eslint-plugin/consistent-output": "error",
|
|
18
18
|
"eslint-plugin/meta-property-ordering": [
|
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.10.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -28,27 +28,27 @@
|
|
|
28
28
|
},
|
|
29
29
|
"homepage": "https://github.com/ota-meshi/eslint-plugin#readme",
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"eslint": "^7.0.0",
|
|
31
|
+
"eslint": "^7.0.0 || ^8.0.0",
|
|
32
32
|
"eslint-plugin-regexp": "^1.0.0",
|
|
33
33
|
"eslint-plugin-eslint-comments": "^3.2.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
37
|
-
"@typescript-eslint/parser": "^
|
|
38
|
-
"eslint": "^
|
|
36
|
+
"@typescript-eslint/eslint-plugin": "^5.0.0-0",
|
|
37
|
+
"@typescript-eslint/parser": "^5.0.0-0",
|
|
38
|
+
"eslint": "^8.0.0",
|
|
39
39
|
"eslint-config-prettier": "^8.0.0",
|
|
40
40
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
41
|
-
"eslint-plugin-eslint-plugin": "^
|
|
42
|
-
"eslint-plugin-json-schema-validator": "^
|
|
43
|
-
"eslint-plugin-jsonc": "^
|
|
41
|
+
"eslint-plugin-eslint-plugin": "^4.0.0",
|
|
42
|
+
"eslint-plugin-json-schema-validator": "^2.0.0",
|
|
43
|
+
"eslint-plugin-jsonc": "^2.0.0",
|
|
44
44
|
"eslint-plugin-markdown": "^2.0.0",
|
|
45
45
|
"eslint-plugin-node": "^11.1.0",
|
|
46
|
-
"eslint-plugin-node-dependencies": "^0.
|
|
47
|
-
"eslint-plugin-prettier": "^
|
|
46
|
+
"eslint-plugin-node-dependencies": "^0.8.0",
|
|
47
|
+
"eslint-plugin-prettier": "^4.0.0",
|
|
48
48
|
"eslint-plugin-regexp": "^1.0.0",
|
|
49
|
-
"eslint-plugin-toml": "0.
|
|
50
|
-
"eslint-plugin-vue": "^
|
|
51
|
-
"eslint-plugin-yml": "^0.
|
|
49
|
+
"eslint-plugin-toml": "0.3.0",
|
|
50
|
+
"eslint-plugin-vue": "^8.0.0",
|
|
51
|
+
"eslint-plugin-yml": "^0.14.0",
|
|
52
52
|
"mocha": "^9.0.0",
|
|
53
53
|
"prettier": "^2.0.5",
|
|
54
54
|
"typescript": "^4.1.5"
|