eslint-plugin-lube 0.3.3 → 0.3.4

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/index.js CHANGED
@@ -9,41 +9,132 @@ module.exports = {
9
9
  extends: ["eslint:recommended"],
10
10
  plugins: ["lube"],
11
11
  rules: {
12
- "arrow-spacing": "error",
13
- "comma-spacing": "error",
12
+ "array-bracket-newline": [
13
+ "error", {
14
+ "multiline": true
15
+ }
16
+ ],
17
+ "array-element-newline": ["error", "consistent"],
18
+ "arrow-parens": ["error", "as-needed"],
19
+ "arrow-spacing": [
20
+ "error", {
21
+ "before": true,
22
+ "after": true
23
+ }
24
+ ],
25
+ "block-spacing": ["error", "always"],
26
+ "brace-style": ["error", "1tbs"],
27
+ "comma-dangle": ["error", "never"],
28
+ "comma-spacing": [
29
+ "error", {
30
+ "before": false,
31
+ "after": true
32
+ }
33
+ ],
34
+ "comma-style": ["error", "last"],
35
+ "computed-property-spacing": ["error", "never"],
14
36
  "dot-location": ["error", "property"],
15
- "for-direction": "error",
16
- "getter-return": "error",
37
+ "eol-last": ["error", "never"],
38
+ "func-call-spacing": ["error", "never"],
39
+ "function-call-argument-newline": ["error", "consistent"],
40
+ "generator-star-spacing": ["error", "after"],
17
41
  "indent": ["error", "tab"],
18
- "keyword-spacing": ["error", {
19
- "after": true,
20
- "before": true
21
- }],
42
+ "jsx-quotes": ["error", "prefer-double"],
43
+ "key-spacing": [
44
+ "error", {
45
+ "afterColon": true,
46
+ "beforeColon": false
47
+ }
48
+ ],
49
+ "keyword-spacing": [
50
+ "error", {
51
+ "after": true,
52
+ "before": true
53
+ }
54
+ ],
22
55
  "max-len": ["warn", 120],
23
56
  "max-nested-callbacks": ["error", 3],
57
+ "max-statements-per-line": [
58
+ "error", {
59
+ "max": 1
60
+ }
61
+ ],
62
+ "multiline-ternary": ["error", "always-multiline"],
63
+ "newline-per-chained-call": [
64
+ "error", {
65
+ "ignoreChainWithDepth": 2
66
+ }
67
+ ],
68
+ "no-await-in-loop": "error",
24
69
  "no-console": "warn",
25
70
  "no-duplicate-imports": "error",
26
- "no-empty-pattern": "error",
71
+ "no-lonely-if": "error",
27
72
  "no-multi-spaces": "error",
73
+ "no-new-native-nonconstructor": "error",
74
+ "no-self-compare": "error",
75
+ "no-shadow": "error",
76
+ "no-shadow-restricted-names": "error",
77
+ "no-trailing-spaces": [
78
+ "error", {
79
+ "ignoreComments": false,
80
+ "skipBlankLines": false
81
+ }
82
+ ],
83
+ "object-curly-newline": [
84
+ "error", {
85
+ "consistent": true
86
+ }
87
+ ],
28
88
  "object-curly-spacing": ["error", "always"],
29
- "prefer-const": "warn",
89
+ "operator-linebreak": ["error", "before"],
90
+ "prefer-const": [
91
+ "warn", {
92
+ "destructuring": "all",
93
+ "ignoreReadBeforeAssign": false
94
+ }
95
+ ],
30
96
  "quotes": ["error", "double"],
97
+ "rest-spread-spacing": ["error", "never"],
31
98
  "semi": ["error", "never"],
32
- "semi-spacing": ["error", {
33
- "after": true,
34
- "before": false
35
- }],
36
- "space-before-function-paren": ["error", {
37
- "anonymous": "never",
38
- "asyncArrow": "always",
39
- "named": "never"
40
- }],
99
+ "semi-spacing": [
100
+ "error", {
101
+ "after": true,
102
+ "before": false
103
+ }
104
+ ],
105
+ "semi-style": ["error", "first"],
106
+ "space-before-blocks": ["error", "always"],
107
+ "space-before-function-paren": [
108
+ "error", {
109
+ "anonymous": "never",
110
+ "asyncArrow": "always",
111
+ "named": "never"
112
+ }
113
+ ],
41
114
  "space-in-parens": ["error", "never"],
42
- "space-infix-ops": "error",
43
- "space-unary-ops": "error",
115
+ "space-infix-ops": [
116
+ "error", {
117
+ "int32Hint": true
118
+ }
119
+ ],
120
+ "space-unary-ops": [
121
+ "error", {
122
+ "words": true,
123
+ "nonwords": false
124
+ }
125
+ ],
126
+ "switch-colon-spacing": [
127
+ "error", {
128
+ "after": true,
129
+ "before": false
130
+ }
131
+ ],
132
+ "template-curly-spacing": ["error", "never"],
133
+ "template-tag-spacing": ["error", "never"],
134
+ "yield-star-spacing": ["error", "after"],
44
135
  "lube/pretty-imports": "error",
45
136
  "lube/pretty-jsdoc-casting": "error",
46
- "lube/svelte-naming-convention": "error",
137
+ "lube/svelte-naming-convention": "error"
47
138
  }
48
139
  }
49
140
  },
package/package.json CHANGED
@@ -22,5 +22,5 @@
22
22
  "test": "mocha"
23
23
  },
24
24
  "type": "commonjs",
25
- "version": "0.3.3"
25
+ "version": "0.3.4"
26
26
  }
@@ -12,31 +12,33 @@ module.exports = {
12
12
  exports: "This exports is not pretty",
13
13
  imports: "This imports is not pretty"
14
14
  },
15
- schema: [{
16
- properties: {
17
- checkExports: {
18
- type: "boolean",
19
- default: true
20
- },
21
- checkImports: {
22
- type: "boolean",
23
- default: true
24
- },
25
- indent: {
26
- type: "string",
27
- default: "\t"
28
- },
29
- maxLength: {
30
- type: "number",
31
- default: 30
15
+ schema: [
16
+ {
17
+ properties: {
18
+ checkExports: {
19
+ type: "boolean",
20
+ default: true
21
+ },
22
+ checkImports: {
23
+ type: "boolean",
24
+ default: true
25
+ },
26
+ indent: {
27
+ type: "string",
28
+ default: "\t"
29
+ },
30
+ maxLength: {
31
+ type: "number",
32
+ default: 30
33
+ },
34
+ semicolon: {
35
+ type: "boolean",
36
+ default: false
37
+ }
32
38
  },
33
- semicolon: {
34
- type: "boolean",
35
- default: false
36
- }
37
- },
38
- type: "object"
39
- }],
39
+ type: "object"
40
+ }
41
+ ],
40
42
  type: "layout"
41
43
  },
42
44
  create(context) {
@@ -110,12 +112,12 @@ module.exports = {
110
112
  }
111
113
  let corrected_text = length > max_length
112
114
  ? `export {\n${line_indent + indent}${
113
-
115
+
114
116
  /** @type {import("../private").AstNode[]} */(node.specifiers)/**/.map(get_text)
115
117
  .join(",\n" + line_indent + indent)
116
118
  }\n${line_indent}}`
117
119
  : `export { ${
118
-
120
+
119
121
  /** @type {import("../private").AstNode[]} */(node.specifiers)/**/.map(get_text).join(", ")
120
122
  } }`
121
123
  if (node.source) {
@@ -140,12 +142,12 @@ module.exports = {
140
142
  }
141
143
  let corrected_text = length > max_length
142
144
  ? `import {\n${line_indent + indent}${
143
-
145
+
144
146
  /** @type {import("../private").AstNode[]} */(node.specifiers)/**/.map(get_text)
145
147
  .join(",\n" + line_indent + indent)
146
148
  }\n${line_indent}} from ${node.source.raw}`
147
149
  : `import { ${
148
-
150
+
149
151
  /** @type {import("../private").AstNode[]} */(node.specifiers)/**/.map(get_text).join(", ")
150
152
  } } from ${node.source.raw}`
151
153
  if (semicolon) {
@@ -88,18 +88,18 @@ module.exports = {
88
88
  }
89
89
  }
90
90
  } else {
91
- const space = left_space_regex.exec(origin_text.slice(0, left))?.[0].length
92
- if (space) {
93
- left -= space
91
+ const left_space = left_space_regex.exec(origin_text.slice(0, left))?.[0].length
92
+ if (left_space) {
93
+ left -= left_space
94
94
  } else if (origin_text[left - 1] == "(") {
95
95
  while (right < text_length) {
96
96
  if (comments[right]) {
97
97
  const comment = comments[right]
98
98
  right = comment.range[1]
99
99
  } else {
100
- const space = right_space_regex.exec(origin_text.slice(right))?.[0].length
101
- if (space) {
102
- right += space
100
+ const right_space = right_space_regex.exec(origin_text.slice(right))?.[0].length
101
+ if (right_space) {
102
+ right += right_space
103
103
  } else {
104
104
  if (origin_text[right] == ")") {
105
105
  prev_open = left--
@@ -11,15 +11,17 @@ module.exports = {
11
11
  messages: {
12
12
  not_match: "Identifier '{{name}}' does not match for svelte's naming conventions."
13
13
  },
14
- schema: [{
15
- properties: {
16
- fixSameNames: {
17
- type: "boolean",
18
- default: true
14
+ schema: [
15
+ {
16
+ properties: {
17
+ fixSameNames: {
18
+ type: "boolean",
19
+ default: true
20
+ }
19
21
  },
20
- },
21
- type: "object"
22
- }],
22
+ type: "object"
23
+ }
24
+ ],
23
25
  type: "layout"
24
26
  },
25
27
  create(context) {
@@ -199,7 +201,7 @@ module.exports = {
199
201
  break
200
202
  case "FunctionDeclaration":
201
203
  // function camelCase() {}
202
- if (
204
+ if (
203
205
  parent.parent?.type != "ExportNamedDeclaration"
204
206
  || !camel_case_regex.test(name)
205
207
  ) {
@@ -240,8 +242,7 @@ module.exports = {
240
242
  // object.property
241
243
  if (parent.object == node) {
242
244
  defer(node)
243
- }
244
- else if (parent.computed) {
245
+ } else if (parent.computed) {
245
246
  // object[camelCase]
246
247
  // camelCase[key]
247
248
  defer(node)
@@ -327,7 +328,7 @@ module.exports = {
327
328
  case "VariableDeclarator":
328
329
  // var id = init
329
330
  if (parent.id == node) {
330
- if (
331
+ if (
331
332
  parent.parent?.parent?.type != "ExportNamedDeclaration"
332
333
  || !camel_case_regex.test(name)
333
334
  ) {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @param {import("eslint").RuleTester.ValidTestCase[]} valid
2
+ * @param {import("eslint").RuleTester.ValidTestCase[]} valid
3
3
  * @param {import("eslint").RuleTester.InvalidTestCase[]} invalid
4
4
  */
5
5
  exports.module = (valid, invalid) => {
@@ -49,10 +49,12 @@ exports.module = (valid, invalid) => {
49
49
  column: 7
50
50
  }
51
51
  ],
52
- options: [{
53
- maxLength: 10,
54
- semicolon: true
55
- }],
52
+ options: [
53
+ {
54
+ maxLength: 10,
55
+ semicolon: true
56
+ }
57
+ ],
56
58
  output: `
57
59
 
58
60
  export { a, b as c, d } from 'module';
@@ -91,10 +93,12 @@ exports.module = (valid, invalid) => {
91
93
  column: 7
92
94
  }
93
95
  ],
94
- options: [{
95
- indent: " ",
96
- maxLength: 10
97
- }],
96
+ options: [
97
+ {
98
+ indent: " ",
99
+ maxLength: 10
100
+ }
101
+ ],
98
102
  output: `
99
103
 
100
104
  export { a, b as c, d } from 'module'
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @param {import("eslint").RuleTester.ValidTestCase[]} valid
2
+ * @param {import("eslint").RuleTester.ValidTestCase[]} valid
3
3
  * @param {import("eslint").RuleTester.InvalidTestCase[]} invalid
4
4
  */
5
5
  exports.module = (valid, invalid) => {
@@ -51,10 +51,12 @@ import {
51
51
  column: 7
52
52
  }
53
53
  ],
54
- options: [{
55
- maxLength: 10,
56
- semicolon: true
57
- }],
54
+ options: [
55
+ {
56
+ maxLength: 10,
57
+ semicolon: true
58
+ }
59
+ ],
58
60
  output: `
59
61
 
60
62
  import { a, b as c, d } from 'module';
@@ -93,10 +95,12 @@ import {
93
95
  column: 7
94
96
  }
95
97
  ],
96
- options: [{
97
- indent: " ",
98
- maxLength: 10
99
- }],
98
+ options: [
99
+ {
100
+ indent: " ",
101
+ maxLength: 10
102
+ }
103
+ ],
100
104
  output: `
101
105
 
102
106
  import { a, b as c, d } from 'module'
@@ -12,7 +12,7 @@ require("./pretty-imports/ImportDeclaration").module(valid, invalid)
12
12
  new RuleTester().run(
13
13
  "pretty-imports",
14
14
  require("../rules/pretty-imports"),
15
- {
15
+ {
16
16
  valid,
17
17
  invalid
18
18
  }
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @param {keyof import("estree").ExpressionMap} type
3
- * @param {string} value
2
+ * @param {keyof import("estree").ExpressionMap} type
3
+ * @param {string} value
4
4
  * @returns {import("eslint").RuleTester.InvalidTestCase}
5
5
  */
6
6
  const test_case = (type, value) => ({
@@ -53,7 +53,7 @@ const test_case = (type, value) => ({
53
53
  })
54
54
 
55
55
  /**
56
- * @param {import("eslint").RuleTester.ValidTestCase[]} valid
56
+ * @param {import("eslint").RuleTester.ValidTestCase[]} valid
57
57
  * @param {import("eslint").RuleTester.InvalidTestCase[]} invalid
58
58
  */
59
59
  exports.module = (valid, invalid) => {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @param {import("eslint").RuleTester.ValidTestCase[]} valid
2
+ * @param {import("eslint").RuleTester.ValidTestCase[]} valid
3
3
  * @param {import("eslint").RuleTester.InvalidTestCase[]} invalid
4
4
  */
5
5
  exports.module = (valid, invalid) => {
@@ -45,34 +45,42 @@ exports.module = (valid, invalid) => {
45
45
  invalid.push(
46
46
  {
47
47
  code: "var v = /**@type {A}*/(a)/**/",
48
- errors: [{
49
- column: 8,
50
- line: 1
51
- }],
48
+ errors: [
49
+ {
50
+ column: 8,
51
+ line: 1
52
+ }
53
+ ],
52
54
  output: "var v = /** @type {A} */(a)/**/"
53
55
  },
54
56
  {
55
57
  code: "var v = /** @type {A} */( /** @type {B} */(/** @type {C} */((a) /* block... */))) // line...",
56
- errors: [{
57
- column: 8,
58
- line: 1
59
- }],
58
+ errors: [
59
+ {
60
+ column: 8,
61
+ line: 1
62
+ }
63
+ ],
60
64
  output: "var v = /** @type {A} */(/** @type {B} */(/** @type {C} */((a))/**/)/**/)/**/ /* block... */ // line..."
61
65
  },
62
66
  {
63
67
  code: "var v = { b: /** @type {A} */(a) }",
64
- errors: [{
65
- column: 13,
66
- line: 1
67
- }],
68
+ errors: [
69
+ {
70
+ column: 13,
71
+ line: 1
72
+ }
73
+ ],
68
74
  output: "var v = { b: /** @type {A} */(a)/**/ }"
69
75
  },
70
76
  {
71
77
  code: "var v = { b: /** @type {A} */(a) }",
72
- errors: [{
73
- column: 13,
74
- line: 1
75
- }],
78
+ errors: [
79
+ {
80
+ column: 13,
81
+ line: 1
82
+ }
83
+ ],
76
84
  output: "var v = { b: /** @type {A} */(a)/**/ }"
77
85
  },
78
86
  {
@@ -12,7 +12,7 @@ require("./pretty-jsdoc-casting/nested_casting").module(valid, invalid)
12
12
  new RuleTester().run(
13
13
  "pretty-jsdoc-casting",
14
14
  require("../rules/pretty-jsdoc-casting"),
15
- {
15
+ {
16
16
  valid,
17
17
  invalid
18
18
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @param {import("eslint").RuleTester.ValidTestCase[]} valid
2
+ * @param {import("eslint").RuleTester.ValidTestCase[]} valid
3
3
  * @param {import("eslint").RuleTester.InvalidTestCase[]} invalid
4
4
  */
5
5
  exports.module = (valid, invalid) => {
@@ -14,32 +14,38 @@ exports.module = (valid, invalid) => {
14
14
  { code: "camelCase = 'Hello'" },
15
15
  { code: "var snake_case = camelCase" },
16
16
  { code: "var PascalCase = 'Hello'" },
17
- { code: "var P1ascal2Case345 = 'Hello'" },
17
+ { code: "var P1ascal2Case345 = 'Hello'" }
18
18
  )
19
19
  invalid.push(
20
20
  {
21
21
  code: "var camelCase = 'Hello'",
22
- errors: [{
23
- line: 1,
24
- column: 5
25
- }],
22
+ errors: [
23
+ {
24
+ line: 1,
25
+ column: 5
26
+ }
27
+ ],
26
28
  output: "var camel_case = 'Hello'"
27
29
  },
28
30
  {
29
31
  code: "var NO_SNAKE__CASE = 'Hello'",
30
- errors: [{
31
- line: 1,
32
- column: 5
33
- }],
32
+ errors: [
33
+ {
34
+ line: 1,
35
+ column: 5
36
+ }
37
+ ],
34
38
  output: "var NO_SNAKE__CASE = 'Hello'"
35
39
  },
36
40
  {
37
41
  code: "var NO_SNAKE_CASE_ = 'Hello'",
38
- errors: [{
39
- line: 1,
40
- column: 5
41
- }],
42
+ errors: [
43
+ {
44
+ line: 1,
45
+ column: 5
46
+ }
47
+ ],
42
48
  output: "var NO_SNAKE_CASE_ = 'Hello'"
43
- },
49
+ }
44
50
  )
45
51
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @param {import("eslint").RuleTester.ValidTestCase[]} valid
2
+ * @param {import("eslint").RuleTester.ValidTestCase[]} valid
3
3
  * @param {import("eslint").RuleTester.InvalidTestCase[]} invalid
4
4
  */
5
5
  exports.module = (valid, invalid) => {
@@ -36,20 +36,24 @@ exports.module = (valid, invalid) => {
36
36
  // ArrayPattern
37
37
  {
38
38
  code: "var [ camelCase ] = value",
39
- errors: [{
40
- line: 1,
41
- column: 7
42
- }],
39
+ errors: [
40
+ {
41
+ line: 1,
42
+ column: 7
43
+ }
44
+ ],
43
45
  output: "var [ camel_case ] = value",
44
46
  parserOptions: { ecmaVersion: "latest" }
45
47
  },
46
48
  // ArrowFunctionExpression
47
49
  {
48
50
  code: "(camelCase) => {}",
49
- errors: [{
50
- line: 1,
51
- column: 2
52
- }],
51
+ errors: [
52
+ {
53
+ line: 1,
54
+ column: 2
55
+ }
56
+ ],
53
57
  output: "(camel_case) => {}",
54
58
  parserOptions: { ecmaVersion: "latest" }
55
59
  },
@@ -237,10 +241,12 @@ exports.module = (valid, invalid) => {
237
241
  // ClassDeclaration
238
242
  {
239
243
  code: "class camelCase {}",
240
- errors: [{
241
- line: 1,
242
- column: 7
243
- }],
244
+ errors: [
245
+ {
246
+ line: 1,
247
+ column: 7
248
+ }
249
+ ],
244
250
  output: "class camel_case {}",
245
251
  parserOptions: { ecmaVersion: "latest" }
246
252
  },
@@ -291,10 +297,12 @@ exports.module = (valid, invalid) => {
291
297
  export * as camelCase from "module"
292
298
  var camelCase
293
299
  `,
294
- errors: [{
295
- line: 3,
296
- column: 8
297
- }],
300
+ errors: [
301
+ {
302
+ line: 3,
303
+ column: 8
304
+ }
305
+ ],
298
306
  output: `
299
307
  export * as camelCase from "module"
300
308
  var camel_case
@@ -310,10 +318,12 @@ exports.module = (valid, invalid) => {
310
318
  export default camelCase
311
319
  var camelCase
312
320
  `,
313
- errors: [{
314
- line: 3,
315
- column: 8
316
- }],
321
+ errors: [
322
+ {
323
+ line: 3,
324
+ column: 8
325
+ }
326
+ ],
317
327
  options: [{ fixSameNames: false }],
318
328
  output: `
319
329
  export default camelCase
@@ -337,7 +347,7 @@ exports.module = (valid, invalid) => {
337
347
  {
338
348
  line: 3,
339
349
  column: 8
340
- },
350
+ }
341
351
  ],
342
352
  output: `
343
353
  export default camel_case
@@ -362,7 +372,7 @@ exports.module = (valid, invalid) => {
362
372
  {
363
373
  line: 3,
364
374
  column: 19
365
- },
375
+ }
366
376
  ],
367
377
  output: `
368
378
  export { default as camelCase, camelCase2 } from 'module'
@@ -549,10 +559,12 @@ exports.module = (valid, invalid) => {
549
559
  // ImportDefaultSpecifier
550
560
  {
551
561
  code: "import camelCase from 'module'",
552
- errors: [{
553
- line: 1,
554
- column: 8
555
- }],
562
+ errors: [
563
+ {
564
+ line: 1,
565
+ column: 8
566
+ }
567
+ ],
556
568
  output: "import camel_case from 'module'",
557
569
  parserOptions: {
558
570
  ecmaVersion: "latest",
@@ -562,10 +574,12 @@ exports.module = (valid, invalid) => {
562
574
  // ImportNamespaceSpecifier
563
575
  {
564
576
  code: "import * as camelCase from 'module'",
565
- errors: [{
566
- line: 1,
567
- column: 13
568
- }],
577
+ errors: [
578
+ {
579
+ line: 1,
580
+ column: 13
581
+ }
582
+ ],
569
583
  output: "import * as camel_case from 'module'",
570
584
  parserOptions: {
571
585
  ecmaVersion: "latest",
@@ -696,10 +710,12 @@ exports.module = (valid, invalid) => {
696
710
  class ObjectB { camelCase() {} }
697
711
  var camelCase
698
712
  `,
699
- errors: [{
700
- line: 3,
701
- column: 8
702
- }],
713
+ errors: [
714
+ {
715
+ line: 3,
716
+ column: 8
717
+ }
718
+ ],
703
719
  output: `
704
720
  class ObjectB { camelCase() {} }
705
721
  var camel_case
@@ -721,7 +737,7 @@ exports.module = (valid, invalid) => {
721
737
  },
722
738
  {
723
739
  line: 4,
724
- column:8
740
+ column: 8
725
741
  },
726
742
  {
727
743
  line: 5,
@@ -751,7 +767,7 @@ exports.module = (valid, invalid) => {
751
767
  },
752
768
  {
753
769
  line: 4,
754
- column:8
770
+ column: 8
755
771
  },
756
772
  {
757
773
  line: 5,
@@ -930,7 +946,7 @@ exports.module = (valid, invalid) => {
930
946
  },
931
947
  {
932
948
  line: 4,
933
- column:8
949
+ column: 8
934
950
  },
935
951
  {
936
952
  line: 5,
@@ -959,7 +975,7 @@ exports.module = (valid, invalid) => {
959
975
  },
960
976
  {
961
977
  line: 4,
962
- column:8
978
+ column: 8
963
979
  },
964
980
  {
965
981
  line: 5,
@@ -988,7 +1004,7 @@ exports.module = (valid, invalid) => {
988
1004
  },
989
1005
  {
990
1006
  line: 4,
991
- column:8
1007
+ column: 8
992
1008
  },
993
1009
  {
994
1010
  line: 5,
@@ -1222,6 +1238,6 @@ exports.module = (valid, invalid) => {
1222
1238
  function* func_c() { yield pending_a }
1223
1239
  `,
1224
1240
  parserOptions: { ecmaVersion: "latest" }
1225
- },
1241
+ }
1226
1242
  )
1227
1243
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @param {import("eslint").RuleTester.ValidTestCase[]} valid
2
+ * @param {import("eslint").RuleTester.ValidTestCase[]} valid
3
3
  * @param {import("eslint").RuleTester.InvalidTestCase[]} invalid
4
4
  */
5
5
  exports.module = (valid, invalid) => {
@@ -11,40 +11,48 @@ exports.module = (valid, invalid) => {
11
11
  { code: "var $$ = 'Hello'" },
12
12
  { code: "var $snake_case$ = 'Hello'" },
13
13
  { code: "var __snake_case$$ = 'Hello'" },
14
- { code: "var $$snake_case$$ = 'Hello'" },
14
+ { code: "var $$snake_case$$ = 'Hello'" }
15
15
  )
16
16
  invalid.push(
17
17
  {
18
18
  code: "var __camelCase$$ = 'Hello'",
19
- errors: [{
20
- line: 1,
21
- column: 5
22
- }],
19
+ errors: [
20
+ {
21
+ line: 1,
22
+ column: 5
23
+ }
24
+ ],
23
25
  output: "var __camel_case$$ = 'Hello'"
24
26
  },
25
27
  {
26
28
  code: "var ___ = 'Hello'",
27
- errors: [{
28
- line: 1,
29
- column: 5
30
- }],
29
+ errors: [
30
+ {
31
+ line: 1,
32
+ column: 5
33
+ }
34
+ ],
31
35
  output: "var ___ = 'Hello'"
32
36
  },
33
37
  {
34
38
  code: "var $$$ = 'Hello'",
35
- errors: [{
36
- line: 1,
37
- column: 5
38
- }],
39
+ errors: [
40
+ {
41
+ line: 1,
42
+ column: 5
43
+ }
44
+ ],
39
45
  output: "var $$$ = 'Hello'"
40
46
  },
41
47
  {
42
48
  code: "var $snake$case$ = 'Hello'",
43
- errors: [{
44
- line: 1,
45
- column: 5
46
- }],
49
+ errors: [
50
+ {
51
+ line: 1,
52
+ column: 5
53
+ }
54
+ ],
47
55
  output: "var $snake$case$ = 'Hello'"
48
- },
56
+ }
49
57
  )
50
58
  }
@@ -13,7 +13,7 @@ require("./svelte-naming-convention/snake_case_with_symbols").module(valid, inva
13
13
  new RuleTester().run(
14
14
  "svelte-naming-convention",
15
15
  require("../rules/svelte-naming-convention"),
16
- {
16
+ {
17
17
  valid,
18
18
  invalid
19
19
  }