@saasmakers/eslint 0.1.43 → 0.1.45
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/dist/eslint.config.cjs +0 -1
- package/dist/eslint.config.mjs +0 -1
- package/dist/index.cjs +22 -101
- package/dist/index.d.cts +0 -1
- package/dist/index.d.mts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.mjs +22 -101
- package/package.json +1 -1
package/dist/eslint.config.cjs
CHANGED
|
@@ -22627,7 +22627,6 @@ const config = [
|
|
|
22627
22627
|
"saasmakers/vue-script-format-emits": "error",
|
|
22628
22628
|
"saasmakers/vue-script-order": "error",
|
|
22629
22629
|
"saasmakers/vue-template-format-props": "error",
|
|
22630
|
-
"saasmakers/vue-template-remove-comments": "error",
|
|
22631
22630
|
"saasmakers/vue-template-remove-true-attributes": "error"
|
|
22632
22631
|
}
|
|
22633
22632
|
},
|
package/dist/eslint.config.mjs
CHANGED
|
@@ -22592,7 +22592,6 @@ const config = [
|
|
|
22592
22592
|
"saasmakers/vue-script-format-emits": "error",
|
|
22593
22593
|
"saasmakers/vue-script-order": "error",
|
|
22594
22594
|
"saasmakers/vue-template-format-props": "error",
|
|
22595
|
-
"saasmakers/vue-template-remove-comments": "error",
|
|
22596
22595
|
"saasmakers/vue-template-remove-true-attributes": "error"
|
|
22597
22596
|
}
|
|
22598
22597
|
},
|
package/dist/index.cjs
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const utils = require('@typescript-eslint/utils');
|
|
6
6
|
|
|
7
|
-
const rule$
|
|
7
|
+
const rule$b = {
|
|
8
8
|
meta: {
|
|
9
9
|
docs: {
|
|
10
10
|
category: "Stylistic Issues",
|
|
@@ -67,7 +67,7 @@ const rule$c = {
|
|
|
67
67
|
}
|
|
68
68
|
};
|
|
69
69
|
|
|
70
|
-
const rule$
|
|
70
|
+
const rule$a = {
|
|
71
71
|
meta: {
|
|
72
72
|
docs: {
|
|
73
73
|
category: "Stylistic Issues",
|
|
@@ -184,7 +184,7 @@ function getTestPriority(testName) {
|
|
|
184
184
|
return 1;
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
|
-
const rule$
|
|
187
|
+
const rule$9 = {
|
|
188
188
|
meta: {
|
|
189
189
|
docs: {
|
|
190
190
|
category: "Best Practices",
|
|
@@ -337,7 +337,7 @@ function getAllKeys$1(object, prefix = "") {
|
|
|
337
337
|
}
|
|
338
338
|
return keys;
|
|
339
339
|
}
|
|
340
|
-
const rule$
|
|
340
|
+
const rule$8 = {
|
|
341
341
|
meta: {
|
|
342
342
|
docs: {
|
|
343
343
|
category: "Possible Errors",
|
|
@@ -401,7 +401,7 @@ const rule$9 = {
|
|
|
401
401
|
}
|
|
402
402
|
};
|
|
403
403
|
|
|
404
|
-
const rule$
|
|
404
|
+
const rule$7 = {
|
|
405
405
|
meta: {
|
|
406
406
|
docs: {
|
|
407
407
|
category: "Best Practices",
|
|
@@ -487,7 +487,7 @@ function sortObjectKeys(object) {
|
|
|
487
487
|
}
|
|
488
488
|
return object;
|
|
489
489
|
}
|
|
490
|
-
const rule$
|
|
490
|
+
const rule$6 = {
|
|
491
491
|
meta: {
|
|
492
492
|
docs: {
|
|
493
493
|
category: "Best Practices",
|
|
@@ -569,7 +569,7 @@ function getAllKeys(object, prefix = "") {
|
|
|
569
569
|
}
|
|
570
570
|
return keys;
|
|
571
571
|
}
|
|
572
|
-
const rule$
|
|
572
|
+
const rule$5 = {
|
|
573
573
|
meta: {
|
|
574
574
|
docs: {
|
|
575
575
|
category: "Best Practices",
|
|
@@ -642,7 +642,7 @@ const rule$6 = {
|
|
|
642
642
|
}
|
|
643
643
|
};
|
|
644
644
|
|
|
645
|
-
const rule$
|
|
645
|
+
const rule$4 = {
|
|
646
646
|
defaultOptions: [],
|
|
647
647
|
meta: {
|
|
648
648
|
docs: { description: "Enforce multiline style for Vue computed properties" },
|
|
@@ -681,7 +681,7 @@ const rule$5 = {
|
|
|
681
681
|
}
|
|
682
682
|
};
|
|
683
683
|
|
|
684
|
-
const rule$
|
|
684
|
+
const rule$3 = {
|
|
685
685
|
meta: {
|
|
686
686
|
docs: {
|
|
687
687
|
category: "Best Practices",
|
|
@@ -731,7 +731,7 @@ ${typedEvents}
|
|
|
731
731
|
}
|
|
732
732
|
};
|
|
733
733
|
|
|
734
|
-
const rule$
|
|
734
|
+
const rule$2 = {
|
|
735
735
|
meta: {
|
|
736
736
|
docs: {
|
|
737
737
|
category: "Best Practices",
|
|
@@ -756,7 +756,7 @@ const rule$3 = {
|
|
|
756
756
|
}
|
|
757
757
|
};
|
|
758
758
|
|
|
759
|
-
const rule$
|
|
759
|
+
const rule$1 = {
|
|
760
760
|
meta: {
|
|
761
761
|
docs: {
|
|
762
762
|
category: "Best Practices",
|
|
@@ -811,84 +811,6 @@ const rule$2 = {
|
|
|
811
811
|
}
|
|
812
812
|
};
|
|
813
813
|
|
|
814
|
-
const rule$1 = {
|
|
815
|
-
meta: {
|
|
816
|
-
docs: {
|
|
817
|
-
category: "Best Practices",
|
|
818
|
-
description: "Remove comments inside Vue template tags",
|
|
819
|
-
recommended: true
|
|
820
|
-
},
|
|
821
|
-
fixable: "code",
|
|
822
|
-
messages: { removeComment: "Comments should be removed from template tags" },
|
|
823
|
-
schema: [],
|
|
824
|
-
type: "problem"
|
|
825
|
-
},
|
|
826
|
-
create(context) {
|
|
827
|
-
if (!context.filename.endsWith(".vue")) {
|
|
828
|
-
return {};
|
|
829
|
-
}
|
|
830
|
-
return {
|
|
831
|
-
Program() {
|
|
832
|
-
const sourceCode = context.sourceCode;
|
|
833
|
-
const source = sourceCode.getText();
|
|
834
|
-
const templateRegex = /<template>([\s\S]*)<\/template>/i;
|
|
835
|
-
const templateMatch = templateRegex.exec(source);
|
|
836
|
-
if (!templateMatch) {
|
|
837
|
-
return;
|
|
838
|
-
}
|
|
839
|
-
const templateContent = templateMatch[1];
|
|
840
|
-
const templateStartIndex = templateMatch.index + 10;
|
|
841
|
-
const htmlCommentRegex = /<!--[\s\S]*?-->/g;
|
|
842
|
-
let htmlCommentMatch = htmlCommentRegex.exec(templateContent);
|
|
843
|
-
while (htmlCommentMatch !== null) {
|
|
844
|
-
const fullMatch = htmlCommentMatch[0];
|
|
845
|
-
const matchIndex = templateStartIndex + htmlCommentMatch.index;
|
|
846
|
-
context.report({
|
|
847
|
-
fix: (fixer) => {
|
|
848
|
-
return fixer.removeRange([
|
|
849
|
-
matchIndex,
|
|
850
|
-
matchIndex + fullMatch.length
|
|
851
|
-
]);
|
|
852
|
-
},
|
|
853
|
-
loc: {
|
|
854
|
-
end: sourceCode.getLocFromIndex(matchIndex + fullMatch.length),
|
|
855
|
-
start: sourceCode.getLocFromIndex(matchIndex)
|
|
856
|
-
},
|
|
857
|
-
messageId: "removeComment"
|
|
858
|
-
});
|
|
859
|
-
htmlCommentMatch = htmlCommentRegex.exec(templateContent);
|
|
860
|
-
}
|
|
861
|
-
const jsCommentRegex = /(?:^|\s)\/\/[^\n]*/g;
|
|
862
|
-
let jsCommentMatch = jsCommentRegex.exec(templateContent);
|
|
863
|
-
while (jsCommentMatch !== null) {
|
|
864
|
-
const fullMatch = jsCommentMatch[0];
|
|
865
|
-
const matchIndex = templateStartIndex + jsCommentMatch.index;
|
|
866
|
-
const lineBeforeMatch = templateContent.slice(0, Math.max(0, jsCommentMatch.index)).split("\n").pop() ?? "";
|
|
867
|
-
const isInAttribute = lineBeforeMatch.includes('="') && !lineBeforeMatch.includes('"');
|
|
868
|
-
if (isInAttribute) {
|
|
869
|
-
jsCommentMatch = jsCommentRegex.exec(templateContent);
|
|
870
|
-
continue;
|
|
871
|
-
}
|
|
872
|
-
context.report({
|
|
873
|
-
fix: (fixer) => {
|
|
874
|
-
return fixer.removeRange([
|
|
875
|
-
matchIndex,
|
|
876
|
-
matchIndex + fullMatch.length
|
|
877
|
-
]);
|
|
878
|
-
},
|
|
879
|
-
loc: {
|
|
880
|
-
end: sourceCode.getLocFromIndex(matchIndex + fullMatch.length),
|
|
881
|
-
start: sourceCode.getLocFromIndex(matchIndex)
|
|
882
|
-
},
|
|
883
|
-
messageId: "removeComment"
|
|
884
|
-
});
|
|
885
|
-
jsCommentMatch = jsCommentRegex.exec(templateContent);
|
|
886
|
-
}
|
|
887
|
-
}
|
|
888
|
-
};
|
|
889
|
-
}
|
|
890
|
-
};
|
|
891
|
-
|
|
892
814
|
const rule = {
|
|
893
815
|
meta: {
|
|
894
816
|
docs: {
|
|
@@ -949,18 +871,17 @@ const rule = {
|
|
|
949
871
|
|
|
950
872
|
const saasmakers = {
|
|
951
873
|
rules: {
|
|
952
|
-
"ts-multiline-ternary": rule$
|
|
953
|
-
"ts-multiline-union": rule$
|
|
954
|
-
"ts-sort-tests": rule$
|
|
955
|
-
"vue-i18n-consistent-locales": rule$
|
|
956
|
-
"vue-i18n-consistent-t": rule$
|
|
957
|
-
"vue-i18n-sort-keys": rule$
|
|
958
|
-
"vue-i18n-unused-strings": rule$
|
|
959
|
-
"vue-script-format-computed": rule$
|
|
960
|
-
"vue-script-format-emits": rule$
|
|
961
|
-
"vue-script-order": rule$
|
|
962
|
-
"vue-template-format-props": rule$
|
|
963
|
-
"vue-template-remove-comments": rule$1,
|
|
874
|
+
"ts-multiline-ternary": rule$b,
|
|
875
|
+
"ts-multiline-union": rule$a,
|
|
876
|
+
"ts-sort-tests": rule$9,
|
|
877
|
+
"vue-i18n-consistent-locales": rule$8,
|
|
878
|
+
"vue-i18n-consistent-t": rule$7,
|
|
879
|
+
"vue-i18n-sort-keys": rule$6,
|
|
880
|
+
"vue-i18n-unused-strings": rule$5,
|
|
881
|
+
"vue-script-format-computed": rule$4,
|
|
882
|
+
"vue-script-format-emits": rule$3,
|
|
883
|
+
"vue-script-order": rule$2,
|
|
884
|
+
"vue-template-format-props": rule$1,
|
|
964
885
|
"vue-template-remove-true-attributes": rule
|
|
965
886
|
}
|
|
966
887
|
};
|
package/dist/index.d.cts
CHANGED
|
@@ -14,7 +14,6 @@ declare const _default: {
|
|
|
14
14
|
'vue-script-format-emits': eslint.Rule.RuleModule;
|
|
15
15
|
'vue-script-order': eslint.Rule.RuleModule;
|
|
16
16
|
'vue-template-format-props': eslint.Rule.RuleModule;
|
|
17
|
-
'vue-template-remove-comments': eslint.Rule.RuleModule;
|
|
18
17
|
'vue-template-remove-true-attributes': eslint.Rule.RuleModule;
|
|
19
18
|
};
|
|
20
19
|
};
|
package/dist/index.d.mts
CHANGED
|
@@ -14,7 +14,6 @@ declare const _default: {
|
|
|
14
14
|
'vue-script-format-emits': eslint.Rule.RuleModule;
|
|
15
15
|
'vue-script-order': eslint.Rule.RuleModule;
|
|
16
16
|
'vue-template-format-props': eslint.Rule.RuleModule;
|
|
17
|
-
'vue-template-remove-comments': eslint.Rule.RuleModule;
|
|
18
17
|
'vue-template-remove-true-attributes': eslint.Rule.RuleModule;
|
|
19
18
|
};
|
|
20
19
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -14,7 +14,6 @@ declare const _default: {
|
|
|
14
14
|
'vue-script-format-emits': eslint.Rule.RuleModule;
|
|
15
15
|
'vue-script-order': eslint.Rule.RuleModule;
|
|
16
16
|
'vue-template-format-props': eslint.Rule.RuleModule;
|
|
17
|
-
'vue-template-remove-comments': eslint.Rule.RuleModule;
|
|
18
17
|
'vue-template-remove-true-attributes': eslint.Rule.RuleModule;
|
|
19
18
|
};
|
|
20
19
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
|
|
2
2
|
|
|
3
|
-
const rule$
|
|
3
|
+
const rule$b = {
|
|
4
4
|
meta: {
|
|
5
5
|
docs: {
|
|
6
6
|
category: "Stylistic Issues",
|
|
@@ -63,7 +63,7 @@ const rule$c = {
|
|
|
63
63
|
}
|
|
64
64
|
};
|
|
65
65
|
|
|
66
|
-
const rule$
|
|
66
|
+
const rule$a = {
|
|
67
67
|
meta: {
|
|
68
68
|
docs: {
|
|
69
69
|
category: "Stylistic Issues",
|
|
@@ -180,7 +180,7 @@ function getTestPriority(testName) {
|
|
|
180
180
|
return 1;
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
|
-
const rule$
|
|
183
|
+
const rule$9 = {
|
|
184
184
|
meta: {
|
|
185
185
|
docs: {
|
|
186
186
|
category: "Best Practices",
|
|
@@ -333,7 +333,7 @@ function getAllKeys$1(object, prefix = "") {
|
|
|
333
333
|
}
|
|
334
334
|
return keys;
|
|
335
335
|
}
|
|
336
|
-
const rule$
|
|
336
|
+
const rule$8 = {
|
|
337
337
|
meta: {
|
|
338
338
|
docs: {
|
|
339
339
|
category: "Possible Errors",
|
|
@@ -397,7 +397,7 @@ const rule$9 = {
|
|
|
397
397
|
}
|
|
398
398
|
};
|
|
399
399
|
|
|
400
|
-
const rule$
|
|
400
|
+
const rule$7 = {
|
|
401
401
|
meta: {
|
|
402
402
|
docs: {
|
|
403
403
|
category: "Best Practices",
|
|
@@ -483,7 +483,7 @@ function sortObjectKeys(object) {
|
|
|
483
483
|
}
|
|
484
484
|
return object;
|
|
485
485
|
}
|
|
486
|
-
const rule$
|
|
486
|
+
const rule$6 = {
|
|
487
487
|
meta: {
|
|
488
488
|
docs: {
|
|
489
489
|
category: "Best Practices",
|
|
@@ -565,7 +565,7 @@ function getAllKeys(object, prefix = "") {
|
|
|
565
565
|
}
|
|
566
566
|
return keys;
|
|
567
567
|
}
|
|
568
|
-
const rule$
|
|
568
|
+
const rule$5 = {
|
|
569
569
|
meta: {
|
|
570
570
|
docs: {
|
|
571
571
|
category: "Best Practices",
|
|
@@ -638,7 +638,7 @@ const rule$6 = {
|
|
|
638
638
|
}
|
|
639
639
|
};
|
|
640
640
|
|
|
641
|
-
const rule$
|
|
641
|
+
const rule$4 = {
|
|
642
642
|
defaultOptions: [],
|
|
643
643
|
meta: {
|
|
644
644
|
docs: { description: "Enforce multiline style for Vue computed properties" },
|
|
@@ -677,7 +677,7 @@ const rule$5 = {
|
|
|
677
677
|
}
|
|
678
678
|
};
|
|
679
679
|
|
|
680
|
-
const rule$
|
|
680
|
+
const rule$3 = {
|
|
681
681
|
meta: {
|
|
682
682
|
docs: {
|
|
683
683
|
category: "Best Practices",
|
|
@@ -727,7 +727,7 @@ ${typedEvents}
|
|
|
727
727
|
}
|
|
728
728
|
};
|
|
729
729
|
|
|
730
|
-
const rule$
|
|
730
|
+
const rule$2 = {
|
|
731
731
|
meta: {
|
|
732
732
|
docs: {
|
|
733
733
|
category: "Best Practices",
|
|
@@ -752,7 +752,7 @@ const rule$3 = {
|
|
|
752
752
|
}
|
|
753
753
|
};
|
|
754
754
|
|
|
755
|
-
const rule$
|
|
755
|
+
const rule$1 = {
|
|
756
756
|
meta: {
|
|
757
757
|
docs: {
|
|
758
758
|
category: "Best Practices",
|
|
@@ -807,84 +807,6 @@ const rule$2 = {
|
|
|
807
807
|
}
|
|
808
808
|
};
|
|
809
809
|
|
|
810
|
-
const rule$1 = {
|
|
811
|
-
meta: {
|
|
812
|
-
docs: {
|
|
813
|
-
category: "Best Practices",
|
|
814
|
-
description: "Remove comments inside Vue template tags",
|
|
815
|
-
recommended: true
|
|
816
|
-
},
|
|
817
|
-
fixable: "code",
|
|
818
|
-
messages: { removeComment: "Comments should be removed from template tags" },
|
|
819
|
-
schema: [],
|
|
820
|
-
type: "problem"
|
|
821
|
-
},
|
|
822
|
-
create(context) {
|
|
823
|
-
if (!context.filename.endsWith(".vue")) {
|
|
824
|
-
return {};
|
|
825
|
-
}
|
|
826
|
-
return {
|
|
827
|
-
Program() {
|
|
828
|
-
const sourceCode = context.sourceCode;
|
|
829
|
-
const source = sourceCode.getText();
|
|
830
|
-
const templateRegex = /<template>([\s\S]*)<\/template>/i;
|
|
831
|
-
const templateMatch = templateRegex.exec(source);
|
|
832
|
-
if (!templateMatch) {
|
|
833
|
-
return;
|
|
834
|
-
}
|
|
835
|
-
const templateContent = templateMatch[1];
|
|
836
|
-
const templateStartIndex = templateMatch.index + 10;
|
|
837
|
-
const htmlCommentRegex = /<!--[\s\S]*?-->/g;
|
|
838
|
-
let htmlCommentMatch = htmlCommentRegex.exec(templateContent);
|
|
839
|
-
while (htmlCommentMatch !== null) {
|
|
840
|
-
const fullMatch = htmlCommentMatch[0];
|
|
841
|
-
const matchIndex = templateStartIndex + htmlCommentMatch.index;
|
|
842
|
-
context.report({
|
|
843
|
-
fix: (fixer) => {
|
|
844
|
-
return fixer.removeRange([
|
|
845
|
-
matchIndex,
|
|
846
|
-
matchIndex + fullMatch.length
|
|
847
|
-
]);
|
|
848
|
-
},
|
|
849
|
-
loc: {
|
|
850
|
-
end: sourceCode.getLocFromIndex(matchIndex + fullMatch.length),
|
|
851
|
-
start: sourceCode.getLocFromIndex(matchIndex)
|
|
852
|
-
},
|
|
853
|
-
messageId: "removeComment"
|
|
854
|
-
});
|
|
855
|
-
htmlCommentMatch = htmlCommentRegex.exec(templateContent);
|
|
856
|
-
}
|
|
857
|
-
const jsCommentRegex = /(?:^|\s)\/\/[^\n]*/g;
|
|
858
|
-
let jsCommentMatch = jsCommentRegex.exec(templateContent);
|
|
859
|
-
while (jsCommentMatch !== null) {
|
|
860
|
-
const fullMatch = jsCommentMatch[0];
|
|
861
|
-
const matchIndex = templateStartIndex + jsCommentMatch.index;
|
|
862
|
-
const lineBeforeMatch = templateContent.slice(0, Math.max(0, jsCommentMatch.index)).split("\n").pop() ?? "";
|
|
863
|
-
const isInAttribute = lineBeforeMatch.includes('="') && !lineBeforeMatch.includes('"');
|
|
864
|
-
if (isInAttribute) {
|
|
865
|
-
jsCommentMatch = jsCommentRegex.exec(templateContent);
|
|
866
|
-
continue;
|
|
867
|
-
}
|
|
868
|
-
context.report({
|
|
869
|
-
fix: (fixer) => {
|
|
870
|
-
return fixer.removeRange([
|
|
871
|
-
matchIndex,
|
|
872
|
-
matchIndex + fullMatch.length
|
|
873
|
-
]);
|
|
874
|
-
},
|
|
875
|
-
loc: {
|
|
876
|
-
end: sourceCode.getLocFromIndex(matchIndex + fullMatch.length),
|
|
877
|
-
start: sourceCode.getLocFromIndex(matchIndex)
|
|
878
|
-
},
|
|
879
|
-
messageId: "removeComment"
|
|
880
|
-
});
|
|
881
|
-
jsCommentMatch = jsCommentRegex.exec(templateContent);
|
|
882
|
-
}
|
|
883
|
-
}
|
|
884
|
-
};
|
|
885
|
-
}
|
|
886
|
-
};
|
|
887
|
-
|
|
888
810
|
const rule = {
|
|
889
811
|
meta: {
|
|
890
812
|
docs: {
|
|
@@ -945,18 +867,17 @@ const rule = {
|
|
|
945
867
|
|
|
946
868
|
const saasmakers = {
|
|
947
869
|
rules: {
|
|
948
|
-
"ts-multiline-ternary": rule$
|
|
949
|
-
"ts-multiline-union": rule$
|
|
950
|
-
"ts-sort-tests": rule$
|
|
951
|
-
"vue-i18n-consistent-locales": rule$
|
|
952
|
-
"vue-i18n-consistent-t": rule$
|
|
953
|
-
"vue-i18n-sort-keys": rule$
|
|
954
|
-
"vue-i18n-unused-strings": rule$
|
|
955
|
-
"vue-script-format-computed": rule$
|
|
956
|
-
"vue-script-format-emits": rule$
|
|
957
|
-
"vue-script-order": rule$
|
|
958
|
-
"vue-template-format-props": rule$
|
|
959
|
-
"vue-template-remove-comments": rule$1,
|
|
870
|
+
"ts-multiline-ternary": rule$b,
|
|
871
|
+
"ts-multiline-union": rule$a,
|
|
872
|
+
"ts-sort-tests": rule$9,
|
|
873
|
+
"vue-i18n-consistent-locales": rule$8,
|
|
874
|
+
"vue-i18n-consistent-t": rule$7,
|
|
875
|
+
"vue-i18n-sort-keys": rule$6,
|
|
876
|
+
"vue-i18n-unused-strings": rule$5,
|
|
877
|
+
"vue-script-format-computed": rule$4,
|
|
878
|
+
"vue-script-format-emits": rule$3,
|
|
879
|
+
"vue-script-order": rule$2,
|
|
880
|
+
"vue-template-format-props": rule$1,
|
|
960
881
|
"vue-template-remove-true-attributes": rule
|
|
961
882
|
}
|
|
962
883
|
};
|