@ota-meshi/eslint-plugin 0.12.0 → 0.13.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.
@@ -23,28 +23,45 @@ module.exports = require("../utils/module").requireOf(
23
23
  ],
24
24
  rules: {
25
25
  "prettier/prettier": "error",
26
- "jsonc/array-bracket-spacing": "off",
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/object-curly-spacing": "off",
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/spaced-comment": "off",
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,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: ["*.svelte"],
14
+ extends: [require.resolve("./+svelte"), ...base.extends],
15
+ ...base,
16
+ parserOptions: {
17
+ ...base.parserOptions,
18
+ parser: require.resolve("@typescript-eslint/parser"),
19
+ extraFileExtensions: [".svelte"],
20
+ },
21
+ },
22
+ ],
23
+ }),
24
+ {
25
+ files: ["*.svelte"],
26
+ fallback: () => ({
27
+ processor: "@ota-meshi/missing-parser",
28
+ }),
29
+ }
30
+ );
@@ -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 { getProject } = require("./ts");
3
+ const base = require("./ts/base-config");
4
4
  module.exports = require("../utils/module").requireOf(
5
5
  [
6
6
  "@typescript-eslint/parser",
@@ -11,117 +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
- parserOptions: {
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": "error",
99
-
100
- // Replacements
101
- camelcase: "off",
102
- // "@typescript-eslint/camelcase": "error",
103
- "no-empty-function": "off",
104
- "@typescript-eslint/no-empty-function": "error",
105
- "no-useless-constructor": "off",
106
- "@typescript-eslint/no-useless-constructor": "error",
107
- "require-await": "off",
108
- "@typescript-eslint/require-await": "error",
109
- "no-use-before-define": "off",
110
- "@typescript-eslint/no-use-before-define": [
111
- "error",
112
- {
113
- functions: false,
114
- classes: true,
115
- variables: true,
116
- ignoreTypeReferences: true,
117
- },
118
- ],
119
- "no-unused-vars": "off",
120
- "@typescript-eslint/no-unused-vars": [
121
- "error",
122
- { argsIgnorePattern: "^_" },
123
- ],
124
- },
15
+ ...base,
125
16
  },
126
17
  {
127
18
  files: [
@@ -15,7 +15,7 @@ module.exports = require("../utils/module").requireOf(
15
15
  },
16
16
  sourceType: "module",
17
17
  project: getProject(),
18
- extraFileExtensions: [".vue"],
18
+ extraFileExtensions: [".vue", ".svelte"],
19
19
  },
20
20
  },
21
21
  ],
@@ -15,7 +15,7 @@ module.exports = require("../utils/module").requireOf(
15
15
  },
16
16
  sourceType: "module",
17
17
  project: getProject(),
18
- extraFileExtensions: [".vue"],
18
+ extraFileExtensions: [".vue", ".svelte"],
19
19
  },
20
20
  },
21
21
  ],
@@ -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": [
@@ -0,0 +1,117 @@
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
+ extraFileExtensions: [".vue", ".svelte"],
11
+ },
12
+ rules: {
13
+ "@typescript-eslint/array-type": "error",
14
+ "@typescript-eslint/explicit-module-boundary-types": [
15
+ "error",
16
+ { allowArgumentsExplicitlyTypedAsAny: true },
17
+ ],
18
+ "@typescript-eslint/consistent-type-imports": "error",
19
+
20
+ "@typescript-eslint/adjacent-overload-signatures": "error",
21
+ "@typescript-eslint/await-thenable": "error",
22
+ "@typescript-eslint/ban-ts-comment": "error",
23
+ "@typescript-eslint/naming-convention": [
24
+ "error",
25
+ {
26
+ selector: "default",
27
+ format: ["camelCase"],
28
+ leadingUnderscore: "allow",
29
+ trailingUnderscore: "allow",
30
+ },
31
+ {
32
+ selector: "variable",
33
+ format: ["camelCase", "UPPER_CASE"],
34
+ leadingUnderscore: "allow",
35
+ trailingUnderscore: "allow",
36
+ },
37
+ {
38
+ selector: "typeLike",
39
+ format: ["PascalCase"],
40
+ },
41
+ {
42
+ selector: "memberLike",
43
+ format: ["camelCase", "UPPER_CASE"],
44
+ leadingUnderscore: "allow",
45
+ trailingUnderscore: "allow",
46
+ },
47
+ {
48
+ selector: "property",
49
+ format: null,
50
+ },
51
+ {
52
+ selector: "method",
53
+ format: null,
54
+ },
55
+ ],
56
+ "@typescript-eslint/consistent-type-assertions": "error",
57
+ "@typescript-eslint/explicit-member-accessibility": "error",
58
+ "@typescript-eslint/no-array-constructor": "error",
59
+ "@typescript-eslint/no-empty-interface": "error",
60
+ "@typescript-eslint/no-extraneous-class": "error",
61
+ "@typescript-eslint/no-floating-promises": "error",
62
+ "@typescript-eslint/no-for-in-array": "error",
63
+ "@typescript-eslint/no-inferrable-types": "error",
64
+ "@typescript-eslint/no-misused-new": "error",
65
+ "@typescript-eslint/no-misused-promises": "error",
66
+ "@typescript-eslint/no-parameter-properties": "error",
67
+ "@typescript-eslint/no-require-imports": "error",
68
+ "@typescript-eslint/no-this-alias": ["error", { allowDestructuring: true }],
69
+ "@typescript-eslint/no-unnecessary-qualifier": "error",
70
+ "@typescript-eslint/no-unnecessary-type-arguments": "error",
71
+ "@typescript-eslint/no-unnecessary-type-assertion": "error",
72
+ "@typescript-eslint/no-var-requires": "error",
73
+ "@typescript-eslint/prefer-function-type": "error",
74
+ "@typescript-eslint/prefer-includes": "error",
75
+ "@typescript-eslint/prefer-namespace-keyword": "error",
76
+ "@typescript-eslint/prefer-readonly": "error",
77
+ "@typescript-eslint/prefer-regexp-exec": "error",
78
+ "@typescript-eslint/prefer-string-starts-ends-with": "error",
79
+ "@typescript-eslint/restrict-plus-operands": "error",
80
+ "@typescript-eslint/require-array-sort-compare": "error",
81
+ "@typescript-eslint/triple-slash-reference": "error",
82
+ "@typescript-eslint/unbound-method": ["error", { ignoreStatic: true }],
83
+ "@typescript-eslint/unified-signatures": "error",
84
+ "prettier/prettier": "error",
85
+
86
+ // Replacements
87
+ camelcase: "off",
88
+ // "@typescript-eslint/camelcase": "error",
89
+ "no-empty-function": "off",
90
+ "@typescript-eslint/no-empty-function": "error",
91
+ "no-useless-constructor": "off",
92
+ "@typescript-eslint/no-useless-constructor": "error",
93
+ "require-await": "off",
94
+ "@typescript-eslint/require-await": "error",
95
+ "no-use-before-define": "off",
96
+ "@typescript-eslint/no-use-before-define": [
97
+ "error",
98
+ {
99
+ functions: false,
100
+ classes: true,
101
+ variables: true,
102
+ ignoreTypeReferences: true,
103
+ },
104
+ ],
105
+ "no-unused-vars": "off",
106
+ "@typescript-eslint/no-unused-vars": [
107
+ "error",
108
+ {
109
+ args: "all",
110
+ argsIgnorePattern: "^_(?:[^_].*)?$",
111
+ caughtErrors: "all",
112
+ vars: "all",
113
+ varsIgnorePattern: "^_(?:[^_].*)?$",
114
+ },
115
+ ],
116
+ },
117
+ };
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.12.0",
3
+ "version": "0.13.1",
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",
@@ -44,12 +44,15 @@
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
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": {