@so1ve/eslint-plugin 0.46.1 → 0.47.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/dist/index.cjs +18 -63
- package/dist/index.d.ts +0 -1
- package/dist/index.mjs +18 -63
- package/package.json +8 -8
package/dist/index.cjs
CHANGED
|
@@ -19,9 +19,9 @@ const util__namespace = /*#__PURE__*/_interopNamespaceDefault(util);
|
|
|
19
19
|
|
|
20
20
|
const createEslintRule = utils.ESLintUtils.RuleCreator((ruleName) => ruleName);
|
|
21
21
|
|
|
22
|
-
const RULE_NAME$
|
|
22
|
+
const RULE_NAME$8 = "generic-spacing";
|
|
23
23
|
const genericSpacing = createEslintRule({
|
|
24
|
-
name: RULE_NAME$
|
|
24
|
+
name: RULE_NAME$8,
|
|
25
25
|
meta: {
|
|
26
26
|
type: "layout",
|
|
27
27
|
docs: {
|
|
@@ -41,8 +41,7 @@ const genericSpacing = createEslintRule({
|
|
|
41
41
|
return {
|
|
42
42
|
TSTypeParameterDeclaration: (node) => {
|
|
43
43
|
const params = node.params;
|
|
44
|
-
for (
|
|
45
|
-
const param = params[i];
|
|
44
|
+
for (const param of params) {
|
|
46
45
|
const leftToken = sourceCode.getTokenBefore(param);
|
|
47
46
|
const rightToken = sourceCode.getTokenAfter(param);
|
|
48
47
|
const hasSpacingBeforeParam = sourceCode.isSpaceBetween(leftToken, param);
|
|
@@ -209,8 +208,7 @@ const genericSpacing = createEslintRule({
|
|
|
209
208
|
// type T = Generic< any >
|
|
210
209
|
TSTypeParameterInstantiation: (node) => {
|
|
211
210
|
const params = node.params;
|
|
212
|
-
for (
|
|
213
|
-
const param = params[i];
|
|
211
|
+
for (const param of params) {
|
|
214
212
|
const leftToken = sourceCode.getTokenBefore(param);
|
|
215
213
|
const rightToken = sourceCode.getTokenAfter(param);
|
|
216
214
|
const hasSpacingBeforeParam = leftToken.value === "<" ? sourceCode.isSpaceBetween(leftToken, param) : false;
|
|
@@ -291,9 +289,9 @@ const genericSpacing = createEslintRule({
|
|
|
291
289
|
}
|
|
292
290
|
});
|
|
293
291
|
|
|
294
|
-
const RULE_NAME$
|
|
292
|
+
const RULE_NAME$7 = "import-dedupe";
|
|
295
293
|
const importDedupe = createEslintRule({
|
|
296
|
-
name: RULE_NAME$
|
|
294
|
+
name: RULE_NAME$7,
|
|
297
295
|
meta: {
|
|
298
296
|
type: "problem",
|
|
299
297
|
docs: {
|
|
@@ -342,9 +340,9 @@ const importDedupe = createEslintRule({
|
|
|
342
340
|
});
|
|
343
341
|
|
|
344
342
|
const operatorOrAnyBracketOrKeywordRE = /^(\||&|\*|\+|\-|\/|%|<|>|<=|>=|==|!=|===|!==|\[|\(|\{|as|extends|implements|keyof|new|readonly|typeof|unique|unknown)/;
|
|
345
|
-
const RULE_NAME$
|
|
343
|
+
const RULE_NAME$6 = "space-between-generic-and-paren";
|
|
346
344
|
const spaceBetweenGenericAndParen = createEslintRule({
|
|
347
|
-
name: RULE_NAME$
|
|
345
|
+
name: RULE_NAME$6,
|
|
348
346
|
meta: {
|
|
349
347
|
type: "layout",
|
|
350
348
|
docs: {
|
|
@@ -418,9 +416,9 @@ const spaceBetweenGenericAndParen = createEslintRule({
|
|
|
418
416
|
}
|
|
419
417
|
});
|
|
420
418
|
|
|
421
|
-
const RULE_NAME$
|
|
419
|
+
const RULE_NAME$5 = "no-space-before-paren";
|
|
422
420
|
const noSpaceBeforeParen = createEslintRule({
|
|
423
|
-
name: RULE_NAME$
|
|
421
|
+
name: RULE_NAME$5,
|
|
424
422
|
meta: {
|
|
425
423
|
type: "layout",
|
|
426
424
|
docs: {
|
|
@@ -557,9 +555,9 @@ const noSpaceBeforeParen = createEslintRule({
|
|
|
557
555
|
}
|
|
558
556
|
});
|
|
559
557
|
|
|
560
|
-
const RULE_NAME$
|
|
558
|
+
const RULE_NAME$4 = "space-in-empty-block";
|
|
561
559
|
const spaceInEmptyBlock = createEslintRule({
|
|
562
|
-
name: RULE_NAME$
|
|
560
|
+
name: RULE_NAME$4,
|
|
563
561
|
meta: {
|
|
564
562
|
type: "layout",
|
|
565
563
|
docs: {
|
|
@@ -624,9 +622,9 @@ const spaceInEmptyBlock = createEslintRule({
|
|
|
624
622
|
}
|
|
625
623
|
});
|
|
626
624
|
|
|
627
|
-
const RULE_NAME$
|
|
625
|
+
const RULE_NAME$3 = "space-before-function-paren";
|
|
628
626
|
const spaceBeforeFunctionParen = createEslintRule({
|
|
629
|
-
name: RULE_NAME$
|
|
627
|
+
name: RULE_NAME$3,
|
|
630
628
|
meta: {
|
|
631
629
|
type: "layout",
|
|
632
630
|
docs: {
|
|
@@ -731,9 +729,9 @@ const spaceBeforeFunctionParen = createEslintRule({
|
|
|
731
729
|
}
|
|
732
730
|
});
|
|
733
731
|
|
|
734
|
-
const RULE_NAME$
|
|
732
|
+
const RULE_NAME$2 = "semi-spacing";
|
|
735
733
|
const semiSpacing = createEslintRule({
|
|
736
|
-
name: RULE_NAME$
|
|
734
|
+
name: RULE_NAME$2,
|
|
737
735
|
meta: {
|
|
738
736
|
type: "layout",
|
|
739
737
|
docs: {
|
|
@@ -781,9 +779,9 @@ const semiSpacing = createEslintRule({
|
|
|
781
779
|
}
|
|
782
780
|
});
|
|
783
781
|
|
|
784
|
-
const RULE_NAME$
|
|
782
|
+
const RULE_NAME$1 = "no-inline-type-import";
|
|
785
783
|
const noInlineTypeImport = createEslintRule({
|
|
786
|
-
name: RULE_NAME$
|
|
784
|
+
name: RULE_NAME$1,
|
|
787
785
|
meta: {
|
|
788
786
|
type: "layout",
|
|
789
787
|
docs: {
|
|
@@ -830,48 +828,6 @@ import { ${valueSpecifiersText} } from "${node.source.value}";`);
|
|
|
830
828
|
}
|
|
831
829
|
});
|
|
832
830
|
|
|
833
|
-
const RULE_NAME$1 = "no-beginning-newline";
|
|
834
|
-
const noBeginningNewline = createEslintRule({
|
|
835
|
-
name: RULE_NAME$1,
|
|
836
|
-
meta: {
|
|
837
|
-
type: "layout",
|
|
838
|
-
docs: {
|
|
839
|
-
description: "No beginning newline",
|
|
840
|
-
recommended: "error"
|
|
841
|
-
},
|
|
842
|
-
fixable: "whitespace",
|
|
843
|
-
schema: [],
|
|
844
|
-
messages: {
|
|
845
|
-
noBeginningNewline: "No beginning newline"
|
|
846
|
-
}
|
|
847
|
-
},
|
|
848
|
-
defaultOptions: [],
|
|
849
|
-
create: (context) => {
|
|
850
|
-
const text = context.getSourceCode().text;
|
|
851
|
-
return {
|
|
852
|
-
Program: (node) => {
|
|
853
|
-
const newlines = text.match(/([\n]*)/)[1];
|
|
854
|
-
if (newlines.length > 0) {
|
|
855
|
-
context.report({
|
|
856
|
-
node,
|
|
857
|
-
loc: {
|
|
858
|
-
start: {
|
|
859
|
-
line: 0,
|
|
860
|
-
column: 0
|
|
861
|
-
},
|
|
862
|
-
end: node.loc.start
|
|
863
|
-
},
|
|
864
|
-
messageId: "noBeginningNewline",
|
|
865
|
-
*fix(fixer) {
|
|
866
|
-
yield fixer.removeRange([0, node.range[0]]);
|
|
867
|
-
}
|
|
868
|
-
});
|
|
869
|
-
}
|
|
870
|
-
}
|
|
871
|
-
};
|
|
872
|
-
}
|
|
873
|
-
});
|
|
874
|
-
|
|
875
831
|
const RULE_NAME = "array-bracket-spacing";
|
|
876
832
|
const arrayBracketSpacing = createEslintRule({
|
|
877
833
|
name: RULE_NAME,
|
|
@@ -954,7 +910,6 @@ const index = {
|
|
|
954
910
|
"no-inline-type-import": noInlineTypeImport,
|
|
955
911
|
"no-space-before-paren": noSpaceBeforeParen,
|
|
956
912
|
"space-before-function-paren": spaceBeforeFunctionParen,
|
|
957
|
-
"no-beginning-newline": noBeginningNewline,
|
|
958
913
|
"array-bracket-spacing": arrayBracketSpacing
|
|
959
914
|
}
|
|
960
915
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -21,7 +21,6 @@ declare const _default: {
|
|
|
21
21
|
"no-inline-type-import": _typescript_eslint_utils_dist_ts_eslint_Rule.RuleModule<"noInlineTypeImport", [], _typescript_eslint_utils_dist_ts_eslint_Rule.RuleListener>;
|
|
22
22
|
"no-space-before-paren": _typescript_eslint_utils_dist_ts_eslint_Rule.RuleModule<"noSpaceBeforeParen", [], _typescript_eslint_utils_dist_ts_eslint_Rule.RuleListener>;
|
|
23
23
|
"space-before-function-paren": _typescript_eslint_utils_dist_ts_eslint_Rule.RuleModule<MessageIds, Options, _typescript_eslint_utils_dist_ts_eslint_Rule.RuleListener>;
|
|
24
|
-
"no-beginning-newline": _typescript_eslint_utils_dist_ts_eslint_Rule.RuleModule<"noBeginningNewline", [], _typescript_eslint_utils_dist_ts_eslint_Rule.RuleListener>;
|
|
25
24
|
"array-bracket-spacing": _typescript_eslint_utils_dist_ts_eslint_Rule.RuleModule<"arrayBracketSpacing", [], _typescript_eslint_utils_dist_ts_eslint_Rule.RuleListener>;
|
|
26
25
|
};
|
|
27
26
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -4,9 +4,9 @@ import { ref, computed } from '@vue/reactivity';
|
|
|
4
4
|
|
|
5
5
|
const createEslintRule = ESLintUtils.RuleCreator((ruleName) => ruleName);
|
|
6
6
|
|
|
7
|
-
const RULE_NAME$
|
|
7
|
+
const RULE_NAME$8 = "generic-spacing";
|
|
8
8
|
const genericSpacing = createEslintRule({
|
|
9
|
-
name: RULE_NAME$
|
|
9
|
+
name: RULE_NAME$8,
|
|
10
10
|
meta: {
|
|
11
11
|
type: "layout",
|
|
12
12
|
docs: {
|
|
@@ -26,8 +26,7 @@ const genericSpacing = createEslintRule({
|
|
|
26
26
|
return {
|
|
27
27
|
TSTypeParameterDeclaration: (node) => {
|
|
28
28
|
const params = node.params;
|
|
29
|
-
for (
|
|
30
|
-
const param = params[i];
|
|
29
|
+
for (const param of params) {
|
|
31
30
|
const leftToken = sourceCode.getTokenBefore(param);
|
|
32
31
|
const rightToken = sourceCode.getTokenAfter(param);
|
|
33
32
|
const hasSpacingBeforeParam = sourceCode.isSpaceBetween(leftToken, param);
|
|
@@ -194,8 +193,7 @@ const genericSpacing = createEslintRule({
|
|
|
194
193
|
// type T = Generic< any >
|
|
195
194
|
TSTypeParameterInstantiation: (node) => {
|
|
196
195
|
const params = node.params;
|
|
197
|
-
for (
|
|
198
|
-
const param = params[i];
|
|
196
|
+
for (const param of params) {
|
|
199
197
|
const leftToken = sourceCode.getTokenBefore(param);
|
|
200
198
|
const rightToken = sourceCode.getTokenAfter(param);
|
|
201
199
|
const hasSpacingBeforeParam = leftToken.value === "<" ? sourceCode.isSpaceBetween(leftToken, param) : false;
|
|
@@ -276,9 +274,9 @@ const genericSpacing = createEslintRule({
|
|
|
276
274
|
}
|
|
277
275
|
});
|
|
278
276
|
|
|
279
|
-
const RULE_NAME$
|
|
277
|
+
const RULE_NAME$7 = "import-dedupe";
|
|
280
278
|
const importDedupe = createEslintRule({
|
|
281
|
-
name: RULE_NAME$
|
|
279
|
+
name: RULE_NAME$7,
|
|
282
280
|
meta: {
|
|
283
281
|
type: "problem",
|
|
284
282
|
docs: {
|
|
@@ -327,9 +325,9 @@ const importDedupe = createEslintRule({
|
|
|
327
325
|
});
|
|
328
326
|
|
|
329
327
|
const operatorOrAnyBracketOrKeywordRE = /^(\||&|\*|\+|\-|\/|%|<|>|<=|>=|==|!=|===|!==|\[|\(|\{|as|extends|implements|keyof|new|readonly|typeof|unique|unknown)/;
|
|
330
|
-
const RULE_NAME$
|
|
328
|
+
const RULE_NAME$6 = "space-between-generic-and-paren";
|
|
331
329
|
const spaceBetweenGenericAndParen = createEslintRule({
|
|
332
|
-
name: RULE_NAME$
|
|
330
|
+
name: RULE_NAME$6,
|
|
333
331
|
meta: {
|
|
334
332
|
type: "layout",
|
|
335
333
|
docs: {
|
|
@@ -403,9 +401,9 @@ const spaceBetweenGenericAndParen = createEslintRule({
|
|
|
403
401
|
}
|
|
404
402
|
});
|
|
405
403
|
|
|
406
|
-
const RULE_NAME$
|
|
404
|
+
const RULE_NAME$5 = "no-space-before-paren";
|
|
407
405
|
const noSpaceBeforeParen = createEslintRule({
|
|
408
|
-
name: RULE_NAME$
|
|
406
|
+
name: RULE_NAME$5,
|
|
409
407
|
meta: {
|
|
410
408
|
type: "layout",
|
|
411
409
|
docs: {
|
|
@@ -542,9 +540,9 @@ const noSpaceBeforeParen = createEslintRule({
|
|
|
542
540
|
}
|
|
543
541
|
});
|
|
544
542
|
|
|
545
|
-
const RULE_NAME$
|
|
543
|
+
const RULE_NAME$4 = "space-in-empty-block";
|
|
546
544
|
const spaceInEmptyBlock = createEslintRule({
|
|
547
|
-
name: RULE_NAME$
|
|
545
|
+
name: RULE_NAME$4,
|
|
548
546
|
meta: {
|
|
549
547
|
type: "layout",
|
|
550
548
|
docs: {
|
|
@@ -609,9 +607,9 @@ const spaceInEmptyBlock = createEslintRule({
|
|
|
609
607
|
}
|
|
610
608
|
});
|
|
611
609
|
|
|
612
|
-
const RULE_NAME$
|
|
610
|
+
const RULE_NAME$3 = "space-before-function-paren";
|
|
613
611
|
const spaceBeforeFunctionParen = createEslintRule({
|
|
614
|
-
name: RULE_NAME$
|
|
612
|
+
name: RULE_NAME$3,
|
|
615
613
|
meta: {
|
|
616
614
|
type: "layout",
|
|
617
615
|
docs: {
|
|
@@ -716,9 +714,9 @@ const spaceBeforeFunctionParen = createEslintRule({
|
|
|
716
714
|
}
|
|
717
715
|
});
|
|
718
716
|
|
|
719
|
-
const RULE_NAME$
|
|
717
|
+
const RULE_NAME$2 = "semi-spacing";
|
|
720
718
|
const semiSpacing = createEslintRule({
|
|
721
|
-
name: RULE_NAME$
|
|
719
|
+
name: RULE_NAME$2,
|
|
722
720
|
meta: {
|
|
723
721
|
type: "layout",
|
|
724
722
|
docs: {
|
|
@@ -766,9 +764,9 @@ const semiSpacing = createEslintRule({
|
|
|
766
764
|
}
|
|
767
765
|
});
|
|
768
766
|
|
|
769
|
-
const RULE_NAME$
|
|
767
|
+
const RULE_NAME$1 = "no-inline-type-import";
|
|
770
768
|
const noInlineTypeImport = createEslintRule({
|
|
771
|
-
name: RULE_NAME$
|
|
769
|
+
name: RULE_NAME$1,
|
|
772
770
|
meta: {
|
|
773
771
|
type: "layout",
|
|
774
772
|
docs: {
|
|
@@ -815,48 +813,6 @@ import { ${valueSpecifiersText} } from "${node.source.value}";`);
|
|
|
815
813
|
}
|
|
816
814
|
});
|
|
817
815
|
|
|
818
|
-
const RULE_NAME$1 = "no-beginning-newline";
|
|
819
|
-
const noBeginningNewline = createEslintRule({
|
|
820
|
-
name: RULE_NAME$1,
|
|
821
|
-
meta: {
|
|
822
|
-
type: "layout",
|
|
823
|
-
docs: {
|
|
824
|
-
description: "No beginning newline",
|
|
825
|
-
recommended: "error"
|
|
826
|
-
},
|
|
827
|
-
fixable: "whitespace",
|
|
828
|
-
schema: [],
|
|
829
|
-
messages: {
|
|
830
|
-
noBeginningNewline: "No beginning newline"
|
|
831
|
-
}
|
|
832
|
-
},
|
|
833
|
-
defaultOptions: [],
|
|
834
|
-
create: (context) => {
|
|
835
|
-
const text = context.getSourceCode().text;
|
|
836
|
-
return {
|
|
837
|
-
Program: (node) => {
|
|
838
|
-
const newlines = text.match(/([\n]*)/)[1];
|
|
839
|
-
if (newlines.length > 0) {
|
|
840
|
-
context.report({
|
|
841
|
-
node,
|
|
842
|
-
loc: {
|
|
843
|
-
start: {
|
|
844
|
-
line: 0,
|
|
845
|
-
column: 0
|
|
846
|
-
},
|
|
847
|
-
end: node.loc.start
|
|
848
|
-
},
|
|
849
|
-
messageId: "noBeginningNewline",
|
|
850
|
-
*fix(fixer) {
|
|
851
|
-
yield fixer.removeRange([0, node.range[0]]);
|
|
852
|
-
}
|
|
853
|
-
});
|
|
854
|
-
}
|
|
855
|
-
}
|
|
856
|
-
};
|
|
857
|
-
}
|
|
858
|
-
});
|
|
859
|
-
|
|
860
816
|
const RULE_NAME = "array-bracket-spacing";
|
|
861
817
|
const arrayBracketSpacing = createEslintRule({
|
|
862
818
|
name: RULE_NAME,
|
|
@@ -939,7 +895,6 @@ const index = {
|
|
|
939
895
|
"no-inline-type-import": noInlineTypeImport,
|
|
940
896
|
"no-space-before-paren": noSpaceBeforeParen,
|
|
941
897
|
"space-before-function-paren": spaceBeforeFunctionParen,
|
|
942
|
-
"no-beginning-newline": noBeginningNewline,
|
|
943
898
|
"array-bracket-spacing": arrayBracketSpacing
|
|
944
899
|
}
|
|
945
900
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@so1ve/eslint-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.47.1",
|
|
4
4
|
"author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
|
|
5
5
|
"contributors": [
|
|
6
6
|
{
|
|
@@ -31,15 +31,15 @@
|
|
|
31
31
|
"access": "public"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@typescript-eslint/utils": "^5.
|
|
35
|
-
"@vue/reactivity": "^3.2.
|
|
36
|
-
"eslint-define-config": "^1.
|
|
34
|
+
"@typescript-eslint/utils": "^5.55.0",
|
|
35
|
+
"@vue/reactivity": "^3.2.47",
|
|
36
|
+
"eslint-define-config": "^1.17.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@types/node": "^18.
|
|
40
|
-
"@typescript-eslint/types": "^5.
|
|
41
|
-
"unbuild": "^1.1.
|
|
42
|
-
"vitest": "^0.
|
|
39
|
+
"@types/node": "^18.15.3",
|
|
40
|
+
"@typescript-eslint/types": "^5.55.0",
|
|
41
|
+
"unbuild": "^1.1.2",
|
|
42
|
+
"vitest": "^0.29.3"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"build": "rimraf dist && unbuild",
|