@rotki/eslint-plugin 0.6.0 → 0.7.0
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 +60 -123
- package/dist/index.d.cts +4 -0
- package/dist/index.d.mts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.mjs +60 -123
- package/package.json +18 -17
package/dist/index.cjs
CHANGED
|
@@ -23,113 +23,9 @@ function _interopNamespaceCompat(e) {
|
|
|
23
23
|
const createDebug__default = /*#__PURE__*/_interopDefaultCompat(createDebug);
|
|
24
24
|
const compat__namespace = /*#__PURE__*/_interopNamespaceCompat(compat);
|
|
25
25
|
|
|
26
|
-
const
|
|
27
|
-
const version = "0.6.0";
|
|
28
|
-
const packageManager = "pnpm@9.15.0";
|
|
29
|
-
const type = "module";
|
|
30
|
-
const license = "AGPL-3.0";
|
|
31
|
-
const bugs = {
|
|
32
|
-
url: "https://github.com/rotki/eslint-plugin/issues"
|
|
33
|
-
};
|
|
34
|
-
const repository = {
|
|
35
|
-
type: "git",
|
|
36
|
-
url: "https://github.com/rotki/eslint-plugin.git"
|
|
37
|
-
};
|
|
38
|
-
const author = "Rotki Solutions GmbH <info@rotki.com>";
|
|
39
|
-
const files = [
|
|
40
|
-
"dist"
|
|
41
|
-
];
|
|
42
|
-
const main = "./dist/index.mjs";
|
|
43
|
-
const module$1 = "./dist/index.mjs";
|
|
44
|
-
const types = "./dist/index.d.ts";
|
|
45
|
-
const exports$1 = {
|
|
46
|
-
".": {
|
|
47
|
-
types: "./dist/index.d.ts",
|
|
48
|
-
require: "./dist/index.cjs",
|
|
49
|
-
"import": "./dist/index.mjs"
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
const sideEffects = false;
|
|
53
|
-
const scripts = {
|
|
54
|
-
clean: "rimraf .nyc_output coverage dist docs/.vitepress/dist",
|
|
55
|
-
coverage: "nyc report --reporter lcov && opener coverage/lcov-report/index.html",
|
|
56
|
-
generate: "node --experimental-specifier-resolution=node --loader ts-node/esm scripts/update-rule-docs.ts",
|
|
57
|
-
lint: "eslint .",
|
|
58
|
-
"lint:fix": "eslint . --fix",
|
|
59
|
-
build: "unbuild",
|
|
60
|
-
dev: "unbuild --stub",
|
|
61
|
-
prepublishOnly: "pnpm run build",
|
|
62
|
-
test: "vitest",
|
|
63
|
-
"test:coverage": "vitest run --coverage",
|
|
64
|
-
"new": "node --experimental-specifier-resolution=node --loader ts-node/esm ./scripts/new-rule.ts",
|
|
65
|
-
docs: "vitepress dev docs",
|
|
66
|
-
"docs:build": "pnpm run generate && vitepress build docs",
|
|
67
|
-
prepare: "husky",
|
|
68
|
-
typecheck: "tsc --noEmit",
|
|
69
|
-
release: "bumpp -r --no-push"
|
|
70
|
-
};
|
|
71
|
-
const peerDependencies = {
|
|
72
|
-
eslint: "^9.0.0"
|
|
73
|
-
};
|
|
74
|
-
const dependencies = {
|
|
75
|
-
"@typescript-eslint/utils": "8.18.0",
|
|
76
|
-
debug: "4.4.0",
|
|
77
|
-
"eslint-compat-utils": "0.6.4",
|
|
78
|
-
"jsonc-eslint-parser": "2.4.0",
|
|
79
|
-
scule: "1.3.0",
|
|
80
|
-
"vue-eslint-parser": "9.4.3",
|
|
81
|
-
"yaml-eslint-parser": "1.2.3"
|
|
82
|
-
};
|
|
83
|
-
const devDependencies = {
|
|
84
|
-
"@commitlint/cli": "19.6.0",
|
|
85
|
-
"@commitlint/config-conventional": "19.6.0",
|
|
86
|
-
"@rotki/eslint-config": "3.6.0",
|
|
87
|
-
"@types/debug": "4.1.12",
|
|
88
|
-
"@types/node": "20",
|
|
89
|
-
"@typescript-eslint/eslint-plugin": "8.18.0",
|
|
90
|
-
"@typescript-eslint/parser": "8.18.0",
|
|
91
|
-
"@typescript-eslint/rule-tester": "8.18.0",
|
|
92
|
-
"@vitest/coverage-v8": "2.1.8",
|
|
93
|
-
bumpp: "9.9.0",
|
|
94
|
-
debug: "4.4.0",
|
|
95
|
-
eslint: "9.16.0",
|
|
96
|
-
husky: "9.1.7",
|
|
97
|
-
"lint-staged": "15.2.11",
|
|
98
|
-
rimraf: "6.0.1",
|
|
99
|
-
"ts-node": "10.9.2",
|
|
100
|
-
typescript: "5.7.2",
|
|
101
|
-
unbuild: "2.0.0",
|
|
102
|
-
vitepress: "1.5.0",
|
|
103
|
-
vitest: "2.1.8"
|
|
104
|
-
};
|
|
105
|
-
const engines = {
|
|
106
|
-
node: ">=20",
|
|
107
|
-
pnpm: ">=9 <10"
|
|
108
|
-
};
|
|
26
|
+
const version = "0.7.0";
|
|
109
27
|
const pkg = {
|
|
110
|
-
|
|
111
|
-
version: version,
|
|
112
|
-
packageManager: packageManager,
|
|
113
|
-
type: type,
|
|
114
|
-
license: license,
|
|
115
|
-
bugs: bugs,
|
|
116
|
-
repository: repository,
|
|
117
|
-
author: author,
|
|
118
|
-
files: files,
|
|
119
|
-
main: main,
|
|
120
|
-
module: module$1,
|
|
121
|
-
types: types,
|
|
122
|
-
exports: exports$1,
|
|
123
|
-
sideEffects: sideEffects,
|
|
124
|
-
scripts: scripts,
|
|
125
|
-
peerDependencies: peerDependencies,
|
|
126
|
-
dependencies: dependencies,
|
|
127
|
-
devDependencies: devDependencies,
|
|
128
|
-
engines: engines,
|
|
129
|
-
"lint-staged": {
|
|
130
|
-
"*.{js,cjs,ts,vue,yml,json,md}": "eslint"
|
|
131
|
-
}
|
|
132
|
-
};
|
|
28
|
+
version: version};
|
|
133
29
|
|
|
134
30
|
function getFilename(context) {
|
|
135
31
|
return compat__namespace.getFilename(context);
|
|
@@ -257,7 +153,7 @@ function createRecommended(plugin, name, flat) {
|
|
|
257
153
|
}
|
|
258
154
|
}
|
|
259
155
|
|
|
260
|
-
const RULE_NAME$
|
|
156
|
+
const RULE_NAME$5 = "no-deprecated-classes";
|
|
261
157
|
const debug$3 = createDebug__default("@rotki/eslint-plugin:no-deprecated-classes");
|
|
262
158
|
const replacements$2 = [
|
|
263
159
|
["d-block", "block"],
|
|
@@ -310,7 +206,7 @@ function findReplacement(className) {
|
|
|
310
206
|
return replace(matches);
|
|
311
207
|
}
|
|
312
208
|
}
|
|
313
|
-
return
|
|
209
|
+
return undefined;
|
|
314
210
|
}
|
|
315
211
|
function getRange(node) {
|
|
316
212
|
if (node.type === "VAttribute" && node.value && node.value.range)
|
|
@@ -431,11 +327,11 @@ const noDeprecatedClasses = createEslintRule({
|
|
|
431
327
|
schema: [],
|
|
432
328
|
type: "problem"
|
|
433
329
|
},
|
|
434
|
-
name: RULE_NAME$
|
|
330
|
+
name: RULE_NAME$5
|
|
435
331
|
});
|
|
436
332
|
|
|
437
333
|
const debug$2 = createDebug__default("@rotki/eslint-plugin:no-deprecated-components");
|
|
438
|
-
const RULE_NAME$
|
|
334
|
+
const RULE_NAME$4 = "no-deprecated-components";
|
|
439
335
|
const vuetify = {
|
|
440
336
|
VApp: true,
|
|
441
337
|
VAppBar: true,
|
|
@@ -540,11 +436,11 @@ const noDeprecatedComponents = createEslintRule({
|
|
|
540
436
|
],
|
|
541
437
|
type: "problem"
|
|
542
438
|
},
|
|
543
|
-
name: RULE_NAME$
|
|
439
|
+
name: RULE_NAME$4
|
|
544
440
|
});
|
|
545
441
|
|
|
546
442
|
const debug$1 = createDebug__default("@rotki/eslint-plugin:no-deprecated-props");
|
|
547
|
-
const RULE_NAME$
|
|
443
|
+
const RULE_NAME$3 = "no-deprecated-props";
|
|
548
444
|
const replacements = {
|
|
549
445
|
RuiRadio: {
|
|
550
446
|
internalValue: "value"
|
|
@@ -556,7 +452,7 @@ function hasReplacement(tag) {
|
|
|
556
452
|
function getPropName(node) {
|
|
557
453
|
if (node.directive) {
|
|
558
454
|
if (node.key.argument?.type !== "VIdentifier")
|
|
559
|
-
return
|
|
455
|
+
return undefined;
|
|
560
456
|
return scule.kebabCase(node.key.argument.rawName);
|
|
561
457
|
}
|
|
562
458
|
return scule.kebabCase(node.key.rawName);
|
|
@@ -599,7 +495,8 @@ const noDeprecatedProps = createEslintRule({
|
|
|
599
495
|
defaultOptions: [],
|
|
600
496
|
meta: {
|
|
601
497
|
docs: {
|
|
602
|
-
description: "
|
|
498
|
+
description: "Replaces deprecated props with their replacements",
|
|
499
|
+
recommendation: "recommended"
|
|
603
500
|
},
|
|
604
501
|
fixable: "code",
|
|
605
502
|
messages: {
|
|
@@ -608,10 +505,10 @@ const noDeprecatedProps = createEslintRule({
|
|
|
608
505
|
schema: [],
|
|
609
506
|
type: "problem"
|
|
610
507
|
},
|
|
611
|
-
name: RULE_NAME$
|
|
508
|
+
name: RULE_NAME$3
|
|
612
509
|
});
|
|
613
510
|
|
|
614
|
-
const RULE_NAME$
|
|
511
|
+
const RULE_NAME$2 = "no-legacy-library-import";
|
|
615
512
|
const legacyLibrary = "@rotki/ui-library-compat";
|
|
616
513
|
const newLibrary = "@rotki/ui-library";
|
|
617
514
|
const noLegacyLibraryImport = createEslintRule({
|
|
@@ -634,7 +531,8 @@ const noLegacyLibraryImport = createEslintRule({
|
|
|
634
531
|
defaultOptions: [],
|
|
635
532
|
meta: {
|
|
636
533
|
docs: {
|
|
637
|
-
description: `Reports and replaces imports of ${legacyLibrary} with ${newLibrary}
|
|
534
|
+
description: `Reports and replaces imports of ${legacyLibrary} with ${newLibrary}`,
|
|
535
|
+
recommendation: "recommended"
|
|
638
536
|
},
|
|
639
537
|
fixable: "code",
|
|
640
538
|
messages: {
|
|
@@ -643,11 +541,11 @@ const noLegacyLibraryImport = createEslintRule({
|
|
|
643
541
|
schema: [],
|
|
644
542
|
type: "problem"
|
|
645
543
|
},
|
|
646
|
-
name: RULE_NAME$
|
|
544
|
+
name: RULE_NAME$2
|
|
647
545
|
});
|
|
648
546
|
|
|
649
547
|
const debug = createDebug__default("@rotki/eslint-plugin:consistent-ref-type-annotation");
|
|
650
|
-
const RULE_NAME = "consistent-ref-type-annotation";
|
|
548
|
+
const RULE_NAME$1 = "consistent-ref-type-annotation";
|
|
651
549
|
const FIXABLE_METHODS = ["ref", "computed"];
|
|
652
550
|
function checkAssignmentDeclaration(context, node, declaration, options) {
|
|
653
551
|
const source = getSourceCode(context);
|
|
@@ -742,6 +640,45 @@ const consistentRefTypeAnnotation = createEslintRule({
|
|
|
742
640
|
],
|
|
743
641
|
type: "problem"
|
|
744
642
|
},
|
|
643
|
+
name: RULE_NAME$1
|
|
644
|
+
});
|
|
645
|
+
|
|
646
|
+
const RULE_NAME = "no-dot-ts-imports";
|
|
647
|
+
const noDotTsImport = createEslintRule({
|
|
648
|
+
create(context) {
|
|
649
|
+
return {
|
|
650
|
+
ImportDeclaration(node) {
|
|
651
|
+
const importDeclaration = node.source.value;
|
|
652
|
+
if (!importDeclaration.endsWith(".ts"))
|
|
653
|
+
return;
|
|
654
|
+
const lastIndexOfExtension = importDeclaration.lastIndexOf(".ts");
|
|
655
|
+
const replacement = importDeclaration.substring(0, lastIndexOfExtension);
|
|
656
|
+
context.report({
|
|
657
|
+
data: {
|
|
658
|
+
import: importDeclaration
|
|
659
|
+
},
|
|
660
|
+
fix(fixer) {
|
|
661
|
+
return fixer.replaceText(node.source, `'${replacement}'`);
|
|
662
|
+
},
|
|
663
|
+
messageId: "invalidTSExtension",
|
|
664
|
+
node: node.source
|
|
665
|
+
});
|
|
666
|
+
}
|
|
667
|
+
};
|
|
668
|
+
},
|
|
669
|
+
defaultOptions: [],
|
|
670
|
+
meta: {
|
|
671
|
+
docs: {
|
|
672
|
+
description: "Checks and replaces .ts extension in import statements.",
|
|
673
|
+
recommendation: "recommended"
|
|
674
|
+
},
|
|
675
|
+
fixable: "code",
|
|
676
|
+
messages: {
|
|
677
|
+
invalidTSExtension: `'{{ import }}' has a .ts extension, please remove it'`
|
|
678
|
+
},
|
|
679
|
+
schema: [],
|
|
680
|
+
type: "problem"
|
|
681
|
+
},
|
|
745
682
|
name: RULE_NAME
|
|
746
683
|
});
|
|
747
684
|
|
|
@@ -755,16 +692,16 @@ const plugin = {
|
|
|
755
692
|
"no-deprecated-classes": noDeprecatedClasses,
|
|
756
693
|
"no-deprecated-components": noDeprecatedComponents,
|
|
757
694
|
"no-deprecated-props": noDeprecatedProps,
|
|
695
|
+
"no-dot-ts-imports": noDotTsImport,
|
|
758
696
|
"no-legacy-library-import": noLegacyLibraryImport
|
|
759
697
|
}
|
|
760
698
|
};
|
|
761
|
-
const plugin$1 = plugin;
|
|
762
699
|
|
|
763
700
|
const configs = {
|
|
764
|
-
"recommended": createRecommended(plugin
|
|
765
|
-
"recommended-flat": createRecommended(plugin
|
|
701
|
+
"recommended": createRecommended(plugin, "@rotki", false),
|
|
702
|
+
"recommended-flat": createRecommended(plugin, "@rotki", true)
|
|
766
703
|
};
|
|
767
704
|
|
|
768
|
-
const index = Object.assign(plugin
|
|
705
|
+
const index = Object.assign(plugin, { configs });
|
|
769
706
|
|
|
770
707
|
module.exports = index;
|
package/dist/index.d.cts
CHANGED
|
@@ -22,6 +22,7 @@ declare const plugin: {
|
|
|
22
22
|
'no-deprecated-classes': PluginRuleModule<[]>;
|
|
23
23
|
'no-deprecated-components': PluginRuleModule<Options$1>;
|
|
24
24
|
'no-deprecated-props': PluginRuleModule<[]>;
|
|
25
|
+
'no-dot-ts-imports': PluginRuleModule<[]>;
|
|
25
26
|
'no-legacy-library-import': PluginRuleModule<[]>;
|
|
26
27
|
};
|
|
27
28
|
};
|
|
@@ -36,6 +37,7 @@ declare const _default: {
|
|
|
36
37
|
'no-deprecated-classes': PluginRuleModule<[]>;
|
|
37
38
|
'no-deprecated-components': PluginRuleModule<Options$1>;
|
|
38
39
|
'no-deprecated-props': PluginRuleModule<[]>;
|
|
40
|
+
'no-dot-ts-imports': PluginRuleModule<[]>;
|
|
39
41
|
'no-legacy-library-import': PluginRuleModule<[]>;
|
|
40
42
|
};
|
|
41
43
|
} & {
|
|
@@ -52,6 +54,7 @@ declare const _default: {
|
|
|
52
54
|
'no-deprecated-classes': PluginRuleModule<[]>;
|
|
53
55
|
'no-deprecated-components': PluginRuleModule<Options$1>;
|
|
54
56
|
'no-deprecated-props': PluginRuleModule<[]>;
|
|
57
|
+
'no-dot-ts-imports': PluginRuleModule<[]>;
|
|
55
58
|
'no-legacy-library-import': PluginRuleModule<[]>;
|
|
56
59
|
};
|
|
57
60
|
};
|
|
@@ -77,6 +80,7 @@ declare const _default: {
|
|
|
77
80
|
'no-deprecated-classes': PluginRuleModule<[]>;
|
|
78
81
|
'no-deprecated-components': PluginRuleModule<Options$1>;
|
|
79
82
|
'no-deprecated-props': PluginRuleModule<[]>;
|
|
83
|
+
'no-dot-ts-imports': PluginRuleModule<[]>;
|
|
80
84
|
'no-legacy-library-import': PluginRuleModule<[]>;
|
|
81
85
|
};
|
|
82
86
|
};
|
package/dist/index.d.mts
CHANGED
|
@@ -22,6 +22,7 @@ declare const plugin: {
|
|
|
22
22
|
'no-deprecated-classes': PluginRuleModule<[]>;
|
|
23
23
|
'no-deprecated-components': PluginRuleModule<Options$1>;
|
|
24
24
|
'no-deprecated-props': PluginRuleModule<[]>;
|
|
25
|
+
'no-dot-ts-imports': PluginRuleModule<[]>;
|
|
25
26
|
'no-legacy-library-import': PluginRuleModule<[]>;
|
|
26
27
|
};
|
|
27
28
|
};
|
|
@@ -36,6 +37,7 @@ declare const _default: {
|
|
|
36
37
|
'no-deprecated-classes': PluginRuleModule<[]>;
|
|
37
38
|
'no-deprecated-components': PluginRuleModule<Options$1>;
|
|
38
39
|
'no-deprecated-props': PluginRuleModule<[]>;
|
|
40
|
+
'no-dot-ts-imports': PluginRuleModule<[]>;
|
|
39
41
|
'no-legacy-library-import': PluginRuleModule<[]>;
|
|
40
42
|
};
|
|
41
43
|
} & {
|
|
@@ -52,6 +54,7 @@ declare const _default: {
|
|
|
52
54
|
'no-deprecated-classes': PluginRuleModule<[]>;
|
|
53
55
|
'no-deprecated-components': PluginRuleModule<Options$1>;
|
|
54
56
|
'no-deprecated-props': PluginRuleModule<[]>;
|
|
57
|
+
'no-dot-ts-imports': PluginRuleModule<[]>;
|
|
55
58
|
'no-legacy-library-import': PluginRuleModule<[]>;
|
|
56
59
|
};
|
|
57
60
|
};
|
|
@@ -77,6 +80,7 @@ declare const _default: {
|
|
|
77
80
|
'no-deprecated-classes': PluginRuleModule<[]>;
|
|
78
81
|
'no-deprecated-components': PluginRuleModule<Options$1>;
|
|
79
82
|
'no-deprecated-props': PluginRuleModule<[]>;
|
|
83
|
+
'no-dot-ts-imports': PluginRuleModule<[]>;
|
|
80
84
|
'no-legacy-library-import': PluginRuleModule<[]>;
|
|
81
85
|
};
|
|
82
86
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ declare const plugin: {
|
|
|
22
22
|
'no-deprecated-classes': PluginRuleModule<[]>;
|
|
23
23
|
'no-deprecated-components': PluginRuleModule<Options$1>;
|
|
24
24
|
'no-deprecated-props': PluginRuleModule<[]>;
|
|
25
|
+
'no-dot-ts-imports': PluginRuleModule<[]>;
|
|
25
26
|
'no-legacy-library-import': PluginRuleModule<[]>;
|
|
26
27
|
};
|
|
27
28
|
};
|
|
@@ -36,6 +37,7 @@ declare const _default: {
|
|
|
36
37
|
'no-deprecated-classes': PluginRuleModule<[]>;
|
|
37
38
|
'no-deprecated-components': PluginRuleModule<Options$1>;
|
|
38
39
|
'no-deprecated-props': PluginRuleModule<[]>;
|
|
40
|
+
'no-dot-ts-imports': PluginRuleModule<[]>;
|
|
39
41
|
'no-legacy-library-import': PluginRuleModule<[]>;
|
|
40
42
|
};
|
|
41
43
|
} & {
|
|
@@ -52,6 +54,7 @@ declare const _default: {
|
|
|
52
54
|
'no-deprecated-classes': PluginRuleModule<[]>;
|
|
53
55
|
'no-deprecated-components': PluginRuleModule<Options$1>;
|
|
54
56
|
'no-deprecated-props': PluginRuleModule<[]>;
|
|
57
|
+
'no-dot-ts-imports': PluginRuleModule<[]>;
|
|
55
58
|
'no-legacy-library-import': PluginRuleModule<[]>;
|
|
56
59
|
};
|
|
57
60
|
};
|
|
@@ -77,6 +80,7 @@ declare const _default: {
|
|
|
77
80
|
'no-deprecated-classes': PluginRuleModule<[]>;
|
|
78
81
|
'no-deprecated-components': PluginRuleModule<Options$1>;
|
|
79
82
|
'no-deprecated-props': PluginRuleModule<[]>;
|
|
83
|
+
'no-dot-ts-imports': PluginRuleModule<[]>;
|
|
80
84
|
'no-legacy-library-import': PluginRuleModule<[]>;
|
|
81
85
|
};
|
|
82
86
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -4,113 +4,9 @@ import * as compat from 'eslint-compat-utils';
|
|
|
4
4
|
import { pascalCase, kebabCase } from 'scule';
|
|
5
5
|
import { TSESTree } from '@typescript-eslint/utils';
|
|
6
6
|
|
|
7
|
-
const
|
|
8
|
-
const version = "0.6.0";
|
|
9
|
-
const packageManager = "pnpm@9.15.0";
|
|
10
|
-
const type = "module";
|
|
11
|
-
const license = "AGPL-3.0";
|
|
12
|
-
const bugs = {
|
|
13
|
-
url: "https://github.com/rotki/eslint-plugin/issues"
|
|
14
|
-
};
|
|
15
|
-
const repository = {
|
|
16
|
-
type: "git",
|
|
17
|
-
url: "https://github.com/rotki/eslint-plugin.git"
|
|
18
|
-
};
|
|
19
|
-
const author = "Rotki Solutions GmbH <info@rotki.com>";
|
|
20
|
-
const files = [
|
|
21
|
-
"dist"
|
|
22
|
-
];
|
|
23
|
-
const main = "./dist/index.mjs";
|
|
24
|
-
const module = "./dist/index.mjs";
|
|
25
|
-
const types = "./dist/index.d.ts";
|
|
26
|
-
const exports = {
|
|
27
|
-
".": {
|
|
28
|
-
types: "./dist/index.d.ts",
|
|
29
|
-
require: "./dist/index.cjs",
|
|
30
|
-
"import": "./dist/index.mjs"
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
const sideEffects = false;
|
|
34
|
-
const scripts = {
|
|
35
|
-
clean: "rimraf .nyc_output coverage dist docs/.vitepress/dist",
|
|
36
|
-
coverage: "nyc report --reporter lcov && opener coverage/lcov-report/index.html",
|
|
37
|
-
generate: "node --experimental-specifier-resolution=node --loader ts-node/esm scripts/update-rule-docs.ts",
|
|
38
|
-
lint: "eslint .",
|
|
39
|
-
"lint:fix": "eslint . --fix",
|
|
40
|
-
build: "unbuild",
|
|
41
|
-
dev: "unbuild --stub",
|
|
42
|
-
prepublishOnly: "pnpm run build",
|
|
43
|
-
test: "vitest",
|
|
44
|
-
"test:coverage": "vitest run --coverage",
|
|
45
|
-
"new": "node --experimental-specifier-resolution=node --loader ts-node/esm ./scripts/new-rule.ts",
|
|
46
|
-
docs: "vitepress dev docs",
|
|
47
|
-
"docs:build": "pnpm run generate && vitepress build docs",
|
|
48
|
-
prepare: "husky",
|
|
49
|
-
typecheck: "tsc --noEmit",
|
|
50
|
-
release: "bumpp -r --no-push"
|
|
51
|
-
};
|
|
52
|
-
const peerDependencies = {
|
|
53
|
-
eslint: "^9.0.0"
|
|
54
|
-
};
|
|
55
|
-
const dependencies = {
|
|
56
|
-
"@typescript-eslint/utils": "8.18.0",
|
|
57
|
-
debug: "4.4.0",
|
|
58
|
-
"eslint-compat-utils": "0.6.4",
|
|
59
|
-
"jsonc-eslint-parser": "2.4.0",
|
|
60
|
-
scule: "1.3.0",
|
|
61
|
-
"vue-eslint-parser": "9.4.3",
|
|
62
|
-
"yaml-eslint-parser": "1.2.3"
|
|
63
|
-
};
|
|
64
|
-
const devDependencies = {
|
|
65
|
-
"@commitlint/cli": "19.6.0",
|
|
66
|
-
"@commitlint/config-conventional": "19.6.0",
|
|
67
|
-
"@rotki/eslint-config": "3.6.0",
|
|
68
|
-
"@types/debug": "4.1.12",
|
|
69
|
-
"@types/node": "20",
|
|
70
|
-
"@typescript-eslint/eslint-plugin": "8.18.0",
|
|
71
|
-
"@typescript-eslint/parser": "8.18.0",
|
|
72
|
-
"@typescript-eslint/rule-tester": "8.18.0",
|
|
73
|
-
"@vitest/coverage-v8": "2.1.8",
|
|
74
|
-
bumpp: "9.9.0",
|
|
75
|
-
debug: "4.4.0",
|
|
76
|
-
eslint: "9.16.0",
|
|
77
|
-
husky: "9.1.7",
|
|
78
|
-
"lint-staged": "15.2.11",
|
|
79
|
-
rimraf: "6.0.1",
|
|
80
|
-
"ts-node": "10.9.2",
|
|
81
|
-
typescript: "5.7.2",
|
|
82
|
-
unbuild: "2.0.0",
|
|
83
|
-
vitepress: "1.5.0",
|
|
84
|
-
vitest: "2.1.8"
|
|
85
|
-
};
|
|
86
|
-
const engines = {
|
|
87
|
-
node: ">=20",
|
|
88
|
-
pnpm: ">=9 <10"
|
|
89
|
-
};
|
|
7
|
+
const version = "0.7.0";
|
|
90
8
|
const pkg = {
|
|
91
|
-
|
|
92
|
-
version: version,
|
|
93
|
-
packageManager: packageManager,
|
|
94
|
-
type: type,
|
|
95
|
-
license: license,
|
|
96
|
-
bugs: bugs,
|
|
97
|
-
repository: repository,
|
|
98
|
-
author: author,
|
|
99
|
-
files: files,
|
|
100
|
-
main: main,
|
|
101
|
-
module: module,
|
|
102
|
-
types: types,
|
|
103
|
-
exports: exports,
|
|
104
|
-
sideEffects: sideEffects,
|
|
105
|
-
scripts: scripts,
|
|
106
|
-
peerDependencies: peerDependencies,
|
|
107
|
-
dependencies: dependencies,
|
|
108
|
-
devDependencies: devDependencies,
|
|
109
|
-
engines: engines,
|
|
110
|
-
"lint-staged": {
|
|
111
|
-
"*.{js,cjs,ts,vue,yml,json,md}": "eslint"
|
|
112
|
-
}
|
|
113
|
-
};
|
|
9
|
+
version: version};
|
|
114
10
|
|
|
115
11
|
function getFilename(context) {
|
|
116
12
|
return compat.getFilename(context);
|
|
@@ -238,7 +134,7 @@ function createRecommended(plugin, name, flat) {
|
|
|
238
134
|
}
|
|
239
135
|
}
|
|
240
136
|
|
|
241
|
-
const RULE_NAME$
|
|
137
|
+
const RULE_NAME$5 = "no-deprecated-classes";
|
|
242
138
|
const debug$3 = createDebug("@rotki/eslint-plugin:no-deprecated-classes");
|
|
243
139
|
const replacements$2 = [
|
|
244
140
|
["d-block", "block"],
|
|
@@ -291,7 +187,7 @@ function findReplacement(className) {
|
|
|
291
187
|
return replace(matches);
|
|
292
188
|
}
|
|
293
189
|
}
|
|
294
|
-
return
|
|
190
|
+
return undefined;
|
|
295
191
|
}
|
|
296
192
|
function getRange(node) {
|
|
297
193
|
if (node.type === "VAttribute" && node.value && node.value.range)
|
|
@@ -412,11 +308,11 @@ const noDeprecatedClasses = createEslintRule({
|
|
|
412
308
|
schema: [],
|
|
413
309
|
type: "problem"
|
|
414
310
|
},
|
|
415
|
-
name: RULE_NAME$
|
|
311
|
+
name: RULE_NAME$5
|
|
416
312
|
});
|
|
417
313
|
|
|
418
314
|
const debug$2 = createDebug("@rotki/eslint-plugin:no-deprecated-components");
|
|
419
|
-
const RULE_NAME$
|
|
315
|
+
const RULE_NAME$4 = "no-deprecated-components";
|
|
420
316
|
const vuetify = {
|
|
421
317
|
VApp: true,
|
|
422
318
|
VAppBar: true,
|
|
@@ -521,11 +417,11 @@ const noDeprecatedComponents = createEslintRule({
|
|
|
521
417
|
],
|
|
522
418
|
type: "problem"
|
|
523
419
|
},
|
|
524
|
-
name: RULE_NAME$
|
|
420
|
+
name: RULE_NAME$4
|
|
525
421
|
});
|
|
526
422
|
|
|
527
423
|
const debug$1 = createDebug("@rotki/eslint-plugin:no-deprecated-props");
|
|
528
|
-
const RULE_NAME$
|
|
424
|
+
const RULE_NAME$3 = "no-deprecated-props";
|
|
529
425
|
const replacements = {
|
|
530
426
|
RuiRadio: {
|
|
531
427
|
internalValue: "value"
|
|
@@ -537,7 +433,7 @@ function hasReplacement(tag) {
|
|
|
537
433
|
function getPropName(node) {
|
|
538
434
|
if (node.directive) {
|
|
539
435
|
if (node.key.argument?.type !== "VIdentifier")
|
|
540
|
-
return
|
|
436
|
+
return undefined;
|
|
541
437
|
return kebabCase(node.key.argument.rawName);
|
|
542
438
|
}
|
|
543
439
|
return kebabCase(node.key.rawName);
|
|
@@ -580,7 +476,8 @@ const noDeprecatedProps = createEslintRule({
|
|
|
580
476
|
defaultOptions: [],
|
|
581
477
|
meta: {
|
|
582
478
|
docs: {
|
|
583
|
-
description: "
|
|
479
|
+
description: "Replaces deprecated props with their replacements",
|
|
480
|
+
recommendation: "recommended"
|
|
584
481
|
},
|
|
585
482
|
fixable: "code",
|
|
586
483
|
messages: {
|
|
@@ -589,10 +486,10 @@ const noDeprecatedProps = createEslintRule({
|
|
|
589
486
|
schema: [],
|
|
590
487
|
type: "problem"
|
|
591
488
|
},
|
|
592
|
-
name: RULE_NAME$
|
|
489
|
+
name: RULE_NAME$3
|
|
593
490
|
});
|
|
594
491
|
|
|
595
|
-
const RULE_NAME$
|
|
492
|
+
const RULE_NAME$2 = "no-legacy-library-import";
|
|
596
493
|
const legacyLibrary = "@rotki/ui-library-compat";
|
|
597
494
|
const newLibrary = "@rotki/ui-library";
|
|
598
495
|
const noLegacyLibraryImport = createEslintRule({
|
|
@@ -615,7 +512,8 @@ const noLegacyLibraryImport = createEslintRule({
|
|
|
615
512
|
defaultOptions: [],
|
|
616
513
|
meta: {
|
|
617
514
|
docs: {
|
|
618
|
-
description: `Reports and replaces imports of ${legacyLibrary} with ${newLibrary}
|
|
515
|
+
description: `Reports and replaces imports of ${legacyLibrary} with ${newLibrary}`,
|
|
516
|
+
recommendation: "recommended"
|
|
619
517
|
},
|
|
620
518
|
fixable: "code",
|
|
621
519
|
messages: {
|
|
@@ -624,11 +522,11 @@ const noLegacyLibraryImport = createEslintRule({
|
|
|
624
522
|
schema: [],
|
|
625
523
|
type: "problem"
|
|
626
524
|
},
|
|
627
|
-
name: RULE_NAME$
|
|
525
|
+
name: RULE_NAME$2
|
|
628
526
|
});
|
|
629
527
|
|
|
630
528
|
const debug = createDebug("@rotki/eslint-plugin:consistent-ref-type-annotation");
|
|
631
|
-
const RULE_NAME = "consistent-ref-type-annotation";
|
|
529
|
+
const RULE_NAME$1 = "consistent-ref-type-annotation";
|
|
632
530
|
const FIXABLE_METHODS = ["ref", "computed"];
|
|
633
531
|
function checkAssignmentDeclaration(context, node, declaration, options) {
|
|
634
532
|
const source = getSourceCode(context);
|
|
@@ -723,6 +621,45 @@ const consistentRefTypeAnnotation = createEslintRule({
|
|
|
723
621
|
],
|
|
724
622
|
type: "problem"
|
|
725
623
|
},
|
|
624
|
+
name: RULE_NAME$1
|
|
625
|
+
});
|
|
626
|
+
|
|
627
|
+
const RULE_NAME = "no-dot-ts-imports";
|
|
628
|
+
const noDotTsImport = createEslintRule({
|
|
629
|
+
create(context) {
|
|
630
|
+
return {
|
|
631
|
+
ImportDeclaration(node) {
|
|
632
|
+
const importDeclaration = node.source.value;
|
|
633
|
+
if (!importDeclaration.endsWith(".ts"))
|
|
634
|
+
return;
|
|
635
|
+
const lastIndexOfExtension = importDeclaration.lastIndexOf(".ts");
|
|
636
|
+
const replacement = importDeclaration.substring(0, lastIndexOfExtension);
|
|
637
|
+
context.report({
|
|
638
|
+
data: {
|
|
639
|
+
import: importDeclaration
|
|
640
|
+
},
|
|
641
|
+
fix(fixer) {
|
|
642
|
+
return fixer.replaceText(node.source, `'${replacement}'`);
|
|
643
|
+
},
|
|
644
|
+
messageId: "invalidTSExtension",
|
|
645
|
+
node: node.source
|
|
646
|
+
});
|
|
647
|
+
}
|
|
648
|
+
};
|
|
649
|
+
},
|
|
650
|
+
defaultOptions: [],
|
|
651
|
+
meta: {
|
|
652
|
+
docs: {
|
|
653
|
+
description: "Checks and replaces .ts extension in import statements.",
|
|
654
|
+
recommendation: "recommended"
|
|
655
|
+
},
|
|
656
|
+
fixable: "code",
|
|
657
|
+
messages: {
|
|
658
|
+
invalidTSExtension: `'{{ import }}' has a .ts extension, please remove it'`
|
|
659
|
+
},
|
|
660
|
+
schema: [],
|
|
661
|
+
type: "problem"
|
|
662
|
+
},
|
|
726
663
|
name: RULE_NAME
|
|
727
664
|
});
|
|
728
665
|
|
|
@@ -736,16 +673,16 @@ const plugin = {
|
|
|
736
673
|
"no-deprecated-classes": noDeprecatedClasses,
|
|
737
674
|
"no-deprecated-components": noDeprecatedComponents,
|
|
738
675
|
"no-deprecated-props": noDeprecatedProps,
|
|
676
|
+
"no-dot-ts-imports": noDotTsImport,
|
|
739
677
|
"no-legacy-library-import": noLegacyLibraryImport
|
|
740
678
|
}
|
|
741
679
|
};
|
|
742
|
-
const plugin$1 = plugin;
|
|
743
680
|
|
|
744
681
|
const configs = {
|
|
745
|
-
"recommended": createRecommended(plugin
|
|
746
|
-
"recommended-flat": createRecommended(plugin
|
|
682
|
+
"recommended": createRecommended(plugin, "@rotki", false),
|
|
683
|
+
"recommended-flat": createRecommended(plugin, "@rotki", true)
|
|
747
684
|
};
|
|
748
685
|
|
|
749
|
-
const index = Object.assign(plugin
|
|
686
|
+
const index = Object.assign(plugin, { configs });
|
|
750
687
|
|
|
751
688
|
export { index as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rotki/eslint-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "AGPL-3.0",
|
|
6
6
|
"bugs": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"eslint": "^9.0.0"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@typescript-eslint/utils": "8.
|
|
32
|
+
"@typescript-eslint/utils": "8.23.0",
|
|
33
33
|
"debug": "4.4.0",
|
|
34
34
|
"eslint-compat-utils": "0.6.4",
|
|
35
35
|
"jsonc-eslint-parser": "2.4.0",
|
|
@@ -38,26 +38,26 @@
|
|
|
38
38
|
"yaml-eslint-parser": "1.2.3"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@commitlint/cli": "19.
|
|
42
|
-
"@commitlint/config-conventional": "19.
|
|
43
|
-
"@rotki/eslint-config": "3.
|
|
41
|
+
"@commitlint/cli": "19.7.1",
|
|
42
|
+
"@commitlint/config-conventional": "19.7.1",
|
|
43
|
+
"@rotki/eslint-config": "3.7.0",
|
|
44
44
|
"@types/debug": "4.1.12",
|
|
45
45
|
"@types/node": "20",
|
|
46
|
-
"@typescript-eslint/eslint-plugin": "8.
|
|
47
|
-
"@typescript-eslint/parser": "8.
|
|
48
|
-
"@typescript-eslint/rule-tester": "8.
|
|
49
|
-
"@vitest/coverage-v8": "
|
|
50
|
-
"bumpp": "
|
|
46
|
+
"@typescript-eslint/eslint-plugin": "8.23.0",
|
|
47
|
+
"@typescript-eslint/parser": "8.23.0",
|
|
48
|
+
"@typescript-eslint/rule-tester": "8.23.0",
|
|
49
|
+
"@vitest/coverage-v8": "3.0.5",
|
|
50
|
+
"bumpp": "10.0.1",
|
|
51
51
|
"debug": "4.4.0",
|
|
52
|
-
"eslint": "9.
|
|
52
|
+
"eslint": "9.19.0",
|
|
53
53
|
"husky": "9.1.7",
|
|
54
|
-
"lint-staged": "15.
|
|
54
|
+
"lint-staged": "15.4.3",
|
|
55
55
|
"rimraf": "6.0.1",
|
|
56
56
|
"ts-node": "10.9.2",
|
|
57
|
-
"typescript": "5.7.
|
|
58
|
-
"unbuild": "
|
|
59
|
-
"vitepress": "1.
|
|
60
|
-
"vitest": "
|
|
57
|
+
"typescript": "5.7.3",
|
|
58
|
+
"unbuild": "3.3.1",
|
|
59
|
+
"vitepress": "1.6.3",
|
|
60
|
+
"vitest": "3.0.5"
|
|
61
61
|
},
|
|
62
62
|
"engines": {
|
|
63
63
|
"node": ">=20",
|
|
@@ -70,6 +70,7 @@
|
|
|
70
70
|
"clean": "rimraf .nyc_output coverage dist docs/.vitepress/dist",
|
|
71
71
|
"coverage": "nyc report --reporter lcov && opener coverage/lcov-report/index.html",
|
|
72
72
|
"generate": "node --experimental-specifier-resolution=node --loader ts-node/esm scripts/update-rule-docs.ts",
|
|
73
|
+
"generate:index": "node --experimental-specifier-resolution=node --loader ts-node/esm scripts/update-docs-index.ts",
|
|
73
74
|
"lint": "eslint .",
|
|
74
75
|
"lint:fix": "eslint . --fix",
|
|
75
76
|
"build": "unbuild",
|
|
@@ -78,7 +79,7 @@
|
|
|
78
79
|
"test:coverage": "vitest run --coverage",
|
|
79
80
|
"new": "node --experimental-specifier-resolution=node --loader ts-node/esm ./scripts/new-rule.ts",
|
|
80
81
|
"docs": "vitepress dev docs",
|
|
81
|
-
"docs:build": "pnpm run generate && vitepress build docs",
|
|
82
|
+
"docs:build": "pnpm run generate && pnpm run generate:index && vitepress build docs",
|
|
82
83
|
"typecheck": "tsc --noEmit",
|
|
83
84
|
"release": "bumpp -r --no-push"
|
|
84
85
|
}
|