linted 16.12.2-rc.0 → 16.12.2-rc.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (189) hide show
  1. package/.github/workflows/RELEASE.yml +35 -35
  2. package/.github/workflows/rc.yml +35 -35
  3. package/LICENSE +21 -21
  4. package/README.md +390 -390
  5. package/SECURITY.md +9 -9
  6. package/dist/imports/plugins.d.ts.map +1 -1
  7. package/dist/imports.d.ts.map +1 -1
  8. package/dist/rules/html/enable.d.ts +8 -0
  9. package/dist/rules/html/enable.d.ts.map +1 -0
  10. package/dist/rules/html/enable.js +15 -0
  11. package/dist/rules/html/enable.js.map +1 -0
  12. package/dist/rules/html/enable_recommended.d.ts +3 -0
  13. package/dist/rules/html/enable_recommended.d.ts.map +1 -0
  14. package/dist/rules/html/enable_recommended.js +8 -0
  15. package/dist/rules/html/enable_recommended.js.map +1 -0
  16. package/dist/rules/html.d.ts +8 -0
  17. package/dist/rules/html.d.ts.map +1 -0
  18. package/dist/rules/html.js +4 -0
  19. package/dist/rules/html.js.map +1 -0
  20. package/dist/rules/js/enable.d.ts +348 -0
  21. package/dist/rules/js/enable.d.ts.map +1 -0
  22. package/dist/rules/js/enable.js +496 -0
  23. package/dist/rules/js/enable.js.map +1 -0
  24. package/dist/rules/js/enable_stylistic.d.ts +420 -0
  25. package/dist/rules/js/enable_stylistic.d.ts.map +1 -0
  26. package/dist/rules/js/enable_stylistic.js +585 -0
  27. package/dist/rules/js/enable_stylistic.js.map +1 -0
  28. package/dist/rules/js.d.ts +765 -0
  29. package/dist/rules/js.d.ts.map +1 -0
  30. package/dist/rules/js.js +4 -0
  31. package/dist/rules/js.js.map +1 -0
  32. package/dist/rules/json/enable.d.ts +27 -0
  33. package/dist/rules/json/enable.d.ts.map +1 -0
  34. package/dist/rules/json/enable.js +31 -0
  35. package/dist/rules/json/enable.js.map +1 -0
  36. package/dist/rules/json/enable_x.d.ts.map +1 -1
  37. package/dist/rules/json/enable_x.js +48 -8
  38. package/dist/rules/json/enable_x.js.map +1 -1
  39. package/dist/rules/json.d.ts +74 -0
  40. package/dist/rules/json.d.ts.map +1 -0
  41. package/dist/rules/json.js +4 -0
  42. package/dist/rules/json.js.map +1 -0
  43. package/dist/rules/jsonc/override.d.ts.map +1 -1
  44. package/dist/rules/jsonc/override.js +12 -3
  45. package/dist/rules/jsonc/override.js.map +1 -1
  46. package/dist/rules/jsonc.d.ts +77 -0
  47. package/dist/rules/jsonc.d.ts.map +1 -0
  48. package/dist/rules/jsonc.js +4 -0
  49. package/dist/rules/jsonc.js.map +1 -0
  50. package/dist/rules/md/enable.d.ts +7 -0
  51. package/dist/rules/md/enable.d.ts.map +1 -0
  52. package/dist/rules/md/enable.js +14 -0
  53. package/dist/rules/md/enable.js.map +1 -0
  54. package/dist/rules/md.d.ts +7 -0
  55. package/dist/rules/md.d.ts.map +1 -0
  56. package/dist/rules/md.js +3 -0
  57. package/dist/rules/md.js.map +1 -0
  58. package/dist/rules/mocha/enable.d.ts +3 -0
  59. package/dist/rules/mocha/enable.d.ts.map +1 -0
  60. package/dist/rules/mocha/enable.js +3 -0
  61. package/dist/rules/mocha/enable.js.map +1 -0
  62. package/dist/rules/mocha/enable_recommended.d.ts +3 -0
  63. package/dist/rules/mocha/enable_recommended.d.ts.map +1 -0
  64. package/dist/rules/mocha/enable_recommended.js +8 -0
  65. package/dist/rules/mocha/enable_recommended.js.map +1 -0
  66. package/dist/rules/mocha.d.ts +8 -0
  67. package/dist/rules/mocha.d.ts.map +1 -0
  68. package/dist/rules/mocha.js +4 -0
  69. package/dist/rules/mocha.js.map +1 -0
  70. package/dist/rules/svelte/disable.d.ts +5 -0
  71. package/dist/rules/svelte/disable.d.ts.map +1 -0
  72. package/dist/rules/svelte/disable.js +8 -0
  73. package/dist/rules/svelte/disable.js.map +1 -0
  74. package/dist/rules/svelte/disable_js.d.ts.map +1 -1
  75. package/dist/rules/svelte/disable_js.js +8 -3
  76. package/dist/rules/svelte/disable_js.js.map +1 -1
  77. package/dist/rules/svelte/disable_ts.d.ts.map +1 -1
  78. package/dist/rules/svelte/disable_ts.js +8 -3
  79. package/dist/rules/svelte/disable_ts.js.map +1 -1
  80. package/dist/rules/svelte/enable.d.ts +126 -0
  81. package/dist/rules/svelte/enable.d.ts.map +1 -0
  82. package/dist/rules/svelte/enable.js +190 -0
  83. package/dist/rules/svelte/enable.js.map +1 -0
  84. package/dist/rules/svelte/enable_x.d.ts.map +1 -1
  85. package/dist/rules/svelte/enable_x.js +15 -3
  86. package/dist/rules/svelte/enable_x.js.map +1 -1
  87. package/dist/rules/svelte.d.ts +1269 -0
  88. package/dist/rules/svelte.d.ts.map +1 -0
  89. package/dist/rules/svelte.js +15 -0
  90. package/dist/rules/svelte.js.map +1 -0
  91. package/dist/rules/ts/disable.d.ts +18 -0
  92. package/dist/rules/ts/disable.d.ts.map +1 -0
  93. package/dist/rules/ts/disable.js +21 -0
  94. package/dist/rules/ts/disable.js.map +1 -0
  95. package/dist/rules/ts/disable_x.d.ts.map +1 -1
  96. package/dist/rules/ts/disable_x.js +1 -2
  97. package/dist/rules/ts/disable_x.js.map +1 -1
  98. package/dist/rules/ts/enable.d.ts +262 -0
  99. package/dist/rules/ts/enable.d.ts.map +1 -0
  100. package/dist/rules/ts/enable.js +503 -0
  101. package/dist/rules/ts/enable.js.map +1 -0
  102. package/dist/rules/ts/enable_x.d.ts.map +1 -1
  103. package/dist/rules/ts/enable_x.js +32 -5
  104. package/dist/rules/ts/enable_x.js.map +1 -1
  105. package/dist/rules/ts.d.ts +1133 -0
  106. package/dist/rules/ts.d.ts.map +1 -0
  107. package/dist/rules/ts.js +13 -0
  108. package/dist/rules/ts.js.map +1 -0
  109. package/dist/rules/yml/enable.d.ts +39 -0
  110. package/dist/rules/yml/enable.d.ts.map +1 -0
  111. package/dist/rules/yml/enable.js +60 -0
  112. package/dist/rules/yml/enable.js.map +1 -0
  113. package/dist/rules/yml/enable_x.d.ts.map +1 -1
  114. package/dist/rules/yml/enable_x.js +57 -9
  115. package/dist/rules/yml/enable_x.js.map +1 -1
  116. package/dist/rules/yml.d.ts +73 -0
  117. package/dist/rules/yml.d.ts.map +1 -0
  118. package/dist/rules/yml.js +4 -0
  119. package/dist/rules/yml.js.map +1 -0
  120. package/dist/rules.d.ts +75 -75
  121. package/dist/rules.js +9 -9
  122. package/dist/rules.js.map +1 -1
  123. package/eslint.config.js +3 -3
  124. package/package.json +99 -99
  125. package/src/files/html.ts +1 -1
  126. package/src/files/js.ts +1 -1
  127. package/src/files/json.ts +1 -1
  128. package/src/files/jsonc.ts +4 -4
  129. package/src/files/md.ts +1 -1
  130. package/src/files/mocha.ts +1 -1
  131. package/src/files/svelte.ts +1 -1
  132. package/src/files/ts.ts +5 -5
  133. package/src/files/yml.ts +5 -5
  134. package/src/files.ts +22 -22
  135. package/src/imports/parsers.ts +15 -15
  136. package/src/imports/plugins.ts +19 -19
  137. package/src/imports.ts +8 -8
  138. package/src/index.ts +36 -36
  139. package/src/rules/_strings/id.ts +18 -18
  140. package/src/rules/_strings/level.ts +6 -6
  141. package/src/rules/_strings/state.ts +56 -56
  142. package/src/rules/_strings.ts +6 -6
  143. package/src/rules/html/enable.ts +16 -0
  144. package/src/rules/html/enable_recommended.ts +9 -0
  145. package/src/rules/html.ts +4 -0
  146. package/src/rules/js/enable.ts +524 -0
  147. package/src/rules/js/enable_stylistic.ts +608 -0
  148. package/src/rules/js.ts +4 -0
  149. package/src/rules/json/{_enable.ts → enable.ts} +33 -35
  150. package/src/rules/json/enable_x.ts +89 -50
  151. package/src/rules/{_json.ts → json.ts} +4 -4
  152. package/src/rules/jsonc/override.ts +16 -9
  153. package/src/rules/{_jsonc.ts → jsonc.ts} +4 -4
  154. package/src/rules/md/enable.ts +15 -0
  155. package/src/rules/md.ts +3 -0
  156. package/src/rules/mocha/enable.ts +3 -0
  157. package/src/rules/mocha/enable_recommended.ts +9 -0
  158. package/src/rules/mocha.ts +4 -0
  159. package/src/rules/svelte/disable.ts +9 -0
  160. package/src/rules/svelte/disable_js.ts +11 -7
  161. package/src/rules/svelte/disable_ts.ts +9 -5
  162. package/src/rules/svelte/{_enable.ts → enable.ts} +228 -129
  163. package/src/rules/svelte/enable_x.ts +20 -9
  164. package/src/rules/{_svelte.ts → svelte.ts} +15 -15
  165. package/src/rules/ts/{disable_compiler.ts → disable.ts} +22 -23
  166. package/src/rules/ts/disable_x.ts +32 -36
  167. package/src/rules/ts/{_enable.ts → enable.ts} +549 -406
  168. package/src/rules/ts/enable_x.ts +115 -90
  169. package/src/rules/{_ts.ts → ts.ts} +13 -13
  170. package/src/rules/yml/{_enable.ts → enable.ts} +64 -33
  171. package/src/rules/yml/enable_x.ts +68 -21
  172. package/src/rules/{_yml.ts → yml.ts} +4 -4
  173. package/src/rules.ts +22 -22
  174. package/tsconfig.json +161 -161
  175. package/types/markdownlint/index.d.ts +3 -3
  176. package/types/markdownlint/parser.d.ts +9 -9
  177. package/types/mocha/index.d.ts +8 -8
  178. package/src/rules/_html.ts +0 -4
  179. package/src/rules/_js.ts +0 -4
  180. package/src/rules/_md.ts +0 -3
  181. package/src/rules/_mocha.ts +0 -4
  182. package/src/rules/html/_enable.ts +0 -13
  183. package/src/rules/html/_recommended.ts +0 -7
  184. package/src/rules/js/_enable.ts +0 -287
  185. package/src/rules/js/stylistic.ts +0 -294
  186. package/src/rules/md/_enable.ts +0 -14
  187. package/src/rules/mocha/_enable.ts +0 -5
  188. package/src/rules/mocha/_recommended.ts +0 -7
  189. package/src/rules/svelte/disable_x.ts +0 -8
@@ -1,50 +1,89 @@
1
- import { id, level, state } from "../_strings.js";
2
-
3
- const
4
- { enable_x } = id,
5
- { ERROR } = level,
6
- {
7
- Never,
8
- Always,
9
- Consistent,
10
- Strict,
11
- Last,
12
- Double,
13
- } = state;
14
-
15
- export default [
16
- enable_x,
17
- {
18
- // https://ota-meshi.github.io/eslint-plugin-jsonc/rules/#extension-rules
19
- "jsonc/array-bracket-newline": [ERROR, Consistent],
20
- "jsonc/array-bracket-spacing": [ERROR, Never, { singleValue: false, objectsInArrays: false, arraysInArrays: false }],
21
- "jsonc/array-element-newline": [ERROR, Always],
22
- "jsonc/comma-dangle": [ERROR, Never], /* // trailing commas are NOT allowed in JSON */
23
- "jsonc/comma-style": [ERROR, Last],
24
- "jsonc/indent": [ERROR, 2],
25
- "jsonc/key-spacing": [ERROR, { beforeColon: false, afterColon: true, mode: Strict }],
26
- "jsonc/no-dupe-keys": ERROR,
27
- "jsonc/no-floating-decimal": ERROR,
28
- "jsonc/no-irregular-whitespace": [
29
- ERROR,
30
- {
31
- skipStrings: true,
32
- skipComments: true,
33
- skipRegExps: true,
34
- skipTemplates: true,
35
- skipJSXText: true,
36
- },
37
- ],
38
- "jsonc/no-multi-str": ERROR,
39
- "jsonc/no-octal-escape": ERROR,
40
- "jsonc/no-octal": ERROR,
41
- "jsonc/no-sparse-arrays": ERROR,
42
- "jsonc/no-useless-escape": ERROR,
43
- "jsonc/object-curly-newline": [ERROR, { consistent: true, multiline: true, minProperties: 2 }],
44
- "jsonc/object-curly-spacing": [ERROR, Always, { arraysInObjects: true, objectsInObjects: true }],
45
- "jsonc/object-property-newline": [ERROR, { allowAllPropertiesOnSameLine: false }],
46
- "jsonc/quote-props": [ERROR, Always],
47
- "jsonc/quotes": [ERROR, Double, { avoidEscape: false }],
48
- "jsonc/space-unary-ops": ERROR,
49
- },
50
- ] as const;
1
+ import { enable_x, level, state } from "../_strings.js";
2
+
3
+ const
4
+ { ERROR } = level,
5
+ {
6
+ Never,
7
+ Always,
8
+ Consistent,
9
+ Strict,
10
+ Last,
11
+ Double,
12
+ } = state;
13
+
14
+ export default [
15
+ enable_x,
16
+ {
17
+ // https://ota-meshi.github.io/eslint-plugin-jsonc/rules/#extension-rules
18
+ "jsonc/array-bracket-newline": [ERROR, Consistent],
19
+ "jsonc/array-bracket-spacing": [
20
+ ERROR,
21
+ Never,
22
+ {
23
+ singleValue: false,
24
+ objectsInArrays: false,
25
+ arraysInArrays: false,
26
+ },
27
+ ],
28
+ "jsonc/array-element-newline": [ERROR, Always],
29
+ "jsonc/comma-dangle": [ERROR, Never] /* trailing commas are NOT allowed in JSON */,
30
+ "jsonc/comma-style": [ERROR, Last],
31
+ "jsonc/indent": [ERROR, 2],
32
+ "jsonc/key-spacing": [
33
+ ERROR,
34
+ {
35
+ beforeColon: false,
36
+ afterColon: true,
37
+ mode: Strict,
38
+ },
39
+ ],
40
+ "jsonc/no-dupe-keys": ERROR,
41
+ "jsonc/no-floating-decimal": ERROR,
42
+ "jsonc/no-irregular-whitespace": [
43
+ ERROR,
44
+ {
45
+ skipStrings: true,
46
+ skipComments: true,
47
+ skipRegExps: true,
48
+ skipTemplates: true,
49
+ skipJSXText: true,
50
+ },
51
+ ],
52
+ "jsonc/no-multi-str": ERROR,
53
+ "jsonc/no-octal-escape": ERROR,
54
+ "jsonc/no-octal": ERROR,
55
+ "jsonc/no-sparse-arrays": ERROR,
56
+ "jsonc/no-useless-escape": ERROR,
57
+ "jsonc/object-curly-newline": [
58
+ ERROR,
59
+ {
60
+ consistent: true,
61
+ multiline: true,
62
+ minProperties: 2,
63
+ },
64
+ ],
65
+ "jsonc/object-curly-spacing": [
66
+ ERROR,
67
+ Always,
68
+ {
69
+ arraysInObjects: true,
70
+ objectsInObjects: true,
71
+ },
72
+ ],
73
+ "jsonc/object-property-newline": [
74
+ ERROR,
75
+ {
76
+ allowAllPropertiesOnSameLine: false,
77
+ },
78
+ ],
79
+ "jsonc/quote-props": [ERROR, Always],
80
+ "jsonc/quotes": [
81
+ ERROR,
82
+ Double,
83
+ {
84
+ avoidEscape: false,
85
+ },
86
+ ],
87
+ "jsonc/space-unary-ops": ERROR,
88
+ },
89
+ ] as const;
@@ -1,4 +1,4 @@
1
- import EnableX from "./json/enable_x.js";
2
- import Enable from "./json/_enable.js";
3
-
4
- export default [EnableX, Enable] as const;
1
+ import EnableX from "./json/enable_x.js";
2
+ import Enable from "./json/enable.js";
3
+
4
+ export default [EnableX, Enable] as const;
@@ -1,9 +1,16 @@
1
- import { id, level, state } from "../_strings.js";
2
-
3
- const
4
- { override } = id,
5
- { ERROR, OFF } = level,
6
- { AlwaysMultiline } = state;
7
-
8
- // https://ota-meshi.github.io/eslint-plugin-jsonc/rules/#jsonc-rules
9
- export default [override, { "jsonc/no-comments": OFF /* comments are allowed in JSONC */, "jsonc/comma-dangle": [ERROR, AlwaysMultiline] /* trailing commas are allowed in JSONC */ }] as const;
1
+ import { override, level, state } from "../_strings.js";
2
+
3
+ const { ERROR, OFF } = level,
4
+ { AlwaysMultiline } = state;
5
+
6
+ export default [
7
+ override,
8
+ {
9
+ // https://ota-meshi.github.io/eslint-plugin-jsonc/rules/#jsonc-rules
10
+ "jsonc/no-comments": OFF /* comments ARE allowed in JSONC */,
11
+ "jsonc/comma-dangle": [
12
+ ERROR,
13
+ AlwaysMultiline,
14
+ ] /* trailing commas ARE allowed in JSONC */,
15
+ },
16
+ ] as const;
@@ -1,4 +1,4 @@
1
- import Json from "./_json.js";
2
- import OverrideJson from "./jsonc/override.js";
3
-
4
- export default [...Json, OverrideJson] as const;
1
+ import Json from "./json.js";
2
+ import OverrideJson from "./jsonc/override.js";
3
+
4
+ export default [...Json, OverrideJson] as const;
@@ -0,0 +1,15 @@
1
+ import { enable, level } from "../_strings.js";
2
+
3
+ const { ERROR } = level;
4
+
5
+ export default [
6
+ enable,
7
+ {
8
+ "markdownlint/md003": [
9
+ ERROR,
10
+ {
11
+ style: "atx",
12
+ },
13
+ ],
14
+ },
15
+ ] as const;
@@ -0,0 +1,3 @@
1
+ import Enable from "./md/enable.js";
2
+
3
+ export default [Enable] as const;
@@ -0,0 +1,3 @@
1
+ import { enable } from "../_strings.js";
2
+
3
+ export default [enable, {}] as const;
@@ -0,0 +1,9 @@
1
+ import { recommended } from "../_strings.js";
2
+ import mocha from "eslint-plugin-mocha";
3
+
4
+ // REMOVE shared config once manually configured
5
+ export default [
6
+ recommended,
7
+ (mocha.configs.flat.recommended as Record<"rules", Record<string, "off">>)
8
+ .rules,
9
+ ] as const;
@@ -0,0 +1,4 @@
1
+ import Recommended from "./mocha/enable_recommended.js";
2
+ import Enable from "./html/enable.js";
3
+
4
+ export default [Recommended, Enable] as const;
@@ -0,0 +1,9 @@
1
+ import { disable, OFF } from "../_strings.js";
2
+
3
+ export default [
4
+ disable,
5
+ {
6
+ // http://sveltejs.github.io/eslint-plugin-svelte/rules/#extension-rules
7
+ "no-inner-declarations": OFF /* also disabled in SvelteDisableConflictJs per Svelte base config */,
8
+ },
9
+ ] as const;
@@ -1,7 +1,11 @@
1
- import { level } from "../_strings.js";
2
-
3
- const { OFF } = level;
4
-
5
- // Recommended by Svelte base config:
6
- // http://github.com/sveltejs/eslint-plugin-svelte/tree/main/src/configs/flat
7
- export default ["disable-js", { "no-inner-declarations": OFF /* ESLint Core */, "no-self-assign": OFF /* ESLint Core */ }] as const;
1
+ import { OFF } from "../_strings.js";
2
+
3
+ export default [
4
+ "disable-js",
5
+ {
6
+ // Recommended by Svelte base config
7
+ // http://github.com/sveltejs/eslint-plugin-svelte/tree/main/src/configs/flat
8
+ "no-inner-declarations": OFF /* ESLint Core */,
9
+ "no-self-assign": OFF /* ESLint Core */,
10
+ },
11
+ ] as const;
@@ -1,5 +1,9 @@
1
- import { level } from "../_strings.js";
2
-
3
- const { OFF } = level;
4
-
5
- export default ["disable-ts", { "no-unused-vars": OFF /* ESLint Core */, "@typescript-eslint/no-unused-vars": OFF /* TS Extension */ }] as const;
1
+ import { OFF } from "../_strings.js";
2
+
3
+ export default [
4
+ "disable-ts",
5
+ {
6
+ "no-unused-vars": OFF /* ESLint Core */,
7
+ "@typescript-eslint/no-unused-vars": OFF /* TS Extension */,
8
+ },
9
+ ] as const;
@@ -1,129 +1,228 @@
1
- import { id, level, state } from "../_strings.js";
2
-
3
- const
4
- { enable } = id,
5
- { ERROR, OFF } = level,
6
- {
7
- Never,
8
- Always,
9
- Below,
10
- Double,
11
- } = state;
12
-
13
- export default [
14
- enable,
15
- {
16
- // #region Possible Errors
17
- // http://sveltejs.github.io/eslint-plugin-svelte/rules/#possible-errors
18
- "svelte/infinite-reactive-loop": ERROR,
19
- "svelte/no-dom-manipulating": ERROR,
20
- "svelte/no-dupe-else-if-blocks": ERROR,
21
- "svelte/no-dupe-on-directives": ERROR,
22
- "svelte/no-dupe-style-properties": ERROR,
23
- "svelte/no-dupe-use-directives": ERROR,
24
- "svelte/no-dynamic-slot-name": ERROR,
25
- "svelte/no-export-load-in-svelte-module-in-kit-pages": ERROR,
26
- "svelte/no-not-function-handler": ERROR,
27
- "svelte/no-object-in-text-mustaches": ERROR,
28
- "svelte/no-reactive-reassign": [ERROR, { props: true }],
29
- "svelte/no-shorthand-style-property-overrides": ERROR,
30
- "svelte/no-store-async": ERROR,
31
- "svelte/no-unknown-style-directive-property": [ERROR, { ignorePrefixed: true }],
32
- "svelte/require-store-callbacks-use-set-param": ERROR,
33
- "svelte/require-store-reactive-access": ERROR,
34
- "svelte/valid-compile": [ERROR, { ignoreWarnings: false }],
35
- "svelte/valid-prop-names-in-kit-pages": ERROR,
36
-
37
- // #endregion
38
-
39
- // #region Security
40
- // http://sveltejs.github.io/eslint-plugin-svelte/rules/#security-vulnerability
41
- "svelte/no-at-html-tags": ERROR,
42
- "svelte/no-target-blank": [ERROR, { allowReferrer: false, enforceDynamicLinks: Always }],
43
-
44
- // #endregion
45
-
46
- // #region Best Practices
47
- // http://sveltejs.github.io/eslint-plugin-svelte/rules/#best-practices
48
- "svelte/block-lang": [
49
- ERROR,
50
- {
51
- enforceScriptPresent: true,
52
- enforceStylePresent: false,
53
- script: ["ts"],
54
- style: ["css", "scss"],
55
- },
56
- ], /* INVESTIGATE: */
57
- "svelte/button-has-type": [ERROR, { button: true, submit: true, reset: true }],
58
- "svelte/no-at-debug-tags": ERROR,
59
- "svelte/no-ignored-unsubscribe": ERROR,
60
- "svelte/no-immutable-reactive-statements": ERROR,
61
- "svelte/no-inline-styles": [ERROR, { allowTransitions: false }],
62
- "svelte/no-reactive-functions": ERROR,
63
- "svelte/no-reactive-literals": ERROR,
64
- "svelte/no-svelte-internal": ERROR,
65
- "svelte/no-unused-class-name": ERROR, /* BUG: ESLint error if array empty */
66
- "svelte/no-unused-svelte-ignore": ERROR,
67
- "svelte/no-useless-mustaches": [ERROR, { ignoreIncludesComment: false, ignoreStringEscape: false }],
68
- "svelte/prefer-destructured-store-props": ERROR,
69
- "svelte/require-each-key": ERROR,
70
- "svelte/require-event-dispatcher-types": ERROR,
71
- "svelte/require-optimized-style-attribute": ERROR,
72
- "svelte/require-stores-init": ERROR,
73
- "svelte/valid-each-key": ERROR,
74
-
75
- // #endregion
76
-
77
- // #region Style
78
- // http://sveltejs.github.io/eslint-plugin-svelte/rules/#stylistic-issues
79
- "svelte/derived-has-same-inputs-outputs": ERROR,
80
- "svelte/first-attribute-linebreak": [ERROR, { multiline: Below, singleline: Below }],
81
- "svelte/html-closing-bracket-spacing": [ERROR, { startTag: Never, endTag: Never, selfClosingTag: Always }],
82
- "svelte/html-quotes": [ERROR, { prefer: Double, dynamic: { quoted: false, avoidInvalidUnquotedInHTML: true } }],
83
- "svelte/html-self-closing": [
84
- ERROR,
85
- {
86
- "void": Always /* or NEVER or "ignore" */,
87
- normal: Always /* or NEVER or "ignore" */,
88
- component: Always /* or NEVER or "ignore" */,
89
- svelte: Always /* or NEVER or "ignore" */,
90
- },
91
- ],
92
- "svelte/indent": [ERROR, { indent: 2, switchCase: 1, alignAttributesVertically: true }],
93
- "svelte/max-attributes-per-line": [ERROR, { multiline: 1, singleline: 1 }],
94
- "svelte/mustache-spacing": [
95
- ERROR,
96
- {
97
- textExpressions: Never /* or ALWAYS */,
98
- attributesAndProps: Never /* or ALWAYS */,
99
- directiveExpressions: Never /* or ALWAYS */,
100
- tags: { openingBrace: Never /* or ALWAYS */, closingBrace: Never /* or ALWAYS or "always-after-expression" */ },
101
- },
102
- ],
103
- "svelte/no-extra-reactive-curlies": ERROR,
104
- "svelte/no-restricted-html-elements": OFF,
105
- "svelte/no-spaces-around-equal-signs-in-attribute": ERROR,
106
- "svelte/prefer-class-directive": [ERROR, { prefer: "empty" }],
107
- "svelte/prefer-style-directive": ERROR,
108
- "svelte/shorthand-attribute": [ERROR, { prefer: Always }],
109
- "svelte/shorthand-directive": [ERROR, { prefer: Always }],
110
- "svelte/sort-attributes": OFF, // INVESTIGATE:
111
- "svelte/spaced-html-comment": [ERROR, Always],
112
-
113
- // #endregion
114
-
115
- // #region svelte-kit
116
- // http://sveltejs.github.io/eslint-plugin-svelte/rules/#svelte-kit
117
- "svelte/no-goto-without-base": ERROR,
118
-
119
- // #endregion
120
-
121
- // #region System (REQUIRED)
122
- // http://sveltejs.github.io/eslint-plugin-svelte/rules/#system
123
- "svelte/comment-directive": [ERROR, { reportUnusedDisableDirectives: true }],
124
- "svelte/system": ERROR,
125
-
126
- // #endregion
127
-
128
- },
129
- ] as const;
1
+ import { enable, level, state } from "../_strings.js";
2
+
3
+ const
4
+ { ERROR, OFF } = level,
5
+ {
6
+ Never,
7
+ Always,
8
+ Below,
9
+ Double,
10
+ } = state;
11
+
12
+ export default [
13
+ enable,
14
+ {
15
+ // #region Possible Errors
16
+ // http://sveltejs.github.io/eslint-plugin-svelte/rules/#possible-errors
17
+ "svelte/infinite-reactive-loop": ERROR,
18
+ "svelte/no-dom-manipulating": ERROR,
19
+ "svelte/no-dupe-else-if-blocks": ERROR,
20
+ "svelte/no-dupe-on-directives": ERROR,
21
+ "svelte/no-dupe-style-properties": ERROR,
22
+ "svelte/no-dupe-use-directives": ERROR,
23
+ "svelte/no-dynamic-slot-name": ERROR,
24
+ "svelte/no-export-load-in-svelte-module-in-kit-pages": ERROR,
25
+ "svelte/no-not-function-handler": ERROR,
26
+ "svelte/no-object-in-text-mustaches": ERROR,
27
+ "svelte/no-reactive-reassign": [
28
+ ERROR,
29
+ {
30
+ props: true,
31
+ },
32
+ ],
33
+ "svelte/no-shorthand-style-property-overrides": ERROR,
34
+ "svelte/no-store-async": ERROR,
35
+ "svelte/no-unknown-style-directive-property": [
36
+ ERROR,
37
+ {
38
+ ignorePrefixed: true,
39
+ },
40
+ ],
41
+ "svelte/require-store-callbacks-use-set-param": ERROR,
42
+ "svelte/require-store-reactive-access": ERROR,
43
+ "svelte/valid-compile": [
44
+ ERROR,
45
+ {
46
+ ignoreWarnings: false,
47
+ },
48
+ ],
49
+ "svelte/valid-prop-names-in-kit-pages": ERROR,
50
+
51
+ // #endregion
52
+
53
+ // #region Security
54
+ // http://sveltejs.github.io/eslint-plugin-svelte/rules/#security-vulnerability
55
+ "svelte/no-at-html-tags": ERROR,
56
+ "svelte/no-target-blank": [
57
+ ERROR,
58
+ {
59
+ allowReferrer: false,
60
+ enforceDynamicLinks: Always,
61
+ },
62
+ ],
63
+
64
+ // #endregion
65
+
66
+ // #region Best Practices
67
+ // http://sveltejs.github.io/eslint-plugin-svelte/rules/#best-practices
68
+ "svelte/block-lang": [
69
+ ERROR,
70
+ {
71
+ enforceScriptPresent: true,
72
+ enforceStylePresent: false,
73
+ script: ["ts"],
74
+ style: [
75
+ "css",
76
+ "scss",
77
+ ],
78
+ },
79
+ ], /* INVESTIGATE: */
80
+ "svelte/button-has-type": [
81
+ ERROR,
82
+ {
83
+ button: true,
84
+ submit: true,
85
+ reset: true,
86
+ },
87
+ ],
88
+ "svelte/no-at-debug-tags": ERROR,
89
+ "svelte/no-ignored-unsubscribe": ERROR,
90
+ "svelte/no-immutable-reactive-statements": ERROR,
91
+ "svelte/no-inline-styles": [
92
+ ERROR,
93
+ {
94
+ allowTransitions: false,
95
+ },
96
+ ],
97
+ "svelte/no-reactive-functions": ERROR,
98
+ "svelte/no-reactive-literals": ERROR,
99
+ "svelte/no-svelte-internal": ERROR,
100
+ "svelte/no-unused-class-name": ERROR, /* BUG: ESLint error if array empty */
101
+ "svelte/no-unused-svelte-ignore": ERROR,
102
+ "svelte/no-useless-mustaches": [
103
+ ERROR,
104
+ {
105
+ ignoreIncludesComment: false,
106
+ ignoreStringEscape: false,
107
+ },
108
+ ],
109
+ "svelte/prefer-destructured-store-props": ERROR,
110
+ "svelte/require-each-key": ERROR,
111
+ "svelte/require-event-dispatcher-types": ERROR,
112
+ "svelte/require-optimized-style-attribute": ERROR,
113
+ "svelte/require-stores-init": ERROR,
114
+ "svelte/valid-each-key": ERROR,
115
+
116
+ // #endregion
117
+
118
+ // #region Style
119
+ // http://sveltejs.github.io/eslint-plugin-svelte/rules/#stylistic-issues
120
+ "svelte/derived-has-same-inputs-outputs": ERROR,
121
+ "svelte/first-attribute-linebreak": [
122
+ ERROR,
123
+ {
124
+ multiline: Below,
125
+ singleline: Below,
126
+ },
127
+ ],
128
+ "svelte/html-closing-bracket-spacing": [
129
+ ERROR,
130
+ {
131
+ startTag: Never,
132
+ endTag: Never,
133
+ selfClosingTag: Always,
134
+ },
135
+ ],
136
+ "svelte/html-quotes": [
137
+ ERROR,
138
+ {
139
+ prefer: Double,
140
+ dynamic: {
141
+ quoted: false,
142
+ avoidInvalidUnquotedInHTML: true,
143
+ },
144
+ },
145
+ ],
146
+ "svelte/html-self-closing": [
147
+ ERROR,
148
+ {
149
+ "void": Always /* or NEVER or "ignore" */,
150
+ normal: Always /* or NEVER or "ignore" */,
151
+ component: Always /* or NEVER or "ignore" */,
152
+ svelte: Always /* or NEVER or "ignore" */,
153
+ },
154
+ ],
155
+ "svelte/indent": [
156
+ ERROR,
157
+ {
158
+ indent: 2,
159
+ switchCase: 1,
160
+ alignAttributesVertically: true,
161
+ },
162
+ ],
163
+ "svelte/max-attributes-per-line": [
164
+ ERROR,
165
+ {
166
+ multiline: 1,
167
+ singleline: 1,
168
+ },
169
+ ],
170
+ "svelte/mustache-spacing": [
171
+ ERROR,
172
+ {
173
+ textExpressions: Never /* or ALWAYS */,
174
+ attributesAndProps: Never /* or ALWAYS */,
175
+ directiveExpressions: Never /* or ALWAYS */,
176
+ tags: {
177
+ openingBrace: Never /* or ALWAYS */,
178
+ closingBrace: Never /* or ALWAYS or "always-after-expression" */,
179
+ },
180
+ },
181
+ ],
182
+ "svelte/no-extra-reactive-curlies": ERROR,
183
+ "svelte/no-restricted-html-elements": OFF,
184
+ "svelte/no-spaces-around-equal-signs-in-attribute": ERROR,
185
+ "svelte/prefer-class-directive": [
186
+ ERROR,
187
+ {
188
+ prefer: "empty",
189
+ },
190
+ ],
191
+ "svelte/prefer-style-directive": ERROR,
192
+ "svelte/shorthand-attribute": [
193
+ ERROR,
194
+ {
195
+ prefer: Always,
196
+ },
197
+ ],
198
+ "svelte/shorthand-directive": [
199
+ ERROR,
200
+ {
201
+ prefer: Always,
202
+ },
203
+ ],
204
+ "svelte/sort-attributes": OFF /* INVESTIGATE: */,
205
+ "svelte/spaced-html-comment": [ERROR, Always],
206
+
207
+ // #endregion
208
+
209
+ // #region svelte-kit
210
+ // http://sveltejs.github.io/eslint-plugin-svelte/rules/#svelte-kit
211
+ "svelte/no-goto-without-base": ERROR,
212
+
213
+ // #endregion
214
+
215
+ // #region System (REQUIRED)
216
+ // http://sveltejs.github.io/eslint-plugin-svelte/rules/#system
217
+ "svelte/comment-directive": [
218
+ ERROR,
219
+ {
220
+ reportUnusedDisableDirectives: true,
221
+ },
222
+ ],
223
+ "svelte/system": ERROR,
224
+
225
+ // #endregion
226
+
227
+ },
228
+ ] as const;