@ota-meshi/eslint-plugin 0.11.3 → 0.13.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/+prettier.js +21 -4
- package/lib/configs/+svelte-with-ts.js +29 -0
- package/lib/configs/+svelte.js +34 -0
- package/lib/configs/+typescript.js +2 -122
- package/lib/configs/ts/base-config.js +116 -0
- package/lib/index.js +2 -0
- package/package.json +8 -5
package/lib/configs/+prettier.js
CHANGED
|
@@ -23,28 +23,45 @@ module.exports = require("../utils/module").requireOf(
|
|
|
23
23
|
],
|
|
24
24
|
rules: {
|
|
25
25
|
"prettier/prettier": "error",
|
|
26
|
-
|
|
26
|
+
|
|
27
27
|
"jsonc/array-bracket-newline": "off",
|
|
28
|
+
"jsonc/array-bracket-spacing": "off",
|
|
28
29
|
"jsonc/array-element-newline": "off",
|
|
30
|
+
"jsonc/comma-dangle": "off",
|
|
29
31
|
"jsonc/comma-style": "off",
|
|
30
32
|
"jsonc/indent": "off",
|
|
31
33
|
"jsonc/key-spacing": "off",
|
|
32
|
-
"jsonc/
|
|
34
|
+
"jsonc/no-floating-decimal": "off",
|
|
33
35
|
"jsonc/object-curly-newline": "off",
|
|
36
|
+
"jsonc/object-curly-spacing": "off",
|
|
34
37
|
"jsonc/object-property-newline": "off",
|
|
35
38
|
"jsonc/quote-props": "off",
|
|
36
39
|
"jsonc/quotes": "off",
|
|
37
40
|
"jsonc/space-unary-ops": "off",
|
|
38
41
|
|
|
42
|
+
"yml/block-mapping-colon-indicator-newline": "off",
|
|
39
43
|
"yml/block-mapping-question-indicator-newline": "off",
|
|
40
44
|
"yml/block-sequence-hyphen-indicator-newline": "off",
|
|
41
|
-
"yml/indent": "off",
|
|
42
45
|
"yml/flow-mapping-curly-newline": "off",
|
|
43
46
|
"yml/flow-mapping-curly-spacing": "off",
|
|
44
47
|
"yml/flow-sequence-bracket-newline": "off",
|
|
45
48
|
"yml/flow-sequence-bracket-spacing": "off",
|
|
49
|
+
"yml/indent": "off",
|
|
46
50
|
"yml/key-spacing": "off",
|
|
47
|
-
"yml/
|
|
51
|
+
"yml/no-multiple-empty-lines": "off",
|
|
52
|
+
"yml/quotes": "off",
|
|
53
|
+
|
|
54
|
+
"svelte/first-attribute-linebreak": "off",
|
|
55
|
+
"svelte/html-closing-bracket-spacing": "off",
|
|
56
|
+
"svelte/html-quotes": "off",
|
|
57
|
+
"svelte/html-self-closing": "off",
|
|
58
|
+
"svelte/indent": "off",
|
|
59
|
+
"svelte/max-attributes-per-line": "off",
|
|
60
|
+
"svelte/mustache-spacing": "off",
|
|
61
|
+
"svelte/no-spaces-around-equal-signs-in-attribute": "off",
|
|
62
|
+
"svelte/no-trailing-spaces": "off",
|
|
63
|
+
"svelte/shorthand-attribute": "off",
|
|
64
|
+
"svelte/shorthand-directive": "off",
|
|
48
65
|
},
|
|
49
66
|
overrides: [
|
|
50
67
|
{
|
|
@@ -0,0 +1,29 @@
|
|
|
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: ["*.svelte"],
|
|
14
|
+
extends: [require.resolve("./+svelte"), ...base.extends],
|
|
15
|
+
...base,
|
|
16
|
+
parserOptions: {
|
|
17
|
+
...base.parserOptions,
|
|
18
|
+
parser: require.resolve("@typescript-eslint/parser"),
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
}),
|
|
23
|
+
{
|
|
24
|
+
files: ["*.svelte"],
|
|
25
|
+
fallback: () => ({
|
|
26
|
+
processor: "@ota-meshi/missing-parser",
|
|
27
|
+
}),
|
|
28
|
+
}
|
|
29
|
+
);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
module.exports = require("../utils/module").requireOf(
|
|
4
|
+
["eslint-plugin-svelte@2.9.0"],
|
|
5
|
+
() => ({
|
|
6
|
+
overrides: [
|
|
7
|
+
{
|
|
8
|
+
files: ["*.svelte"],
|
|
9
|
+
extends: ["plugin:svelte/recommended"],
|
|
10
|
+
parserOptions: {
|
|
11
|
+
ts: require.resolve("@typescript-eslint/parser"),
|
|
12
|
+
},
|
|
13
|
+
rules: {
|
|
14
|
+
"svelte/no-store-async": "error",
|
|
15
|
+
"svelte/no-reactive-functions": "error",
|
|
16
|
+
"svelte/no-reactive-literals": "error",
|
|
17
|
+
"svelte/no-useless-mustaches": "error",
|
|
18
|
+
"svelte/require-optimized-style-attribute": "error",
|
|
19
|
+
"svelte/require-stores-init": "error",
|
|
20
|
+
"svelte/derived-has-same-inputs-outputs": "error",
|
|
21
|
+
"svelte/prefer-class-directive": "warn",
|
|
22
|
+
"svelte/prefer-style-directive": "warn",
|
|
23
|
+
"svelte/spaced-html-comment": "warn",
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
}),
|
|
28
|
+
{
|
|
29
|
+
files: ["*.svelte"],
|
|
30
|
+
fallback: () => ({
|
|
31
|
+
processor: "@ota-meshi/missing-parser",
|
|
32
|
+
}),
|
|
33
|
+
}
|
|
34
|
+
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const base = require("./ts/base-config");
|
|
4
4
|
module.exports = require("../utils/module").requireOf(
|
|
5
5
|
[
|
|
6
6
|
"@typescript-eslint/parser",
|
|
@@ -11,128 +11,8 @@ module.exports = require("../utils/module").requireOf(
|
|
|
11
11
|
overrides: [
|
|
12
12
|
{
|
|
13
13
|
files: ["*.ts", "*.mts", "*.cts"],
|
|
14
|
-
extends: ["plugin:@typescript-eslint/recommended"],
|
|
15
14
|
parser: require.resolve("@typescript-eslint/parser"),
|
|
16
|
-
|
|
17
|
-
sourceType: "module",
|
|
18
|
-
project: getProject(),
|
|
19
|
-
},
|
|
20
|
-
rules: {
|
|
21
|
-
"@typescript-eslint/array-type": "error",
|
|
22
|
-
"@typescript-eslint/explicit-module-boundary-types": [
|
|
23
|
-
"error",
|
|
24
|
-
{ allowArgumentsExplicitlyTypedAsAny: true },
|
|
25
|
-
],
|
|
26
|
-
"@typescript-eslint/consistent-type-imports": "error",
|
|
27
|
-
|
|
28
|
-
"@typescript-eslint/adjacent-overload-signatures": "error",
|
|
29
|
-
"@typescript-eslint/await-thenable": "error",
|
|
30
|
-
"@typescript-eslint/ban-ts-comment": "error",
|
|
31
|
-
"@typescript-eslint/naming-convention": [
|
|
32
|
-
"error",
|
|
33
|
-
{
|
|
34
|
-
selector: "default",
|
|
35
|
-
format: ["camelCase"],
|
|
36
|
-
leadingUnderscore: "allow",
|
|
37
|
-
trailingUnderscore: "allow",
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
selector: "variable",
|
|
41
|
-
format: ["camelCase", "UPPER_CASE"],
|
|
42
|
-
leadingUnderscore: "allow",
|
|
43
|
-
trailingUnderscore: "allow",
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
selector: "typeLike",
|
|
47
|
-
format: ["PascalCase"],
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
selector: "memberLike",
|
|
51
|
-
format: ["camelCase", "UPPER_CASE"],
|
|
52
|
-
leadingUnderscore: "allow",
|
|
53
|
-
trailingUnderscore: "allow",
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
selector: "property",
|
|
57
|
-
format: null,
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
selector: "method",
|
|
61
|
-
format: null,
|
|
62
|
-
},
|
|
63
|
-
],
|
|
64
|
-
"@typescript-eslint/consistent-type-assertions": "error",
|
|
65
|
-
"@typescript-eslint/explicit-member-accessibility": "error",
|
|
66
|
-
"@typescript-eslint/no-array-constructor": "error",
|
|
67
|
-
"@typescript-eslint/no-empty-interface": "error",
|
|
68
|
-
"@typescript-eslint/no-extraneous-class": "error",
|
|
69
|
-
"@typescript-eslint/no-floating-promises": "error",
|
|
70
|
-
"@typescript-eslint/no-for-in-array": "error",
|
|
71
|
-
"@typescript-eslint/no-inferrable-types": "error",
|
|
72
|
-
"@typescript-eslint/no-misused-new": "error",
|
|
73
|
-
"@typescript-eslint/no-misused-promises": "error",
|
|
74
|
-
"@typescript-eslint/no-parameter-properties": "error",
|
|
75
|
-
"@typescript-eslint/no-require-imports": "error",
|
|
76
|
-
"@typescript-eslint/no-this-alias": [
|
|
77
|
-
"error",
|
|
78
|
-
{ allowDestructuring: true },
|
|
79
|
-
],
|
|
80
|
-
"@typescript-eslint/no-unnecessary-qualifier": "error",
|
|
81
|
-
"@typescript-eslint/no-unnecessary-type-arguments": "error",
|
|
82
|
-
"@typescript-eslint/no-unnecessary-type-assertion": "error",
|
|
83
|
-
"@typescript-eslint/no-var-requires": "error",
|
|
84
|
-
"@typescript-eslint/prefer-function-type": "error",
|
|
85
|
-
"@typescript-eslint/prefer-includes": "error",
|
|
86
|
-
"@typescript-eslint/prefer-namespace-keyword": "error",
|
|
87
|
-
"@typescript-eslint/prefer-readonly": "error",
|
|
88
|
-
"@typescript-eslint/prefer-regexp-exec": "error",
|
|
89
|
-
"@typescript-eslint/prefer-string-starts-ends-with": "error",
|
|
90
|
-
"@typescript-eslint/restrict-plus-operands": "error",
|
|
91
|
-
"@typescript-eslint/require-array-sort-compare": "error",
|
|
92
|
-
"@typescript-eslint/triple-slash-reference": "error",
|
|
93
|
-
"@typescript-eslint/unbound-method": [
|
|
94
|
-
"error",
|
|
95
|
-
{ ignoreStatic: true },
|
|
96
|
-
],
|
|
97
|
-
"@typescript-eslint/unified-signatures": "error",
|
|
98
|
-
"prettier/prettier": [
|
|
99
|
-
"error",
|
|
100
|
-
{
|
|
101
|
-
tabWidth: 4,
|
|
102
|
-
semi: false,
|
|
103
|
-
trailingComma: "all",
|
|
104
|
-
parser: "typescript",
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
usePrettierrc: false,
|
|
108
|
-
},
|
|
109
|
-
],
|
|
110
|
-
|
|
111
|
-
// Replacements
|
|
112
|
-
camelcase: "off",
|
|
113
|
-
// "@typescript-eslint/camelcase": "error",
|
|
114
|
-
"no-empty-function": "off",
|
|
115
|
-
"@typescript-eslint/no-empty-function": "error",
|
|
116
|
-
"no-useless-constructor": "off",
|
|
117
|
-
"@typescript-eslint/no-useless-constructor": "error",
|
|
118
|
-
"require-await": "off",
|
|
119
|
-
"@typescript-eslint/require-await": "error",
|
|
120
|
-
"no-use-before-define": "off",
|
|
121
|
-
"@typescript-eslint/no-use-before-define": [
|
|
122
|
-
"error",
|
|
123
|
-
{
|
|
124
|
-
functions: false,
|
|
125
|
-
classes: true,
|
|
126
|
-
variables: true,
|
|
127
|
-
ignoreTypeReferences: true,
|
|
128
|
-
},
|
|
129
|
-
],
|
|
130
|
-
"no-unused-vars": "off",
|
|
131
|
-
"@typescript-eslint/no-unused-vars": [
|
|
132
|
-
"error",
|
|
133
|
-
{ argsIgnorePattern: "^_" },
|
|
134
|
-
],
|
|
135
|
-
},
|
|
15
|
+
...base,
|
|
136
16
|
},
|
|
137
17
|
{
|
|
138
18
|
files: [
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const { getProject } = require(".");
|
|
4
|
+
|
|
5
|
+
module.exports = {
|
|
6
|
+
extends: ["plugin:@typescript-eslint/recommended"],
|
|
7
|
+
parserOptions: {
|
|
8
|
+
sourceType: "module",
|
|
9
|
+
project: getProject(),
|
|
10
|
+
},
|
|
11
|
+
rules: {
|
|
12
|
+
"@typescript-eslint/array-type": "error",
|
|
13
|
+
"@typescript-eslint/explicit-module-boundary-types": [
|
|
14
|
+
"error",
|
|
15
|
+
{ allowArgumentsExplicitlyTypedAsAny: true },
|
|
16
|
+
],
|
|
17
|
+
"@typescript-eslint/consistent-type-imports": "error",
|
|
18
|
+
|
|
19
|
+
"@typescript-eslint/adjacent-overload-signatures": "error",
|
|
20
|
+
"@typescript-eslint/await-thenable": "error",
|
|
21
|
+
"@typescript-eslint/ban-ts-comment": "error",
|
|
22
|
+
"@typescript-eslint/naming-convention": [
|
|
23
|
+
"error",
|
|
24
|
+
{
|
|
25
|
+
selector: "default",
|
|
26
|
+
format: ["camelCase"],
|
|
27
|
+
leadingUnderscore: "allow",
|
|
28
|
+
trailingUnderscore: "allow",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
selector: "variable",
|
|
32
|
+
format: ["camelCase", "UPPER_CASE"],
|
|
33
|
+
leadingUnderscore: "allow",
|
|
34
|
+
trailingUnderscore: "allow",
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
selector: "typeLike",
|
|
38
|
+
format: ["PascalCase"],
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
selector: "memberLike",
|
|
42
|
+
format: ["camelCase", "UPPER_CASE"],
|
|
43
|
+
leadingUnderscore: "allow",
|
|
44
|
+
trailingUnderscore: "allow",
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
selector: "property",
|
|
48
|
+
format: null,
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
selector: "method",
|
|
52
|
+
format: null,
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
"@typescript-eslint/consistent-type-assertions": "error",
|
|
56
|
+
"@typescript-eslint/explicit-member-accessibility": "error",
|
|
57
|
+
"@typescript-eslint/no-array-constructor": "error",
|
|
58
|
+
"@typescript-eslint/no-empty-interface": "error",
|
|
59
|
+
"@typescript-eslint/no-extraneous-class": "error",
|
|
60
|
+
"@typescript-eslint/no-floating-promises": "error",
|
|
61
|
+
"@typescript-eslint/no-for-in-array": "error",
|
|
62
|
+
"@typescript-eslint/no-inferrable-types": "error",
|
|
63
|
+
"@typescript-eslint/no-misused-new": "error",
|
|
64
|
+
"@typescript-eslint/no-misused-promises": "error",
|
|
65
|
+
"@typescript-eslint/no-parameter-properties": "error",
|
|
66
|
+
"@typescript-eslint/no-require-imports": "error",
|
|
67
|
+
"@typescript-eslint/no-this-alias": ["error", { allowDestructuring: true }],
|
|
68
|
+
"@typescript-eslint/no-unnecessary-qualifier": "error",
|
|
69
|
+
"@typescript-eslint/no-unnecessary-type-arguments": "error",
|
|
70
|
+
"@typescript-eslint/no-unnecessary-type-assertion": "error",
|
|
71
|
+
"@typescript-eslint/no-var-requires": "error",
|
|
72
|
+
"@typescript-eslint/prefer-function-type": "error",
|
|
73
|
+
"@typescript-eslint/prefer-includes": "error",
|
|
74
|
+
"@typescript-eslint/prefer-namespace-keyword": "error",
|
|
75
|
+
"@typescript-eslint/prefer-readonly": "error",
|
|
76
|
+
"@typescript-eslint/prefer-regexp-exec": "error",
|
|
77
|
+
"@typescript-eslint/prefer-string-starts-ends-with": "error",
|
|
78
|
+
"@typescript-eslint/restrict-plus-operands": "error",
|
|
79
|
+
"@typescript-eslint/require-array-sort-compare": "error",
|
|
80
|
+
"@typescript-eslint/triple-slash-reference": "error",
|
|
81
|
+
"@typescript-eslint/unbound-method": ["error", { ignoreStatic: true }],
|
|
82
|
+
"@typescript-eslint/unified-signatures": "error",
|
|
83
|
+
"prettier/prettier": "error",
|
|
84
|
+
|
|
85
|
+
// Replacements
|
|
86
|
+
camelcase: "off",
|
|
87
|
+
// "@typescript-eslint/camelcase": "error",
|
|
88
|
+
"no-empty-function": "off",
|
|
89
|
+
"@typescript-eslint/no-empty-function": "error",
|
|
90
|
+
"no-useless-constructor": "off",
|
|
91
|
+
"@typescript-eslint/no-useless-constructor": "error",
|
|
92
|
+
"require-await": "off",
|
|
93
|
+
"@typescript-eslint/require-await": "error",
|
|
94
|
+
"no-use-before-define": "off",
|
|
95
|
+
"@typescript-eslint/no-use-before-define": [
|
|
96
|
+
"error",
|
|
97
|
+
{
|
|
98
|
+
functions: false,
|
|
99
|
+
classes: true,
|
|
100
|
+
variables: true,
|
|
101
|
+
ignoreTypeReferences: true,
|
|
102
|
+
},
|
|
103
|
+
],
|
|
104
|
+
"no-unused-vars": "off",
|
|
105
|
+
"@typescript-eslint/no-unused-vars": [
|
|
106
|
+
"error",
|
|
107
|
+
{
|
|
108
|
+
args: "all",
|
|
109
|
+
argsIgnorePattern: "^_(?:[^_].*)?$",
|
|
110
|
+
caughtErrors: "all",
|
|
111
|
+
vars: "all",
|
|
112
|
+
varsIgnorePattern: "^_(?:[^_].*)?$",
|
|
113
|
+
},
|
|
114
|
+
],
|
|
115
|
+
},
|
|
116
|
+
};
|
package/lib/index.js
CHANGED
|
@@ -10,6 +10,8 @@ module.exports = {
|
|
|
10
10
|
"+typescript": require("./configs/+typescript"),
|
|
11
11
|
"+vue2": require("./configs/+vue2"),
|
|
12
12
|
"+vue3": require("./configs/+vue3"),
|
|
13
|
+
"+svelte": require("./configs/+svelte"),
|
|
14
|
+
"+svelte-with-ts": require("./configs/+svelte-with-ts"),
|
|
13
15
|
"+yaml": require("./configs/+yaml"),
|
|
14
16
|
"+toml": require("./configs/+toml"),
|
|
15
17
|
"+md": require("./configs/+md"),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ota-meshi/eslint-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
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",
|
|
@@ -36,20 +36,23 @@
|
|
|
36
36
|
"eslint": "^8.0.0",
|
|
37
37
|
"eslint-config-prettier": "^8.0.0",
|
|
38
38
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
39
|
-
"eslint-plugin-eslint-plugin": "^
|
|
40
|
-
"eslint-plugin-json-schema-validator": "^
|
|
39
|
+
"eslint-plugin-eslint-plugin": "^5.0.0",
|
|
40
|
+
"eslint-plugin-json-schema-validator": "^4.0.0",
|
|
41
41
|
"eslint-plugin-jsonc": "^2.0.0",
|
|
42
|
-
"eslint-plugin-markdown": "^
|
|
42
|
+
"eslint-plugin-markdown": "^3.0.0",
|
|
43
43
|
"eslint-plugin-node": "^11.1.0",
|
|
44
44
|
"eslint-plugin-node-dependencies": "^0.9.0",
|
|
45
45
|
"eslint-plugin-prettier": "^4.0.0",
|
|
46
46
|
"eslint-plugin-regexp": "^1.0.0",
|
|
47
|
+
"eslint-plugin-svelte": "^2.9.0",
|
|
47
48
|
"eslint-plugin-toml": "^0.3.1",
|
|
48
49
|
"eslint-plugin-vue": "^9.0.0",
|
|
49
50
|
"eslint-plugin-yml": "^1.0.0",
|
|
50
51
|
"mocha": "^10.0.0",
|
|
51
52
|
"prettier": "^2.0.5",
|
|
52
|
-
"prettier-plugin-pkg": "^0.
|
|
53
|
+
"prettier-plugin-pkg": "^0.17.0",
|
|
54
|
+
"prettier-plugin-svelte": "^2.7.1",
|
|
55
|
+
"svelte": "^3.50.1",
|
|
53
56
|
"typescript": "^4.1.5"
|
|
54
57
|
},
|
|
55
58
|
"publishConfig": {
|