eslint-plugin-lube 0.5.0 → 0.5.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.
Files changed (52) hide show
  1. package/index.js +9 -8
  2. package/package.json +4 -2
  3. package/rules/svelte-naming-convention.js +4 -4
  4. package/test/pretty-imports/ExportNamedDeclaration.js +12 -12
  5. package/test/pretty-imports/ImportDeclaration.js +12 -12
  6. package/test/pretty-jsdoc-casting/case_by_expression.js +60 -20
  7. package/test/pretty-jsdoc-casting/various_situations.js +29 -13
  8. package/test/pretty-sequence/case_by_node_type.js +56 -36
  9. package/test/pretty-sequence/case_by_option.js +23 -23
  10. package/test/pretty-sequence/various_situations.js +23 -12
  11. package/test/svelte-naming-convention/basic_snake_case.js +21 -8
  12. package/test/svelte-naming-convention/case_by_identifier.js +696 -180
  13. package/test/svelte-naming-convention/snake_case_with_symbols.js +28 -7
  14. package/tsconfig.json +7 -2
  15. package/types/index.d.ts +15 -0
  16. package/types/index.d.ts.map +1 -0
  17. package/types/rules/pretty-imports.d.ts +3 -0
  18. package/types/rules/pretty-imports.d.ts.map +1 -0
  19. package/types/rules/pretty-jsdoc-casting.d.ts +3 -0
  20. package/types/rules/pretty-jsdoc-casting.d.ts.map +1 -0
  21. package/types/rules/pretty-sequence.d.ts +3 -0
  22. package/types/rules/pretty-sequence.d.ts.map +1 -0
  23. package/types/rules/svelte-naming-convention.d.ts +3 -0
  24. package/types/rules/svelte-naming-convention.d.ts.map +1 -0
  25. package/types/test/pretty-imports/ExportNamedDeclaration.d.ts +2 -0
  26. package/types/test/pretty-imports/ExportNamedDeclaration.d.ts.map +1 -0
  27. package/types/test/pretty-imports/ImportDeclaration.d.ts +2 -0
  28. package/types/test/pretty-imports/ImportDeclaration.d.ts.map +1 -0
  29. package/types/test/pretty-imports.d.ts +2 -0
  30. package/types/test/pretty-imports.d.ts.map +1 -0
  31. package/types/test/pretty-jsdoc-casting/case_by_expression.d.ts +2 -0
  32. package/types/test/pretty-jsdoc-casting/case_by_expression.d.ts.map +1 -0
  33. package/types/test/pretty-jsdoc-casting/various_situations.d.ts +2 -0
  34. package/types/test/pretty-jsdoc-casting/various_situations.d.ts.map +1 -0
  35. package/types/test/pretty-jsdoc-casting.d.ts +2 -0
  36. package/types/test/pretty-jsdoc-casting.d.ts.map +1 -0
  37. package/types/test/pretty-sequence/case_by_node_type.d.ts +2 -0
  38. package/types/test/pretty-sequence/case_by_node_type.d.ts.map +1 -0
  39. package/types/test/pretty-sequence/case_by_option.d.ts +2 -0
  40. package/types/test/pretty-sequence/case_by_option.d.ts.map +1 -0
  41. package/types/test/pretty-sequence/various_situations.d.ts +2 -0
  42. package/types/test/pretty-sequence/various_situations.d.ts.map +1 -0
  43. package/types/test/pretty-sequence.d.ts +2 -0
  44. package/types/test/pretty-sequence.d.ts.map +1 -0
  45. package/types/test/svelte-naming-convention/basic_snake_case.d.ts +2 -0
  46. package/types/test/svelte-naming-convention/basic_snake_case.d.ts.map +1 -0
  47. package/types/test/svelte-naming-convention/case_by_identifier.d.ts +2 -0
  48. package/types/test/svelte-naming-convention/case_by_identifier.d.ts.map +1 -0
  49. package/types/test/svelte-naming-convention/snake_case_with_symbols.d.ts +2 -0
  50. package/types/test/svelte-naming-convention/snake_case_with_symbols.d.ts.map +1 -0
  51. package/types/test/svelte-naming-convention.d.ts +2 -0
  52. package/types/test/svelte-naming-convention.d.ts.map +1 -0
@@ -19,8 +19,8 @@ exports.module = (valid, invalid) => {
19
19
  checkSequence: false
20
20
  }
21
21
  ],
22
- languageOptions: {
23
- parserOptions: { ecmaVersion: "latest" }
22
+ languageOptions: {
23
+ parserOptions: { ecmaVersion: "latest" }
24
24
  }
25
25
  },
26
26
  {
@@ -30,8 +30,8 @@ exports.module = (valid, invalid) => {
30
30
  }
31
31
  `,
32
32
  options: [ { indent: " " } ],
33
- languageOptions: {
34
- parserOptions: { ecmaVersion: "latest" }
33
+ languageOptions: {
34
+ parserOptions: { ecmaVersion: "latest" }
35
35
  }
36
36
  },
37
37
  {
@@ -39,8 +39,8 @@ exports.module = (valid, invalid) => {
39
39
  var value = { aaaaaaaaaa_aaaaaaaaaa_aaaaaaaaaa }
40
40
  `,
41
41
  options: [ { maxLength: 40 } ],
42
- languageOptions: {
43
- parserOptions: { ecmaVersion: "latest" }
42
+ languageOptions: {
43
+ parserOptions: { ecmaVersion: "latest" }
44
44
  }
45
45
  }
46
46
  )
@@ -49,7 +49,7 @@ exports.module = (valid, invalid) => {
49
49
  code: `
50
50
  var value = [a,b,c]
51
51
  `,
52
- errors: [ {} ],
52
+ errors: [ { messageId: "not_match" } ],
53
53
  options: [ { arrayBracketSpacing: true } ],
54
54
  output: `
55
55
  var value = [ a, b, c ]
@@ -59,7 +59,7 @@ exports.module = (valid, invalid) => {
59
59
  code: `
60
60
  var value = [a,b,c]
61
61
  `,
62
- errors: [ {} ],
62
+ errors: [ { messageId: "not_match" } ],
63
63
  options: [ { arrayBracketSpacing: false } ],
64
64
  output: `
65
65
  var value = [a, b, c]
@@ -71,26 +71,26 @@ exports.module = (valid, invalid) => {
71
71
  code: `
72
72
  var value = (a,b,c) => {}
73
73
  `,
74
- errors: [ {} ],
74
+ errors: [ { messageId: "not_match" } ],
75
75
  options: [ { funcCallSpacing: true } ],
76
76
  output: `
77
77
  var value = ( a, b, c ) => {}
78
78
  `,
79
- languageOptions: {
80
- parserOptions: { ecmaVersion: "latest" }
79
+ languageOptions: {
80
+ parserOptions: { ecmaVersion: "latest" }
81
81
  }
82
82
  },
83
83
  {
84
84
  code: `
85
85
  var value = (a,b,c) => {}
86
86
  `,
87
- errors: [ {} ],
87
+ errors: [ { messageId: "not_match" } ],
88
88
  options: [ { funcCallSpacing: false } ],
89
89
  output: `
90
90
  var value = (a, b, c) => {}
91
91
  `,
92
- languageOptions: {
93
- parserOptions: { ecmaVersion: "latest" }
92
+ languageOptions: {
93
+ parserOptions: { ecmaVersion: "latest" }
94
94
  }
95
95
  }
96
96
  )
@@ -99,26 +99,26 @@ exports.module = (valid, invalid) => {
99
99
  code: `
100
100
  var value = {a,b,c}
101
101
  `,
102
- errors: [ {} ],
102
+ errors: [ { messageId: "not_match" } ],
103
103
  options: [ { objectCurlySpacing: true } ],
104
104
  output: `
105
105
  var value = { a, b, c }
106
106
  `,
107
- languageOptions: {
108
- parserOptions: { ecmaVersion: "latest" }
107
+ languageOptions: {
108
+ parserOptions: { ecmaVersion: "latest" }
109
109
  }
110
110
  },
111
111
  {
112
112
  code: `
113
113
  var value = {a,b,c}
114
114
  `,
115
- errors: [ {} ],
115
+ errors: [ { messageId: "not_match" } ],
116
116
  options: [ { objectCurlySpacing: false } ],
117
117
  output: `
118
118
  var value = {a, b, c}
119
119
  `,
120
- languageOptions: {
121
- parserOptions: { ecmaVersion: "latest" }
120
+ languageOptions: {
121
+ parserOptions: { ecmaVersion: "latest" }
122
122
  }
123
123
  }
124
124
  )
@@ -127,15 +127,15 @@ exports.module = (valid, invalid) => {
127
127
  code: `
128
128
  var value = \`\${[a,b,c]}\`
129
129
  `,
130
- errors: [ {} ],
130
+ errors: [ { messageId: "not_match" } ],
131
131
  options: [
132
132
  { ignoreTemplateLiteral: false }
133
133
  ],
134
134
  output: `
135
135
  var value = \`\${[ a, b, c ]}\`
136
136
  `,
137
- languageOptions: {
138
- parserOptions: { ecmaVersion: "latest" }
137
+ languageOptions: {
138
+ parserOptions: { ecmaVersion: "latest" }
139
139
  }
140
140
  }
141
141
  )
@@ -10,8 +10,8 @@ exports.module = (valid, invalid) => {
10
10
  aaaaaaaaaa_aaaaaaaaaa_aaaaaaaaaa
11
11
  }
12
12
  `,
13
- languageOptions: {
14
- parserOptions: { ecmaVersion: "latest" }
13
+ languageOptions: {
14
+ parserOptions: { ecmaVersion: "latest" }
15
15
  }
16
16
  },
17
17
  {
@@ -26,14 +26,14 @@ exports.module = (valid, invalid) => {
26
26
  c
27
27
  }
28
28
  `,
29
- languageOptions: {
30
- parserOptions: { ecmaVersion: "latest" }
29
+ languageOptions: {
30
+ parserOptions: { ecmaVersion: "latest" }
31
31
  }
32
32
  },
33
33
  {
34
34
  code: "func(v => f(a, b, c))",
35
- languageOptions: {
36
- parserOptions: { ecmaVersion: "latest" }
35
+ languageOptions: {
36
+ parserOptions: { ecmaVersion: "latest" }
37
37
  }
38
38
  },
39
39
  {
@@ -51,8 +51,8 @@ exports.module = (valid, invalid) => {
51
51
  aaaaaaaaaa_bbbbbbbbbb_cccccccccc
52
52
  )
53
53
  `,
54
- languageOptions: {
55
- parserOptions: { ecmaVersion: "latest" }
54
+ languageOptions: {
55
+ parserOptions: { ecmaVersion: "latest" }
56
56
  }
57
57
  },
58
58
  {
@@ -85,21 +85,25 @@ exports.module = (valid, invalid) => {
85
85
  {
86
86
  column: 9,
87
87
  line: 3,
88
+ messageId: "not_match",
88
89
  type: "ArrayExpression"
89
90
  },
90
91
  {
91
92
  column: 9,
92
93
  line: 5,
94
+ messageId: "not_match",
93
95
  type: "ObjectExpression"
94
96
  },
95
97
  {
96
98
  column: 40,
97
99
  line: 6,
100
+ messageId: "not_match",
98
101
  type: "ArrayExpression"
99
102
  },
100
103
  {
101
104
  column: 10,
102
105
  line: 7,
106
+ messageId: "not_match",
103
107
  type: "ObjectExpression"
104
108
  }
105
109
  ],
@@ -123,8 +127,8 @@ exports.module = (valid, invalid) => {
123
127
  }
124
128
  }
125
129
  `,
126
- languageOptions: {
127
- parserOptions: { ecmaVersion: "latest" }
130
+ languageOptions: {
131
+ parserOptions: { ecmaVersion: "latest" }
128
132
  }
129
133
  },
130
134
  {
@@ -135,36 +139,43 @@ exports.module = (valid, invalid) => {
135
139
  {
136
140
  column: 17,
137
141
  line: 2,
142
+ messageId: "not_match",
138
143
  type: "ObjectExpression"
139
144
  },
140
145
  {
141
146
  column: 20,
142
147
  line: 2,
148
+ messageId: "not_match",
143
149
  type: "ObjectExpression"
144
150
  },
145
151
  {
146
152
  column: 23,
147
153
  line: 2,
154
+ messageId: "not_match",
148
155
  type: "ObjectExpression"
149
156
  },
150
157
  {
151
158
  column: 26,
152
159
  line: 2,
160
+ messageId: "not_match",
153
161
  type: "ObjectExpression"
154
162
  },
155
163
  {
156
164
  column: 29,
157
165
  line: 2,
166
+ messageId: "not_match",
158
167
  type: "ObjectExpression"
159
168
  },
160
169
  {
161
170
  column: 32,
162
171
  line: 2,
172
+ messageId: "not_match",
163
173
  type: "ObjectExpression"
164
174
  },
165
175
  {
166
176
  column: 35,
167
177
  line: 2,
178
+ messageId: "not_match",
168
179
  type: "ObjectExpression"
169
180
  }
170
181
  ],
@@ -185,8 +196,8 @@ exports.module = (valid, invalid) => {
185
196
  }
186
197
  }
187
198
  `,
188
- languageOptions: {
189
- parserOptions: { ecmaVersion: "latest" }
199
+ languageOptions: {
200
+ parserOptions: { ecmaVersion: "latest" }
190
201
  }
191
202
  }
192
203
  )
@@ -11,9 +11,6 @@ exports.module = (valid, invalid) => {
11
11
  {
12
12
  code: "var snake_case_123 = 'Hello'"
13
13
  },
14
- {
15
- code: "var snake_case_123 = 'Hello'"
16
- },
17
14
  {
18
15
  code: "var snake1_2_3case_4 = 'Hello'"
19
16
  },
@@ -37,18 +34,34 @@ exports.module = (valid, invalid) => {
37
34
  invalid.push(
38
35
  {
39
36
  code: "var camelCase = 'Hello'",
40
- errors: [ { line: 1, column: 5 } ],
37
+ errors: [
38
+ {
39
+ column: 5,
40
+ line: 1,
41
+ messageId: "not_match"
42
+ }
43
+ ],
41
44
  output: "var camel_case = 'Hello'"
42
45
  },
43
46
  {
44
47
  code: "var NO_SNAKE__CASE = 'Hello'",
45
- errors: [ { line: 1, column: 5 } ],
46
- output: "var NO_SNAKE__CASE = 'Hello'"
48
+ errors: [
49
+ {
50
+ column: 5,
51
+ line: 1,
52
+ messageId: "not_match"
53
+ }
54
+ ]
47
55
  },
48
56
  {
49
57
  code: "var NO_SNAKE_CASE_ = 'Hello'",
50
- errors: [ { line: 1, column: 5 } ],
51
- output: "var NO_SNAKE_CASE_ = 'Hello'"
58
+ errors: [
59
+ {
60
+ column: 5,
61
+ line: 1,
62
+ messageId: "not_match"
63
+ }
64
+ ]
52
65
  }
53
66
  )
54
67
  }