@ota-meshi/eslint-plugin 0.13.0 → 0.13.2
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 +6 -1
- package/lib/configs/+md.js +6 -1
- package/lib/configs/+package-json.js +6 -1
- package/lib/configs/+svelte-with-ts.js +1 -0
- package/lib/configs/+toml.js +6 -1
- package/lib/configs/+vue2-with-ts.js +30 -0
- package/lib/configs/+vue2.js +1 -1
- package/lib/configs/+vue3-with-ts.js +30 -0
- package/lib/configs/+vue3.js +1 -1
- package/lib/configs/recommended.js +1 -1
- package/lib/configs/ts/base-config.js +1 -0
- package/lib/index.js +2 -0
- package/lib/rules/missing-module-for-config.js +3 -1
- package/package.json +4 -4
package/lib/configs/+json.js
CHANGED
package/lib/configs/+md.js
CHANGED
package/lib/configs/+toml.js
CHANGED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const base = require("./ts/base-config");
|
|
4
|
+
module.exports = require("../utils/module").requireOf(
|
|
5
|
+
[
|
|
6
|
+
"@typescript-eslint/parser",
|
|
7
|
+
"typescript",
|
|
8
|
+
"@typescript-eslint/eslint-plugin",
|
|
9
|
+
],
|
|
10
|
+
() => ({
|
|
11
|
+
overrides: [
|
|
12
|
+
{
|
|
13
|
+
files: ["*.vue"],
|
|
14
|
+
extends: [require.resolve("./+vue2"), ...base.extends],
|
|
15
|
+
...base,
|
|
16
|
+
parserOptions: {
|
|
17
|
+
...base.parserOptions,
|
|
18
|
+
parser: require.resolve("@typescript-eslint/parser"),
|
|
19
|
+
extraFileExtensions: [".vue"],
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
}),
|
|
24
|
+
{
|
|
25
|
+
files: ["*.vue"],
|
|
26
|
+
fallback: () => ({
|
|
27
|
+
processor: "@ota-meshi/missing-parser",
|
|
28
|
+
}),
|
|
29
|
+
}
|
|
30
|
+
);
|
package/lib/configs/+vue2.js
CHANGED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const base = require("./ts/base-config");
|
|
4
|
+
module.exports = require("../utils/module").requireOf(
|
|
5
|
+
[
|
|
6
|
+
"@typescript-eslint/parser",
|
|
7
|
+
"typescript",
|
|
8
|
+
"@typescript-eslint/eslint-plugin",
|
|
9
|
+
],
|
|
10
|
+
() => ({
|
|
11
|
+
overrides: [
|
|
12
|
+
{
|
|
13
|
+
files: ["*.vue"],
|
|
14
|
+
extends: [require.resolve("./+vue3"), ...base.extends],
|
|
15
|
+
...base,
|
|
16
|
+
parserOptions: {
|
|
17
|
+
...base.parserOptions,
|
|
18
|
+
parser: require.resolve("@typescript-eslint/parser"),
|
|
19
|
+
extraFileExtensions: [".vue"],
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
}),
|
|
24
|
+
{
|
|
25
|
+
files: ["*.vue"],
|
|
26
|
+
fallback: () => ({
|
|
27
|
+
processor: "@ota-meshi/missing-parser",
|
|
28
|
+
}),
|
|
29
|
+
}
|
|
30
|
+
);
|
package/lib/configs/+vue3.js
CHANGED
|
@@ -158,7 +158,7 @@ module.exports = {
|
|
|
158
158
|
"no-useless-catch": "error",
|
|
159
159
|
"no-useless-escape": "error",
|
|
160
160
|
"no-useless-return": "error",
|
|
161
|
-
"no-void": "error",
|
|
161
|
+
"no-void": ["error", { allowAsStatement: true }],
|
|
162
162
|
"no-with": "error",
|
|
163
163
|
"no-var": "error",
|
|
164
164
|
"one-var": [
|
package/lib/index.js
CHANGED
|
@@ -9,7 +9,9 @@ module.exports = {
|
|
|
9
9
|
"+prettier": require("./configs/+prettier"),
|
|
10
10
|
"+typescript": require("./configs/+typescript"),
|
|
11
11
|
"+vue2": require("./configs/+vue2"),
|
|
12
|
+
"+vue2-with-ts": require("./configs/+vue2-with-ts"),
|
|
12
13
|
"+vue3": require("./configs/+vue3"),
|
|
14
|
+
"+vue3-with-ts": require("./configs/+vue3-with-ts"),
|
|
13
15
|
"+svelte": require("./configs/+svelte"),
|
|
14
16
|
"+svelte-with-ts": require("./configs/+svelte-with-ts"),
|
|
15
17
|
"+yaml": require("./configs/+yaml"),
|
|
@@ -5,6 +5,7 @@ const getLinters = require("../utils/get-linters");
|
|
|
5
5
|
const findRootDir = require("../utils/find-root-dir");
|
|
6
6
|
|
|
7
7
|
let shouldFix = false;
|
|
8
|
+
const fixedModules = new Set();
|
|
8
9
|
patch();
|
|
9
10
|
|
|
10
11
|
module.exports = {
|
|
@@ -26,7 +27,8 @@ module.exports = {
|
|
|
26
27
|
const modules = context.options[0];
|
|
27
28
|
for (const moduleName of modules) {
|
|
28
29
|
let consoleOutput = "";
|
|
29
|
-
if (shouldFix) {
|
|
30
|
+
if (shouldFix && !fixedModules.has(moduleName)) {
|
|
31
|
+
fixedModules.add(moduleName);
|
|
30
32
|
const cwd = findRootDir(context.getFilename());
|
|
31
33
|
if (cwd) {
|
|
32
34
|
const result = spawnSync("npm", ["install", "-D", moduleName], {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ota-meshi/eslint-plugin",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.2",
|
|
4
4
|
"description": "ESLint configuration plugin for me.",
|
|
5
5
|
"repository": "git+https://github.com/ota-meshi/eslint-plugin.git",
|
|
6
6
|
"homepage": "https://github.com/ota-meshi/eslint-plugin#readme",
|
|
@@ -41,11 +41,11 @@
|
|
|
41
41
|
"eslint-plugin-jsonc": "^2.0.0",
|
|
42
42
|
"eslint-plugin-markdown": "^3.0.0",
|
|
43
43
|
"eslint-plugin-node": "^11.1.0",
|
|
44
|
-
"eslint-plugin-node-dependencies": "^0.
|
|
44
|
+
"eslint-plugin-node-dependencies": "^0.10.0",
|
|
45
45
|
"eslint-plugin-prettier": "^4.0.0",
|
|
46
46
|
"eslint-plugin-regexp": "^1.0.0",
|
|
47
47
|
"eslint-plugin-svelte": "^2.9.0",
|
|
48
|
-
"eslint-plugin-toml": "^0.
|
|
48
|
+
"eslint-plugin-toml": "^0.4.0",
|
|
49
49
|
"eslint-plugin-vue": "^9.0.0",
|
|
50
50
|
"eslint-plugin-yml": "^1.0.0",
|
|
51
51
|
"mocha": "^10.0.0",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"prettier-plugin-pkg": "^0.17.0",
|
|
54
54
|
"prettier-plugin-svelte": "^2.7.1",
|
|
55
55
|
"svelte": "^3.50.1",
|
|
56
|
-
"typescript": "^
|
|
56
|
+
"typescript": "^5.0.0"
|
|
57
57
|
},
|
|
58
58
|
"publishConfig": {
|
|
59
59
|
"access": "public"
|