eslint-plugin-lube 0.1.4 → 0.1.5
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/package.json
CHANGED
|
@@ -265,7 +265,6 @@ module.exports = {
|
|
|
265
265
|
/* MetaProperty */
|
|
266
266
|
// class Object { camelCase() {} }
|
|
267
267
|
if ("MethodDefinition" == type) {
|
|
268
|
-
report(node)
|
|
269
268
|
return
|
|
270
269
|
}
|
|
271
270
|
// new camelCase
|
|
@@ -287,11 +286,6 @@ module.exports = {
|
|
|
287
286
|
}
|
|
288
287
|
// class Object { key = value }
|
|
289
288
|
if ("PropertyDefinition" == type) {
|
|
290
|
-
if (parent.key == node) {
|
|
291
|
-
report(node)
|
|
292
|
-
} else {
|
|
293
|
-
defer(node)
|
|
294
|
-
}
|
|
295
289
|
return
|
|
296
290
|
}
|
|
297
291
|
// var [ ...camelCase ] = value
|
|
@@ -387,24 +381,6 @@ module.exports = {
|
|
|
387
381
|
defer(node)
|
|
388
382
|
return
|
|
389
383
|
}
|
|
390
|
-
},
|
|
391
|
-
/** @param {import("../private").ASTNode} node */
|
|
392
|
-
PrivateIdentifier(node) {
|
|
393
|
-
const name = node.name
|
|
394
|
-
if (allow_regex.test(name)) return
|
|
395
|
-
const parent = node.parent
|
|
396
|
-
const type = parent.type
|
|
397
|
-
// class Object { #camelCase() {} }
|
|
398
|
-
if ("MethodDefinition" == type) {
|
|
399
|
-
report(node)
|
|
400
|
-
return
|
|
401
|
-
}
|
|
402
|
-
// class Object { #camelCase = value }
|
|
403
|
-
if ("PropertyDefinition" == type) {
|
|
404
|
-
report(node)
|
|
405
|
-
return
|
|
406
|
-
}
|
|
407
|
-
// TODO ?
|
|
408
384
|
}
|
|
409
385
|
}
|
|
410
386
|
}
|
|
@@ -786,13 +786,19 @@ exports.module = (valid, invalid) => {
|
|
|
786
786
|
},
|
|
787
787
|
// MethodDefinition
|
|
788
788
|
{
|
|
789
|
-
code:
|
|
789
|
+
code: `
|
|
790
|
+
class ObjectB { camelCase() {} }
|
|
791
|
+
var camelCase
|
|
792
|
+
`,
|
|
790
793
|
errors: [{
|
|
791
794
|
...error,
|
|
792
|
-
line:
|
|
793
|
-
column:
|
|
795
|
+
line: 3,
|
|
796
|
+
column: 8
|
|
794
797
|
}],
|
|
795
|
-
output:
|
|
798
|
+
output: `
|
|
799
|
+
class ObjectB { camelCase() {} }
|
|
800
|
+
var camel_case
|
|
801
|
+
`,
|
|
796
802
|
parserOptions: { ecmaVersion: "latest" }
|
|
797
803
|
},
|
|
798
804
|
// NewExpression
|
|
@@ -867,39 +873,25 @@ exports.module = (valid, invalid) => {
|
|
|
867
873
|
// PropertyDefinition
|
|
868
874
|
{
|
|
869
875
|
code: `
|
|
870
|
-
class
|
|
871
|
-
|
|
872
|
-
var pendingA
|
|
873
|
-
class ObjectC { snake_case = pendingA }
|
|
876
|
+
class ObjectB { camelCase = camelCase2 }
|
|
877
|
+
var camelCase, camelCase2
|
|
874
878
|
`,
|
|
875
879
|
errors: [
|
|
876
|
-
{
|
|
877
|
-
...error,
|
|
878
|
-
line: 2,
|
|
879
|
-
column: 20
|
|
880
|
-
},
|
|
881
880
|
{
|
|
882
881
|
...error,
|
|
883
882
|
line: 3,
|
|
884
|
-
column: 33
|
|
885
|
-
},
|
|
886
|
-
{
|
|
887
|
-
...error,
|
|
888
|
-
line: 4,
|
|
889
883
|
column: 8
|
|
890
884
|
},
|
|
891
885
|
{
|
|
892
886
|
...error,
|
|
893
|
-
line:
|
|
894
|
-
column:
|
|
887
|
+
line: 3,
|
|
888
|
+
column: 19
|
|
895
889
|
}
|
|
896
890
|
],
|
|
897
891
|
options: [{ fixSameNames: true }],
|
|
898
892
|
output: `
|
|
899
|
-
class
|
|
900
|
-
|
|
901
|
-
var pending_a
|
|
902
|
-
class ObjectC { snake_case = pending_a }
|
|
893
|
+
class ObjectB { camelCase = camelCase2 }
|
|
894
|
+
var camel_case, camel_case2
|
|
903
895
|
`,
|
|
904
896
|
parserOptions: { ecmaVersion: "latest" }
|
|
905
897
|
},
|