eslint-plugin-lube 0.4.3 → 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.
- package/index.js +126 -125
- package/package.json +39 -31
- package/rules/pretty-imports.js +15 -15
- package/rules/pretty-jsdoc-casting.js +37 -29
- package/rules/pretty-sequence.js +61 -52
- package/rules/svelte-naming-convention.js +19 -19
- package/test/pretty-imports/ExportNamedDeclaration.js +32 -24
- package/test/pretty-imports/ImportDeclaration.js +32 -24
- package/test/pretty-imports.js +3 -3
- package/test/pretty-jsdoc-casting/case_by_expression.js +73 -25
- package/test/pretty-jsdoc-casting/various_situations.js +31 -11
- package/test/pretty-jsdoc-casting.js +3 -3
- package/test/pretty-sequence/case_by_node_type.js +62 -30
- package/test/pretty-sequence/case_by_option.js +31 -15
- package/test/pretty-sequence/various_situations.js +34 -9
- package/test/pretty-sequence.js +3 -3
- package/test/svelte-naming-convention/basic_snake_case.js +21 -8
- package/test/svelte-naming-convention/case_by_identifier.js +761 -195
- package/test/svelte-naming-convention/snake_case_with_symbols.js +28 -7
- package/test/svelte-naming-convention.js +3 -3
- package/tsconfig.json +10 -2
- package/types/index.d.ts +15 -0
- package/types/index.d.ts.map +1 -0
- package/types/rules/pretty-imports.d.ts +3 -0
- package/types/rules/pretty-imports.d.ts.map +1 -0
- package/types/rules/pretty-jsdoc-casting.d.ts +3 -0
- package/types/rules/pretty-jsdoc-casting.d.ts.map +1 -0
- package/types/rules/pretty-sequence.d.ts +3 -0
- package/types/rules/pretty-sequence.d.ts.map +1 -0
- package/types/rules/svelte-naming-convention.d.ts +3 -0
- package/types/rules/svelte-naming-convention.d.ts.map +1 -0
- package/types/test/pretty-imports/ExportNamedDeclaration.d.ts +2 -0
- package/types/test/pretty-imports/ExportNamedDeclaration.d.ts.map +1 -0
- package/types/test/pretty-imports/ImportDeclaration.d.ts +2 -0
- package/types/test/pretty-imports/ImportDeclaration.d.ts.map +1 -0
- package/types/test/pretty-imports.d.ts +2 -0
- package/types/test/pretty-imports.d.ts.map +1 -0
- package/types/test/pretty-jsdoc-casting/case_by_expression.d.ts +2 -0
- package/types/test/pretty-jsdoc-casting/case_by_expression.d.ts.map +1 -0
- package/types/test/pretty-jsdoc-casting/various_situations.d.ts +2 -0
- package/types/test/pretty-jsdoc-casting/various_situations.d.ts.map +1 -0
- package/types/test/pretty-jsdoc-casting.d.ts +2 -0
- package/types/test/pretty-jsdoc-casting.d.ts.map +1 -0
- package/types/test/pretty-sequence/case_by_node_type.d.ts +2 -0
- package/types/test/pretty-sequence/case_by_node_type.d.ts.map +1 -0
- package/types/test/pretty-sequence/case_by_option.d.ts +2 -0
- package/types/test/pretty-sequence/case_by_option.d.ts.map +1 -0
- package/types/test/pretty-sequence/various_situations.d.ts +2 -0
- package/types/test/pretty-sequence/various_situations.d.ts.map +1 -0
- package/types/test/pretty-sequence.d.ts +2 -0
- package/types/test/pretty-sequence.d.ts.map +1 -0
- package/types/test/svelte-naming-convention/basic_snake_case.d.ts +2 -0
- package/types/test/svelte-naming-convention/basic_snake_case.d.ts.map +1 -0
- package/types/test/svelte-naming-convention/case_by_identifier.d.ts +2 -0
- package/types/test/svelte-naming-convention/case_by_identifier.d.ts.map +1 -0
- package/types/test/svelte-naming-convention/snake_case_with_symbols.d.ts +2 -0
- package/types/test/svelte-naming-convention/snake_case_with_symbols.d.ts.map +1 -0
- package/types/test/svelte-naming-convention.d.ts +2 -0
- package/types/test/svelte-naming-convention.d.ts.map +1 -0
|
@@ -10,7 +10,9 @@ exports.module = (valid, invalid) => {
|
|
|
10
10
|
aaaaaaaaaa_aaaaaaaaaa_aaaaaaaaaa
|
|
11
11
|
}
|
|
12
12
|
`,
|
|
13
|
-
|
|
13
|
+
languageOptions: {
|
|
14
|
+
parserOptions: { ecmaVersion: "latest" }
|
|
15
|
+
}
|
|
14
16
|
},
|
|
15
17
|
{
|
|
16
18
|
code: "func(a, /* a */(b)/* b */)"
|
|
@@ -24,11 +26,15 @@ exports.module = (valid, invalid) => {
|
|
|
24
26
|
c
|
|
25
27
|
}
|
|
26
28
|
`,
|
|
27
|
-
|
|
29
|
+
languageOptions: {
|
|
30
|
+
parserOptions: { ecmaVersion: "latest" }
|
|
31
|
+
}
|
|
28
32
|
},
|
|
29
33
|
{
|
|
30
34
|
code: "func(v => f(a, b, c))",
|
|
31
|
-
|
|
35
|
+
languageOptions: {
|
|
36
|
+
parserOptions: { ecmaVersion: "latest" }
|
|
37
|
+
}
|
|
32
38
|
},
|
|
33
39
|
{
|
|
34
40
|
code: `
|
|
@@ -45,7 +51,9 @@ exports.module = (valid, invalid) => {
|
|
|
45
51
|
aaaaaaaaaa_bbbbbbbbbb_cccccccccc
|
|
46
52
|
)
|
|
47
53
|
`,
|
|
48
|
-
|
|
54
|
+
languageOptions: {
|
|
55
|
+
parserOptions: { ecmaVersion: "latest" }
|
|
56
|
+
}
|
|
49
57
|
},
|
|
50
58
|
{
|
|
51
59
|
code: `
|
|
@@ -53,9 +61,11 @@ exports.module = (valid, invalid) => {
|
|
|
53
61
|
return [ abc, abc ]
|
|
54
62
|
}
|
|
55
63
|
`,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
64
|
+
languageOptions: {
|
|
65
|
+
parserOptions: {
|
|
66
|
+
ecmaVersion: "latest",
|
|
67
|
+
sourceType: "module"
|
|
68
|
+
}
|
|
59
69
|
}
|
|
60
70
|
}
|
|
61
71
|
)
|
|
@@ -75,21 +85,25 @@ exports.module = (valid, invalid) => {
|
|
|
75
85
|
{
|
|
76
86
|
column: 9,
|
|
77
87
|
line: 3,
|
|
88
|
+
messageId: "not_match",
|
|
78
89
|
type: "ArrayExpression"
|
|
79
90
|
},
|
|
80
91
|
{
|
|
81
92
|
column: 9,
|
|
82
93
|
line: 5,
|
|
94
|
+
messageId: "not_match",
|
|
83
95
|
type: "ObjectExpression"
|
|
84
96
|
},
|
|
85
97
|
{
|
|
86
98
|
column: 40,
|
|
87
99
|
line: 6,
|
|
100
|
+
messageId: "not_match",
|
|
88
101
|
type: "ArrayExpression"
|
|
89
102
|
},
|
|
90
103
|
{
|
|
91
104
|
column: 10,
|
|
92
105
|
line: 7,
|
|
106
|
+
messageId: "not_match",
|
|
93
107
|
type: "ObjectExpression"
|
|
94
108
|
}
|
|
95
109
|
],
|
|
@@ -113,7 +127,9 @@ exports.module = (valid, invalid) => {
|
|
|
113
127
|
}
|
|
114
128
|
}
|
|
115
129
|
`,
|
|
116
|
-
|
|
130
|
+
languageOptions: {
|
|
131
|
+
parserOptions: { ecmaVersion: "latest" }
|
|
132
|
+
}
|
|
117
133
|
},
|
|
118
134
|
{
|
|
119
135
|
code: `
|
|
@@ -123,36 +139,43 @@ exports.module = (valid, invalid) => {
|
|
|
123
139
|
{
|
|
124
140
|
column: 17,
|
|
125
141
|
line: 2,
|
|
142
|
+
messageId: "not_match",
|
|
126
143
|
type: "ObjectExpression"
|
|
127
144
|
},
|
|
128
145
|
{
|
|
129
146
|
column: 20,
|
|
130
147
|
line: 2,
|
|
148
|
+
messageId: "not_match",
|
|
131
149
|
type: "ObjectExpression"
|
|
132
150
|
},
|
|
133
151
|
{
|
|
134
152
|
column: 23,
|
|
135
153
|
line: 2,
|
|
154
|
+
messageId: "not_match",
|
|
136
155
|
type: "ObjectExpression"
|
|
137
156
|
},
|
|
138
157
|
{
|
|
139
158
|
column: 26,
|
|
140
159
|
line: 2,
|
|
160
|
+
messageId: "not_match",
|
|
141
161
|
type: "ObjectExpression"
|
|
142
162
|
},
|
|
143
163
|
{
|
|
144
164
|
column: 29,
|
|
145
165
|
line: 2,
|
|
166
|
+
messageId: "not_match",
|
|
146
167
|
type: "ObjectExpression"
|
|
147
168
|
},
|
|
148
169
|
{
|
|
149
170
|
column: 32,
|
|
150
171
|
line: 2,
|
|
172
|
+
messageId: "not_match",
|
|
151
173
|
type: "ObjectExpression"
|
|
152
174
|
},
|
|
153
175
|
{
|
|
154
176
|
column: 35,
|
|
155
177
|
line: 2,
|
|
178
|
+
messageId: "not_match",
|
|
156
179
|
type: "ObjectExpression"
|
|
157
180
|
}
|
|
158
181
|
],
|
|
@@ -173,7 +196,9 @@ exports.module = (valid, invalid) => {
|
|
|
173
196
|
}
|
|
174
197
|
}
|
|
175
198
|
`,
|
|
176
|
-
|
|
199
|
+
languageOptions: {
|
|
200
|
+
parserOptions: { ecmaVersion: "latest" }
|
|
201
|
+
}
|
|
177
202
|
}
|
|
178
203
|
)
|
|
179
204
|
}
|
package/test/pretty-sequence.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict"
|
|
2
|
-
|
|
2
|
+
const { RuleTester } = require("eslint")
|
|
3
3
|
|
|
4
4
|
/** @type {RuleTester.ValidTestCase[]} */
|
|
5
|
-
|
|
5
|
+
const valid = []
|
|
6
6
|
/** @type {RuleTester.InvalidTestCase[]} */
|
|
7
|
-
|
|
7
|
+
const invalid = []
|
|
8
8
|
|
|
9
9
|
require(
|
|
10
10
|
"./pretty-sequence/case_by_node_type"
|
|
@@ -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: [
|
|
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: [
|
|
46
|
-
|
|
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: [
|
|
51
|
-
|
|
58
|
+
errors: [
|
|
59
|
+
{
|
|
60
|
+
column: 5,
|
|
61
|
+
line: 1,
|
|
62
|
+
messageId: "not_match"
|
|
63
|
+
}
|
|
64
|
+
]
|
|
52
65
|
}
|
|
53
66
|
)
|
|
54
67
|
}
|