eslint-plugin-svelte 2.3.1 → 2.4.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/README.md CHANGED
@@ -244,8 +244,9 @@ Example **.vscode/settings.json**:
244
244
 
245
245
  <!--RULES_SECTION_START-->
246
246
 
247
- The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) automatically fixes problems reported by rules which have a wrench :wrench: below.
248
- The rules with the following star :star: are included in the configs.
247
+ :wrench: Indicates that the rule is fixable, and using `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the reported problems.
248
+ :bulb: Indicates that some problems reported by the rule are manually fixable by editor [suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions).
249
+ :star: Indicates that the rule is included in the `plugin:svelte/recommended` config.
249
250
 
250
251
  <!--RULES_TABLE_START-->
251
252
 
@@ -281,6 +282,7 @@ These rules relate to better ways of doing things to help you avoid problems:
281
282
  |:--------|:------------|:---|
282
283
  | [svelte/button-has-type](https://ota-meshi.github.io/eslint-plugin-svelte/rules/button-has-type/) | disallow usage of button without an explicit type attribute | |
283
284
  | [svelte/no-at-debug-tags](https://ota-meshi.github.io/eslint-plugin-svelte/rules/no-at-debug-tags/) | disallow the use of `{@debug}` | :star: |
285
+ | [svelte/no-reactive-literals](https://ota-meshi.github.io/eslint-plugin-svelte/rules/no-reactive-literals/) | Don't assign literal values in reactive statements | :bulb: |
284
286
  | [svelte/no-unused-svelte-ignore](https://ota-meshi.github.io/eslint-plugin-svelte/rules/no-unused-svelte-ignore/) | disallow unused svelte-ignore comments | :star: |
285
287
  | [svelte/no-useless-mustaches](https://ota-meshi.github.io/eslint-plugin-svelte/rules/no-useless-mustaches/) | disallow unnecessary mustache interpolations | :wrench: |
286
288
  | [svelte/require-optimized-style-attribute](https://ota-meshi.github.io/eslint-plugin-svelte/rules/require-optimized-style-attribute/) | require style attributes that can be optimized | |
@@ -297,11 +299,13 @@ These rules relate to style guidelines, and are therefore quite subjective:
297
299
  | [svelte/indent](https://ota-meshi.github.io/eslint-plugin-svelte/rules/indent/) | enforce consistent indentation | :wrench: |
298
300
  | [svelte/max-attributes-per-line](https://ota-meshi.github.io/eslint-plugin-svelte/rules/max-attributes-per-line/) | enforce the maximum number of attributes per line | :wrench: |
299
301
  | [svelte/mustache-spacing](https://ota-meshi.github.io/eslint-plugin-svelte/rules/mustache-spacing/) | enforce unified spacing in mustache | :wrench: |
302
+ | [svelte/no-extra-reactive-curlies](https://ota-meshi.github.io/eslint-plugin-svelte/rules/no-extra-reactive-curlies/) | disallow wrapping single reactive statements in curly braces | :bulb: |
300
303
  | [svelte/no-spaces-around-equal-signs-in-attribute](https://ota-meshi.github.io/eslint-plugin-svelte/rules/no-spaces-around-equal-signs-in-attribute/) | disallow spaces around equal signs in attribute | :wrench: |
301
304
  | [svelte/prefer-class-directive](https://ota-meshi.github.io/eslint-plugin-svelte/rules/prefer-class-directive/) | require class directives instead of ternary expressions | :wrench: |
302
305
  | [svelte/prefer-style-directive](https://ota-meshi.github.io/eslint-plugin-svelte/rules/prefer-style-directive/) | require style directives instead of style attribute | :wrench: |
303
306
  | [svelte/shorthand-attribute](https://ota-meshi.github.io/eslint-plugin-svelte/rules/shorthand-attribute/) | enforce use of shorthand syntax in attribute | :wrench: |
304
307
  | [svelte/shorthand-directive](https://ota-meshi.github.io/eslint-plugin-svelte/rules/shorthand-directive/) | enforce use of shorthand syntax in directives | :wrench: |
308
+ | [svelte/sort-attributes](https://ota-meshi.github.io/eslint-plugin-svelte/rules/sort-attributes/) | enforce order of attributes | :wrench: |
305
309
  | [svelte/spaced-html-comment](https://ota-meshi.github.io/eslint-plugin-svelte/rules/spaced-html-comment/) | enforce consistent spacing after the `<!--` and before the `-->` in a HTML comment | :wrench: |
306
310
 
307
311
  ## Extension Rules
@@ -0,0 +1,2 @@
1
+ declare const _default: import("../types").RuleModule;
2
+ export default _default;
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const utils_1 = require("../utils");
4
+ exports.default = (0, utils_1.createRule)("no-extra-reactive-curlies", {
5
+ meta: {
6
+ docs: {
7
+ description: "disallow wrapping single reactive statements in curly braces",
8
+ category: "Stylistic Issues",
9
+ recommended: false,
10
+ conflictWithPrettier: false,
11
+ },
12
+ hasSuggestions: true,
13
+ schema: [],
14
+ messages: {
15
+ extraCurlies: `Do not wrap reactive statements in curly braces unless necessary.`,
16
+ removeExtraCurlies: `Remove the unnecessary curly braces.`,
17
+ },
18
+ type: "suggestion",
19
+ },
20
+ create(context) {
21
+ return {
22
+ [`SvelteReactiveStatement > BlockStatement[body.length=1]`]: (node) => {
23
+ const source = context.getSourceCode();
24
+ return context.report({
25
+ node,
26
+ loc: node.loc,
27
+ messageId: "extraCurlies",
28
+ suggest: [
29
+ {
30
+ messageId: "removeExtraCurlies",
31
+ fix(fixer) {
32
+ const tokens = source.getTokens(node, { includeComments: true });
33
+ return [
34
+ fixer.removeRange([tokens[0].range[0], tokens[1].range[0]]),
35
+ fixer.removeRange([
36
+ tokens[tokens.length - 2].range[1],
37
+ tokens[tokens.length - 1].range[1],
38
+ ]),
39
+ ];
40
+ },
41
+ },
42
+ ],
43
+ });
44
+ },
45
+ };
46
+ },
47
+ });
@@ -0,0 +1,2 @@
1
+ declare const _default: import("../types").RuleModule;
2
+ export default _default;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const utils_1 = require("../utils");
4
+ exports.default = (0, utils_1.createRule)("no-reactive-literals", {
5
+ meta: {
6
+ docs: {
7
+ description: "Don't assign literal values in reactive statements",
8
+ category: "Best Practices",
9
+ recommended: false,
10
+ },
11
+ hasSuggestions: true,
12
+ schema: [],
13
+ messages: {
14
+ noReactiveLiterals: `Do not assign literal values inside reactive statements unless absolutely necessary.`,
15
+ fixReactiveLiteral: `Move the literal out of the reactive statement into an assignment`,
16
+ },
17
+ type: "suggestion",
18
+ },
19
+ create(context) {
20
+ return {
21
+ [`SvelteReactiveStatement > ExpressionStatement > AssignmentExpression${[
22
+ `[right.type="Literal"]`,
23
+ `[right.type="ArrayExpression"][right.elements.length=0]`,
24
+ `[right.type="ObjectExpression"][right.properties.length=0]`,
25
+ ].join(",")}`](node) {
26
+ const parent = node.parent?.parent;
27
+ if (!parent) {
28
+ return false;
29
+ }
30
+ const source = context.getSourceCode();
31
+ return context.report({
32
+ node: parent,
33
+ loc: parent.loc,
34
+ messageId: "noReactiveLiterals",
35
+ suggest: [
36
+ {
37
+ messageId: "fixReactiveLiteral",
38
+ fix(fixer) {
39
+ return [
40
+ fixer.insertTextBefore(parent, `let ${source.getText(node)}`),
41
+ fixer.remove(parent),
42
+ ];
43
+ },
44
+ },
45
+ ],
46
+ });
47
+ },
48
+ };
49
+ },
50
+ });
@@ -0,0 +1,2 @@
1
+ declare const _default: import("../types").RuleModule;
2
+ export default _default;
@@ -0,0 +1,260 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const utils_1 = require("../utils");
4
+ const ast_utils_1 = require("../utils/ast-utils");
5
+ const regexp_1 = require("../utils/regexp");
6
+ const DEFAULT_ORDER = [
7
+ "this",
8
+ "bind:this",
9
+ "id",
10
+ "name",
11
+ "slot",
12
+ { match: "/^--/u", sort: "alphabetical" },
13
+ ["style", "/^style:/u"],
14
+ "class",
15
+ { match: "/^class:/u", sort: "alphabetical" },
16
+ {
17
+ match: ["!/:/u", "!/^(?:this|id|name|style|class)$/u", "!/^--/u"],
18
+ sort: "alphabetical",
19
+ },
20
+ ["/^bind:/u", "!bind:this", "/^on:/u"],
21
+ { match: "/^use:/u", sort: "alphabetical" },
22
+ { match: "/^transition:/u", sort: "alphabetical" },
23
+ { match: "/^in:/u", sort: "alphabetical" },
24
+ { match: "/^out:/u", sort: "alphabetical" },
25
+ { match: "/^animate:/u", sort: "alphabetical" },
26
+ { match: "/^let:/u", sort: "alphabetical" },
27
+ ];
28
+ function parseOption(option) {
29
+ const order = option?.order ?? DEFAULT_ORDER;
30
+ const compiled = order.map(compileOption);
31
+ return {
32
+ ignore: (key) => {
33
+ return !compiled.some((c) => c.match(key));
34
+ },
35
+ compare: (a, b) => {
36
+ for (const c of compiled) {
37
+ const matchA = c.match(a);
38
+ const matchB = c.match(b);
39
+ if (matchA && matchB) {
40
+ if (c.sort === "alphabetical") {
41
+ return a === b ? 0 : a < b ? -1 : 1;
42
+ }
43
+ return 0;
44
+ }
45
+ if (matchA) {
46
+ return -1;
47
+ }
48
+ if (matchB) {
49
+ return 1;
50
+ }
51
+ }
52
+ throw new Error("Illegal state");
53
+ },
54
+ };
55
+ }
56
+ function compileOption(option) {
57
+ const cache = {};
58
+ const compiled = compileOptionWithoutCache(option);
59
+ return {
60
+ match: (str) => {
61
+ if (cache[str] != null)
62
+ return cache[str];
63
+ return (cache[str] = compiled.match(str));
64
+ },
65
+ sort: compiled.sort,
66
+ };
67
+ function compileOptionWithoutCache(option) {
68
+ if (typeof option === "string") {
69
+ const match = compileMatcher([option]);
70
+ return { match, sort: "ignore" };
71
+ }
72
+ if (Array.isArray(option)) {
73
+ const match = compileMatcher(option);
74
+ return { match, sort: "ignore" };
75
+ }
76
+ const { match } = compileOptionWithoutCache(option.match);
77
+ return { match, sort: option.sort || "ignore" };
78
+ }
79
+ }
80
+ function compileMatcher(pattern) {
81
+ const rules = [];
82
+ for (const p of pattern) {
83
+ let negative, patternStr;
84
+ if (p.startsWith("!")) {
85
+ negative = true;
86
+ patternStr = p.substring(1);
87
+ }
88
+ else {
89
+ negative = false;
90
+ patternStr = p;
91
+ }
92
+ const regex = (0, regexp_1.toRegExp)(patternStr);
93
+ rules.push({ negative, match: (str) => regex.test(str) });
94
+ }
95
+ return (str) => {
96
+ let result = Boolean(rules[0]?.negative);
97
+ for (const { negative, match } of rules) {
98
+ if (result === !negative) {
99
+ continue;
100
+ }
101
+ if (match(str)) {
102
+ result = !negative;
103
+ }
104
+ }
105
+ return result;
106
+ };
107
+ }
108
+ exports.default = (0, utils_1.createRule)("sort-attributes", {
109
+ meta: {
110
+ docs: {
111
+ description: "enforce order of attributes",
112
+ category: "Stylistic Issues",
113
+ recommended: false,
114
+ conflictWithPrettier: false,
115
+ },
116
+ schema: [
117
+ {
118
+ type: "object",
119
+ properties: {
120
+ order: {
121
+ type: "array",
122
+ items: {
123
+ anyOf: [
124
+ { type: "string" },
125
+ {
126
+ type: "array",
127
+ items: {
128
+ type: "string",
129
+ },
130
+ uniqueItems: true,
131
+ minItems: 1,
132
+ },
133
+ {
134
+ type: "object",
135
+ properties: {
136
+ match: {
137
+ anyOf: [
138
+ { type: "string" },
139
+ {
140
+ type: "array",
141
+ items: {
142
+ type: "string",
143
+ },
144
+ uniqueItems: true,
145
+ minItems: 1,
146
+ },
147
+ ],
148
+ },
149
+ sort: {
150
+ enum: ["alphabetical", "ignore"],
151
+ },
152
+ },
153
+ required: ["match", "sort"],
154
+ additionalProperties: false,
155
+ },
156
+ ],
157
+ },
158
+ uniqueItems: true,
159
+ additionalItems: false,
160
+ },
161
+ alphabetical: { type: "boolean" },
162
+ },
163
+ additionalProperties: false,
164
+ },
165
+ ],
166
+ messages: {
167
+ shouldBefore: "Attribute '{{currentKey}}' should go before '{{prevKey}}'.",
168
+ },
169
+ type: "layout",
170
+ fixable: "code",
171
+ },
172
+ create(context) {
173
+ const option = parseOption(context.options[0]);
174
+ const cacheKeyText = new Map();
175
+ function getKeyText(node) {
176
+ const k = cacheKeyText.get(node);
177
+ if (k != null)
178
+ return k;
179
+ const result = (0, ast_utils_1.getAttributeKeyText)(node);
180
+ cacheKeyText.set(node, result);
181
+ return result;
182
+ }
183
+ function report(node, previousNode) {
184
+ const currentKey = getKeyText(node);
185
+ const prevKey = getKeyText(previousNode);
186
+ context.report({
187
+ node,
188
+ messageId: "shouldBefore",
189
+ data: {
190
+ currentKey,
191
+ prevKey,
192
+ },
193
+ fix(fixer) {
194
+ const attributes = node.parent.attributes;
195
+ const previousNodes = attributes.slice(attributes.indexOf(previousNode), attributes.indexOf(node));
196
+ const moveNodes = [node, ...previousNodes];
197
+ const sourceCode = context.getSourceCode();
198
+ return moveNodes.map((moveNode, index) => {
199
+ const text = sourceCode.getText(moveNode);
200
+ return fixer.replaceText(previousNodes[index] || node, text);
201
+ });
202
+ },
203
+ });
204
+ }
205
+ function hasSpreadAttribute(node, previousNode) {
206
+ const attributes = node.parent.attributes;
207
+ const previousNodes = attributes.slice(attributes.indexOf(previousNode), attributes.indexOf(node));
208
+ return previousNodes.some((a) => a.type === "SvelteSpreadAttribute");
209
+ }
210
+ function verifyForSpreadAttributeExist(node) {
211
+ const previousNodes = [];
212
+ const attributes = node.parent.attributes;
213
+ for (const previousNode of attributes
214
+ .slice(0, attributes.indexOf(node))
215
+ .reverse()) {
216
+ if (previousNode.type === "SvelteSpreadAttribute") {
217
+ break;
218
+ }
219
+ previousNodes.unshift(previousNode);
220
+ }
221
+ const key = getKeyText(node);
222
+ const invalidPreviousNode = previousNodes.find((previousNode) => {
223
+ const prevKey = getKeyText(previousNode);
224
+ if (option.ignore(prevKey)) {
225
+ return false;
226
+ }
227
+ return option.compare(prevKey, key) > 0;
228
+ });
229
+ if (invalidPreviousNode) {
230
+ report(node, invalidPreviousNode);
231
+ }
232
+ }
233
+ return {
234
+ SvelteStartTag(node) {
235
+ const validPreviousNodes = [];
236
+ for (const attr of node.attributes) {
237
+ if (attr.type === "SvelteSpreadAttribute") {
238
+ continue;
239
+ }
240
+ const key = getKeyText(attr);
241
+ if (option.ignore(key)) {
242
+ continue;
243
+ }
244
+ const invalidPreviousNode = validPreviousNodes.find((previousNode) => option.compare(getKeyText(previousNode), key) > 0);
245
+ if (invalidPreviousNode) {
246
+ if (attr.type !== "SvelteAttribute" ||
247
+ !hasSpreadAttribute(attr, invalidPreviousNode)) {
248
+ report(attr, invalidPreviousNode);
249
+ }
250
+ else {
251
+ verifyForSpreadAttributeExist(attr);
252
+ }
253
+ continue;
254
+ }
255
+ validPreviousNodes.push(attr);
256
+ }
257
+ },
258
+ };
259
+ },
260
+ });
package/lib/types.d.ts CHANGED
@@ -33,6 +33,7 @@ export interface RuleMetaData {
33
33
  [messageId: string]: string;
34
34
  };
35
35
  fixable?: "code" | "whitespace";
36
+ hasSuggestions?: boolean;
36
37
  schema: JSONSchema4 | JSONSchema4[];
37
38
  deprecated?: boolean;
38
39
  replacedBy?: string[];
@@ -59,6 +60,7 @@ export interface PartialRuleMetaData {
59
60
  [messageId: string]: string;
60
61
  };
61
62
  fixable?: "code" | "whitespace";
63
+ hasSuggestions?: boolean;
62
64
  schema: JSONSchema4 | JSONSchema4[];
63
65
  deprecated?: boolean;
64
66
  replacedBy?: string[];
@@ -46,3 +46,5 @@ export declare function getMustacheTokens(node: SvAST.SvelteDirective | SvAST.Sv
46
46
  openToken: SvAST.Token;
47
47
  closeToken: SvAST.Token;
48
48
  } | null;
49
+ export declare function getAttributeKeyText(node: SvAST.SvelteAttribute | SvAST.SvelteShorthandAttribute | SvAST.SvelteStyleDirective | SvAST.SvelteDirective | SvAST.SvelteSpecialDirective): string;
50
+ export declare function getDirectiveName(node: SvAST.SvelteDirective): string;
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.getMustacheTokens = exports.getAttributeValueQuoteAndRange = exports.getScope = exports.findVariable = exports.getLangValue = exports.getStaticAttributeValue = exports.findBindDirective = exports.findShorthandAttribute = exports.findAttribute = exports.isHTMLElementLike = exports.needParentheses = exports.getStringIfConstant = exports.equalTokens = void 0;
26
+ exports.getDirectiveName = exports.getAttributeKeyText = exports.getMustacheTokens = exports.getAttributeValueQuoteAndRange = exports.getScope = exports.findVariable = exports.getLangValue = exports.getStaticAttributeValue = exports.findBindDirective = exports.findShorthandAttribute = exports.findAttribute = exports.isHTMLElementLike = exports.needParentheses = exports.getStringIfConstant = exports.equalTokens = void 0;
27
27
  const eslintUtils = __importStar(require("eslint-utils"));
28
28
  function equalTokens(left, right, sourceCode) {
29
29
  const tokensL = sourceCode.getTokens(left);
@@ -260,6 +260,47 @@ function getMustacheTokens(node, sourceCode) {
260
260
  };
261
261
  }
262
262
  exports.getMustacheTokens = getMustacheTokens;
263
+ function getAttributeKeyText(node) {
264
+ switch (node.type) {
265
+ case "SvelteAttribute":
266
+ case "SvelteShorthandAttribute":
267
+ return node.key.name;
268
+ case "SvelteStyleDirective":
269
+ return `style:${node.key.name.name}`;
270
+ case "SvelteSpecialDirective":
271
+ return node.kind;
272
+ case "SvelteDirective": {
273
+ const dir = getDirectiveName(node);
274
+ return `${dir}:${node.key.name.name}${node.key.modifiers.length ? `|${node.key.modifiers.join("|")}` : ""}`;
275
+ }
276
+ default:
277
+ throw new Error(`Unknown node type: ${node.type}`);
278
+ }
279
+ }
280
+ exports.getAttributeKeyText = getAttributeKeyText;
281
+ function getDirectiveName(node) {
282
+ switch (node.kind) {
283
+ case "Action":
284
+ return "use";
285
+ case "Animation":
286
+ return "animate";
287
+ case "Binding":
288
+ return "bind";
289
+ case "Class":
290
+ return "class";
291
+ case "EventHandler":
292
+ return "on";
293
+ case "Let":
294
+ return "let";
295
+ case "Transition":
296
+ return node.intro && node.outro ? "transition" : node.intro ? "in" : "out";
297
+ case "Ref":
298
+ return "ref";
299
+ default:
300
+ throw new Error("Unknown directive kind");
301
+ }
302
+ }
303
+ exports.getDirectiveName = getDirectiveName;
263
304
  function getAttributeValueRangeTokens(attr, sourceCode) {
264
305
  if (attr.type === "SvelteAttribute" || attr.type === "SvelteStyleDirective") {
265
306
  if (!attr.value.length) {
@@ -1,2 +1,4 @@
1
- export declare function toRegExp(string: string): RegExp;
1
+ export declare function toRegExp(string: string): {
2
+ test(s: string): boolean;
3
+ };
2
4
  export declare function isRegExp(string: string): boolean;
@@ -1,20 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isRegExp = exports.toRegExp = void 0;
4
- const RE_REGEXP_CHAR = /[$()*+.?[\\\]^{|}]/gu;
5
- const RE_HAS_REGEXP_CHAR = new RegExp(RE_REGEXP_CHAR.source);
6
4
  const RE_REGEXP_STR = /^\/(.+)\/([A-Za-z]*)$/u;
7
- function escape(string) {
8
- return string && RE_HAS_REGEXP_CHAR.test(string)
9
- ? string.replace(RE_REGEXP_CHAR, "\\$&")
10
- : string;
11
- }
12
5
  function toRegExp(string) {
13
6
  const parts = RE_REGEXP_STR.exec(string);
14
7
  if (parts) {
15
8
  return new RegExp(parts[1], parts[2]);
16
9
  }
17
- return new RegExp(`^${escape(string)}$`);
10
+ return { test: (s) => s === string };
18
11
  }
19
12
  exports.toRegExp = toRegExp;
20
13
  function isRegExp(string) {
@@ -17,9 +17,11 @@ const no_at_html_tags_1 = __importDefault(require("../rules/no-at-html-tags"));
17
17
  const no_dupe_else_if_blocks_1 = __importDefault(require("../rules/no-dupe-else-if-blocks"));
18
18
  const no_dupe_style_properties_1 = __importDefault(require("../rules/no-dupe-style-properties"));
19
19
  const no_dynamic_slot_name_1 = __importDefault(require("../rules/no-dynamic-slot-name"));
20
+ const no_extra_reactive_curlies_1 = __importDefault(require("../rules/no-extra-reactive-curlies"));
20
21
  const no_inner_declarations_1 = __importDefault(require("../rules/no-inner-declarations"));
21
22
  const no_not_function_handler_1 = __importDefault(require("../rules/no-not-function-handler"));
22
23
  const no_object_in_text_mustaches_1 = __importDefault(require("../rules/no-object-in-text-mustaches"));
24
+ const no_reactive_literals_1 = __importDefault(require("../rules/no-reactive-literals"));
23
25
  const no_shorthand_style_property_overrides_1 = __importDefault(require("../rules/no-shorthand-style-property-overrides"));
24
26
  const no_spaces_around_equal_signs_in_attribute_1 = __importDefault(require("../rules/no-spaces-around-equal-signs-in-attribute"));
25
27
  const no_target_blank_1 = __importDefault(require("../rules/no-target-blank"));
@@ -31,6 +33,7 @@ const prefer_style_directive_1 = __importDefault(require("../rules/prefer-style-
31
33
  const require_optimized_style_attribute_1 = __importDefault(require("../rules/require-optimized-style-attribute"));
32
34
  const shorthand_attribute_1 = __importDefault(require("../rules/shorthand-attribute"));
33
35
  const shorthand_directive_1 = __importDefault(require("../rules/shorthand-directive"));
36
+ const sort_attributes_1 = __importDefault(require("../rules/sort-attributes"));
34
37
  const spaced_html_comment_1 = __importDefault(require("../rules/spaced-html-comment"));
35
38
  const system_1 = __importDefault(require("../rules/system"));
36
39
  const valid_compile_1 = __importDefault(require("../rules/valid-compile"));
@@ -48,9 +51,11 @@ exports.rules = [
48
51
  no_dupe_else_if_blocks_1.default,
49
52
  no_dupe_style_properties_1.default,
50
53
  no_dynamic_slot_name_1.default,
54
+ no_extra_reactive_curlies_1.default,
51
55
  no_inner_declarations_1.default,
52
56
  no_not_function_handler_1.default,
53
57
  no_object_in_text_mustaches_1.default,
58
+ no_reactive_literals_1.default,
54
59
  no_shorthand_style_property_overrides_1.default,
55
60
  no_spaces_around_equal_signs_in_attribute_1.default,
56
61
  no_target_blank_1.default,
@@ -62,6 +67,7 @@ exports.rules = [
62
67
  require_optimized_style_attribute_1.default,
63
68
  shorthand_attribute_1.default,
64
69
  shorthand_directive_1.default,
70
+ sort_attributes_1.default,
65
71
  spaced_html_comment_1.default,
66
72
  system_1.default,
67
73
  valid_compile_1.default,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-svelte",
3
- "version": "2.3.1",
3
+ "version": "2.4.0",
4
4
  "description": "ESLint plugin for Svelte using AST",
5
5
  "repository": "git+https://github.com/ota-meshi/eslint-plugin-svelte.git",
6
6
  "homepage": "https://ota-meshi.github.io/eslint-plugin-svelte",