@rotki/eslint-config 5.0.1 → 6.1.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.d.mts +803 -564
- package/dist/index.mjs +81 -51
- package/package.json +37 -37
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { FlatConfigComposer } from "eslint-flat-config-utils";
|
|
2
2
|
import { findUp, findUpSync } from "find-up-simple";
|
|
3
3
|
import { isPackageExists } from "local-pkg";
|
|
4
|
+
import pluginE18e from "@e18e/eslint-plugin";
|
|
4
5
|
import pluginComments from "@eslint-community/eslint-plugin-eslint-comments";
|
|
5
6
|
import pluginAntfu from "eslint-plugin-antfu";
|
|
6
7
|
import pluginImport from "eslint-plugin-import-lite";
|
|
@@ -15,7 +16,6 @@ import { mergeProcessors, processorPassThrough } from "eslint-merge-processors";
|
|
|
15
16
|
import fs from "node:fs/promises";
|
|
16
17
|
import { configs } from "eslint-plugin-regexp";
|
|
17
18
|
import path from "node:path";
|
|
18
|
-
|
|
19
19
|
//#region src/configs/comments.ts
|
|
20
20
|
async function comments() {
|
|
21
21
|
return [{
|
|
@@ -30,7 +30,6 @@ async function comments() {
|
|
|
30
30
|
}
|
|
31
31
|
}];
|
|
32
32
|
}
|
|
33
|
-
|
|
34
33
|
//#endregion
|
|
35
34
|
//#region src/globs.ts
|
|
36
35
|
const GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
@@ -100,19 +99,22 @@ const GLOB_EXCLUDE = [
|
|
|
100
99
|
"**/.output",
|
|
101
100
|
"**/.vite-inspect",
|
|
102
101
|
"**/.yarn",
|
|
103
|
-
"**/vite.config.*.timestamp-*",
|
|
104
102
|
"**/.nyc_output",
|
|
105
103
|
"**/.e2e",
|
|
106
104
|
"**/*.patch",
|
|
107
105
|
"**/*.log",
|
|
108
106
|
"**/CHANGELOG*.md",
|
|
109
|
-
"**/*.min.*",
|
|
110
107
|
"**/LICENSE*",
|
|
108
|
+
"**/*.min.*",
|
|
111
109
|
"**/__snapshots__",
|
|
110
|
+
"**/vite.config.*.timestamp-*",
|
|
112
111
|
"**/auto-import?(s).d.ts",
|
|
113
|
-
"**/components.d.ts"
|
|
112
|
+
"**/components.d.ts",
|
|
113
|
+
"**/.context",
|
|
114
|
+
"**/.claude",
|
|
115
|
+
"**/.agents",
|
|
116
|
+
"**/.*/skills"
|
|
114
117
|
];
|
|
115
|
-
|
|
116
118
|
//#endregion
|
|
117
119
|
//#region src/configs/disables.ts
|
|
118
120
|
async function disables() {
|
|
@@ -176,7 +178,27 @@ async function disables() {
|
|
|
176
178
|
}
|
|
177
179
|
];
|
|
178
180
|
}
|
|
179
|
-
|
|
181
|
+
//#endregion
|
|
182
|
+
//#region src/configs/e18e.ts
|
|
183
|
+
async function e18e(options = {}) {
|
|
184
|
+
const { isInEditor = false, modernization = true, type = "app", moduleReplacements = type === "lib" && isInEditor, overrides = {}, performanceImprovements = true } = options;
|
|
185
|
+
const configs = pluginE18e.configs;
|
|
186
|
+
return [{
|
|
187
|
+
name: "rotki/e18e/rules",
|
|
188
|
+
plugins: { e18e: pluginE18e },
|
|
189
|
+
rules: {
|
|
190
|
+
...modernization ? { ...configs.modernization.rules } : {},
|
|
191
|
+
...moduleReplacements ? { ...configs.moduleReplacements.rules } : {},
|
|
192
|
+
...performanceImprovements ? { ...configs.performanceImprovements.rules } : {},
|
|
193
|
+
...type === "lib" ? {} : { "e18e/prefer-static-regex": "off" },
|
|
194
|
+
"e18e/prefer-array-to-reversed": "off",
|
|
195
|
+
"e18e/prefer-array-to-sorted": "off",
|
|
196
|
+
"e18e/prefer-array-to-spliced": "off",
|
|
197
|
+
"e18e/prefer-spread-syntax": "off",
|
|
198
|
+
...overrides
|
|
199
|
+
}
|
|
200
|
+
}];
|
|
201
|
+
}
|
|
180
202
|
//#endregion
|
|
181
203
|
//#region src/utils.ts
|
|
182
204
|
const scopeUrl = fileURLToPath(new URL(".", import.meta.url));
|
|
@@ -274,12 +296,11 @@ function renamePluginInConfigs(configs, map) {
|
|
|
274
296
|
function isInEditorEnv() {
|
|
275
297
|
if (process.env.CI) return false;
|
|
276
298
|
if (isInGitHooksOrLintStaged()) return false;
|
|
277
|
-
return !!(process.env.VSCODE_PID || process.env.VSCODE_CWD || process.env.JETBRAINS_IDE || process.env.VIM || process.env.NVIM);
|
|
299
|
+
return !!(process.env.VSCODE_PID || process.env.VSCODE_CWD || process.env.JETBRAINS_IDE || process.env.VIM || process.env.NVIM || process.env.ZED_ENVIRONMENT && !process.env.ZED_TERM);
|
|
278
300
|
}
|
|
279
301
|
function isInGitHooksOrLintStaged() {
|
|
280
302
|
return !!(process.env.GIT_PARAMS || process.env.VSCODE_GIT_COMMAND || process.env.npm_lifecycle_script?.startsWith("lint-staged"));
|
|
281
303
|
}
|
|
282
|
-
|
|
283
304
|
//#endregion
|
|
284
305
|
//#region src/configs/stylistic.ts
|
|
285
306
|
const StylisticConfigDefaults = {
|
|
@@ -359,7 +380,6 @@ async function stylistic(options = {}) {
|
|
|
359
380
|
}
|
|
360
381
|
}];
|
|
361
382
|
}
|
|
362
|
-
|
|
363
383
|
//#endregion
|
|
364
384
|
//#region src/configs/formatters.ts
|
|
365
385
|
function mergePrettierOptions(options, overrides) {
|
|
@@ -457,7 +477,6 @@ async function formatters(options = {}, stylistic = {}) {
|
|
|
457
477
|
}
|
|
458
478
|
return configs;
|
|
459
479
|
}
|
|
460
|
-
|
|
461
480
|
//#endregion
|
|
462
481
|
//#region src/configs/ignores.ts
|
|
463
482
|
async function ignores(userIgnores = []) {
|
|
@@ -466,7 +485,6 @@ async function ignores(userIgnores = []) {
|
|
|
466
485
|
name: "rotki/ignores"
|
|
467
486
|
}];
|
|
468
487
|
}
|
|
469
|
-
|
|
470
488
|
//#endregion
|
|
471
489
|
//#region src/configs/imports.ts
|
|
472
490
|
async function imports(options = {}) {
|
|
@@ -501,7 +519,6 @@ async function imports(options = {}) {
|
|
|
501
519
|
}
|
|
502
520
|
}];
|
|
503
521
|
}
|
|
504
|
-
|
|
505
522
|
//#endregion
|
|
506
523
|
//#region src/configs/javascript.ts
|
|
507
524
|
async function javascript(options = {}) {
|
|
@@ -745,7 +762,6 @@ async function javascript(options = {}) {
|
|
|
745
762
|
}
|
|
746
763
|
}];
|
|
747
764
|
}
|
|
748
|
-
|
|
749
765
|
//#endregion
|
|
750
766
|
//#region src/configs/jsonc.ts
|
|
751
767
|
async function jsonc(options = {}) {
|
|
@@ -756,14 +772,14 @@ async function jsonc(options = {}) {
|
|
|
756
772
|
], overrides = {}, stylistic = true } = options;
|
|
757
773
|
const { indent: rawIndent = 2 } = typeof stylistic === "boolean" ? {} : stylistic;
|
|
758
774
|
const indent = Array.isArray(rawIndent) ? rawIndent[0] : rawIndent;
|
|
759
|
-
const
|
|
775
|
+
const pluginJsonc = await interopDefault(import("eslint-plugin-jsonc"));
|
|
760
776
|
const customRules = { "max-lines": "off" };
|
|
761
777
|
return [{
|
|
762
778
|
name: "rotki/jsonc/setup",
|
|
763
779
|
plugins: { jsonc: pluginJsonc }
|
|
764
780
|
}, {
|
|
765
781
|
files,
|
|
766
|
-
|
|
782
|
+
language: "jsonc/json",
|
|
767
783
|
name: "rotki/jsonc/rules",
|
|
768
784
|
rules: {
|
|
769
785
|
"jsonc/no-bigint-literals": "error",
|
|
@@ -815,11 +831,10 @@ async function jsonc(options = {}) {
|
|
|
815
831
|
}
|
|
816
832
|
}];
|
|
817
833
|
}
|
|
818
|
-
|
|
819
834
|
//#endregion
|
|
820
835
|
//#region src/configs/markdown.ts
|
|
821
836
|
async function markdown(options = {}) {
|
|
822
|
-
const { componentExts = [], files = [GLOB_MARKDOWN], overrides = {} } = options;
|
|
837
|
+
const { componentExts = [], files = [GLOB_MARKDOWN], gfm = true, overrides = {}, overridesMarkdown = {} } = options;
|
|
823
838
|
const markdown = await interopDefault(import("@eslint/markdown"));
|
|
824
839
|
return [
|
|
825
840
|
{
|
|
@@ -834,14 +849,41 @@ async function markdown(options = {}) {
|
|
|
834
849
|
},
|
|
835
850
|
{
|
|
836
851
|
files,
|
|
837
|
-
|
|
852
|
+
language: gfm ? "markdown/gfm" : "markdown/commonmark",
|
|
838
853
|
name: "rotki/markdown/parser"
|
|
839
854
|
},
|
|
855
|
+
{
|
|
856
|
+
files,
|
|
857
|
+
name: "rotki/markdown/rules",
|
|
858
|
+
rules: {
|
|
859
|
+
...markdown.configs.recommended.at(0)?.rules,
|
|
860
|
+
"markdown/fenced-code-language": "off",
|
|
861
|
+
"markdown/no-missing-label-refs": "off",
|
|
862
|
+
...overridesMarkdown
|
|
863
|
+
}
|
|
864
|
+
},
|
|
865
|
+
{
|
|
866
|
+
files,
|
|
867
|
+
name: "rotki/markdown/disables/markdown",
|
|
868
|
+
rules: {
|
|
869
|
+
"@stylistic/indent": "off",
|
|
870
|
+
"no-irregular-whitespace": "off",
|
|
871
|
+
"perfectionist/sort-exports": "off",
|
|
872
|
+
"perfectionist/sort-imports": "off",
|
|
873
|
+
"regexp/no-legacy-features": "off",
|
|
874
|
+
"regexp/no-missing-g-flag": "off",
|
|
875
|
+
"regexp/no-useless-dollar-replacements": "off",
|
|
876
|
+
"regexp/no-useless-flag": "off"
|
|
877
|
+
}
|
|
878
|
+
},
|
|
840
879
|
{
|
|
841
880
|
files: [GLOB_MARKDOWN_CODE, ...componentExts.map((ext) => `${GLOB_MARKDOWN}/**/*.${ext}`)],
|
|
842
881
|
languageOptions: { parserOptions: { ecmaFeatures: { impliedStrict: true } } },
|
|
843
|
-
name: "rotki/markdown/disables",
|
|
882
|
+
name: "rotki/markdown/disables/code",
|
|
844
883
|
rules: {
|
|
884
|
+
"@stylistic/comma-dangle": "off",
|
|
885
|
+
"@stylistic/eol-last": "off",
|
|
886
|
+
"@stylistic/padding-line-between-statements": "off",
|
|
845
887
|
"@typescript-eslint/consistent-type-imports": "off",
|
|
846
888
|
"@typescript-eslint/explicit-function-return-type": "off",
|
|
847
889
|
"@typescript-eslint/no-namespace": "off",
|
|
@@ -850,6 +892,7 @@ async function markdown(options = {}) {
|
|
|
850
892
|
"@typescript-eslint/no-unused-expressions": "off",
|
|
851
893
|
"@typescript-eslint/no-unused-vars": "off",
|
|
852
894
|
"@typescript-eslint/no-use-before-define": "off",
|
|
895
|
+
"e18e/prefer-static-regex": "off",
|
|
853
896
|
"import/newline-after-import": "off",
|
|
854
897
|
"no-alert": "off",
|
|
855
898
|
"no-console": "off",
|
|
@@ -861,8 +904,6 @@ async function markdown(options = {}) {
|
|
|
861
904
|
"no-unused-labels": "off",
|
|
862
905
|
"no-unused-vars": "off",
|
|
863
906
|
"node/prefer-global/process": "off",
|
|
864
|
-
"style/comma-dangle": "off",
|
|
865
|
-
"style/eol-last": "off",
|
|
866
907
|
"unicode-bom": "off",
|
|
867
908
|
"unused-imports/no-unused-imports": "off",
|
|
868
909
|
"unused-imports/no-unused-vars": "off",
|
|
@@ -876,7 +917,6 @@ async function markdown(options = {}) {
|
|
|
876
917
|
}
|
|
877
918
|
];
|
|
878
919
|
}
|
|
879
|
-
|
|
880
920
|
//#endregion
|
|
881
921
|
//#region src/configs/node.ts
|
|
882
922
|
async function node() {
|
|
@@ -896,7 +936,6 @@ async function node() {
|
|
|
896
936
|
}
|
|
897
937
|
}];
|
|
898
938
|
}
|
|
899
|
-
|
|
900
939
|
//#endregion
|
|
901
940
|
//#region src/configs/perfectionist.ts
|
|
902
941
|
/**
|
|
@@ -948,7 +987,6 @@ async function perfectionist() {
|
|
|
948
987
|
}
|
|
949
988
|
}];
|
|
950
989
|
}
|
|
951
|
-
|
|
952
990
|
//#endregion
|
|
953
991
|
//#region src/configs/pnpm.ts
|
|
954
992
|
async function detectCatalogUsage() {
|
|
@@ -958,17 +996,16 @@ async function detectCatalogUsage() {
|
|
|
958
996
|
return yaml.includes("catalog:") || yaml.includes("catalogs:");
|
|
959
997
|
}
|
|
960
998
|
async function pnpm(options) {
|
|
961
|
-
const [pluginPnpm, pluginYaml, yamlParser
|
|
999
|
+
const [pluginPnpm, pluginYaml, yamlParser] = await Promise.all([
|
|
962
1000
|
interopDefault(import("eslint-plugin-pnpm")),
|
|
963
1001
|
interopDefault(import("eslint-plugin-yml")),
|
|
964
|
-
interopDefault(import("yaml-eslint-parser"))
|
|
965
|
-
interopDefault(import("jsonc-eslint-parser"))
|
|
1002
|
+
interopDefault(import("yaml-eslint-parser"))
|
|
966
1003
|
]);
|
|
967
1004
|
const { catalogs = await detectCatalogUsage(), isInEditor = false, json = true, sort = true, yaml = true } = options;
|
|
968
1005
|
const configs = [];
|
|
969
1006
|
if (json) configs.push({
|
|
970
1007
|
files: ["package.json", "**/package.json"],
|
|
971
|
-
|
|
1008
|
+
language: "jsonc/json",
|
|
972
1009
|
name: "rotki/pnpm/package-json",
|
|
973
1010
|
plugins: { pnpm: pluginPnpm },
|
|
974
1011
|
rules: {
|
|
@@ -1073,7 +1110,6 @@ async function pnpm(options) {
|
|
|
1073
1110
|
}
|
|
1074
1111
|
return configs;
|
|
1075
1112
|
}
|
|
1076
|
-
|
|
1077
1113
|
//#endregion
|
|
1078
1114
|
//#region src/configs/regexp.ts
|
|
1079
1115
|
async function regexp(options = {}) {
|
|
@@ -1091,7 +1127,6 @@ async function regexp(options = {}) {
|
|
|
1091
1127
|
}
|
|
1092
1128
|
}];
|
|
1093
1129
|
}
|
|
1094
|
-
|
|
1095
1130
|
//#endregion
|
|
1096
1131
|
//#region src/configs/rotki-plugin.ts
|
|
1097
1132
|
async function rotkiPlugin(options = {}) {
|
|
@@ -1142,7 +1177,6 @@ async function rotkiPlugin(options = {}) {
|
|
|
1142
1177
|
}
|
|
1143
1178
|
}];
|
|
1144
1179
|
}
|
|
1145
|
-
|
|
1146
1180
|
//#endregion
|
|
1147
1181
|
//#region src/configs/sort.ts
|
|
1148
1182
|
async function sortPackageJson() {
|
|
@@ -1361,7 +1395,6 @@ function sortTsconfig() {
|
|
|
1361
1395
|
] }
|
|
1362
1396
|
}];
|
|
1363
1397
|
}
|
|
1364
|
-
|
|
1365
1398
|
//#endregion
|
|
1366
1399
|
//#region src/configs/storybook.ts
|
|
1367
1400
|
async function storybook(options = {}) {
|
|
@@ -1397,7 +1430,6 @@ async function storybook(options = {}) {
|
|
|
1397
1430
|
}
|
|
1398
1431
|
];
|
|
1399
1432
|
}
|
|
1400
|
-
|
|
1401
1433
|
//#endregion
|
|
1402
1434
|
//#region src/configs/test.ts
|
|
1403
1435
|
let _pluginTest;
|
|
@@ -1419,6 +1451,7 @@ async function test(options = {}) {
|
|
|
1419
1451
|
name: "rotki/test/rules",
|
|
1420
1452
|
rules: {
|
|
1421
1453
|
"@typescript-eslint/explicit-function-return-type": "off",
|
|
1454
|
+
"e18e/prefer-static-regex": "off",
|
|
1422
1455
|
"node/prefer-global/process": "off",
|
|
1423
1456
|
"test/consistent-test-it": ["error", {
|
|
1424
1457
|
fn: "it",
|
|
@@ -1442,18 +1475,17 @@ async function test(options = {}) {
|
|
|
1442
1475
|
}
|
|
1443
1476
|
}];
|
|
1444
1477
|
}
|
|
1445
|
-
|
|
1446
1478
|
//#endregion
|
|
1447
1479
|
//#region src/configs/typescript.ts
|
|
1448
1480
|
async function typescript(options = {}) {
|
|
1449
1481
|
const { componentExts = [], isInEditor = false, overrides = {}, overridesTypeAware = {}, parserOptions = {}, type = "app" } = options;
|
|
1450
1482
|
const files = options.files ?? [
|
|
1451
|
-
|
|
1452
|
-
|
|
1483
|
+
"**/*.?([cm])ts",
|
|
1484
|
+
"**/*.?([cm])tsx",
|
|
1453
1485
|
...componentExts.map((ext) => `**/*.${ext}`)
|
|
1454
1486
|
];
|
|
1455
|
-
const filesTypeAware = options.filesTypeAware ?? [
|
|
1456
|
-
const ignoresTypeAware = options.ignoresTypeAware ?? [
|
|
1487
|
+
const filesTypeAware = options.filesTypeAware ?? ["**/*.?([cm])ts", "**/*.?([cm])tsx"];
|
|
1488
|
+
const ignoresTypeAware = options.ignoresTypeAware ?? [`**/*.md/**`];
|
|
1457
1489
|
const tsconfigPath = options?.tsconfigPath ? options.tsconfigPath : void 0;
|
|
1458
1490
|
const isTypeAware = !!tsconfigPath;
|
|
1459
1491
|
const typeAwareCustom = {
|
|
@@ -1616,9 +1648,9 @@ async function typescript(options = {}) {
|
|
|
1616
1648
|
}] : []
|
|
1617
1649
|
];
|
|
1618
1650
|
}
|
|
1619
|
-
|
|
1620
1651
|
//#endregion
|
|
1621
1652
|
//#region src/configs/unicorn.ts
|
|
1653
|
+
const FILENAME_CASE_IGNORE = /^[A-Z]+\..*$/;
|
|
1622
1654
|
async function unicorn(options = {}) {
|
|
1623
1655
|
return [{
|
|
1624
1656
|
name: "rotki/unicorn/rules",
|
|
@@ -1636,7 +1668,7 @@ async function unicorn(options = {}) {
|
|
|
1636
1668
|
kebabCase: true,
|
|
1637
1669
|
pascalCase: true
|
|
1638
1670
|
},
|
|
1639
|
-
ignore: [
|
|
1671
|
+
ignore: [FILENAME_CASE_IGNORE]
|
|
1640
1672
|
}],
|
|
1641
1673
|
"unicorn/new-for-builtins": "error",
|
|
1642
1674
|
"unicorn/no-array-method-this-argument": "error",
|
|
@@ -1683,7 +1715,6 @@ async function unicorn(options = {}) {
|
|
|
1683
1715
|
rules: { "unicorn/filename-case": "off" }
|
|
1684
1716
|
}];
|
|
1685
1717
|
}
|
|
1686
|
-
|
|
1687
1718
|
//#endregion
|
|
1688
1719
|
//#region src/configs/vue.ts
|
|
1689
1720
|
async function vue(options = {}) {
|
|
@@ -1952,7 +1983,6 @@ async function vue(options = {}) {
|
|
|
1952
1983
|
}
|
|
1953
1984
|
}];
|
|
1954
1985
|
}
|
|
1955
|
-
|
|
1956
1986
|
//#endregion
|
|
1957
1987
|
//#region src/configs/vue-i18n.ts
|
|
1958
1988
|
async function vueI18n(options = {}) {
|
|
@@ -2018,7 +2048,6 @@ async function vueI18n(options = {}) {
|
|
|
2018
2048
|
} }
|
|
2019
2049
|
}];
|
|
2020
2050
|
}
|
|
2021
|
-
|
|
2022
2051
|
//#endregion
|
|
2023
2052
|
//#region src/configs/yaml.ts
|
|
2024
2053
|
async function yaml(options = {}) {
|
|
@@ -2034,7 +2063,7 @@ async function yaml(options = {}) {
|
|
|
2034
2063
|
languageOptions: { parser: parserYaml },
|
|
2035
2064
|
name: "rotki/yaml/rules",
|
|
2036
2065
|
rules: {
|
|
2037
|
-
"
|
|
2066
|
+
"@stylistic/spaced-comment": "off",
|
|
2038
2067
|
"yaml/block-mapping": "error",
|
|
2039
2068
|
"yaml/block-sequence": "error",
|
|
2040
2069
|
"yaml/no-empty-key": "error",
|
|
@@ -2063,7 +2092,6 @@ async function yaml(options = {}) {
|
|
|
2063
2092
|
}
|
|
2064
2093
|
}];
|
|
2065
2094
|
}
|
|
2066
|
-
|
|
2067
2095
|
//#endregion
|
|
2068
2096
|
//#region src/factory.ts
|
|
2069
2097
|
const flatConfigProps = [
|
|
@@ -2091,7 +2119,7 @@ const defaultPluginRenaming = {
|
|
|
2091
2119
|
* Construct an array of ESLint flat config items.
|
|
2092
2120
|
*/
|
|
2093
2121
|
function rotki(options = {}, ...userConfigs) {
|
|
2094
|
-
const { autoRenamePlugins = true, componentExts = [], gitignore: enableGitignore = true, jsx = true, pnpm: enablePnpm = !!findUpSync("pnpm-workspace.yaml"), regexp: enableRegexp = false, rotki: enableRotki, storybook: enableStorybook, typescript: enableTypeScript = isPackageExists("typescript"), unicorn: enableUnicorn = true, vue: enableVue = VuePackages.some((i) => isPackageExists(i)), vueI18n: enableVueI18n } = options;
|
|
2122
|
+
const { autoRenamePlugins = true, componentExts = [], e18e: enableE18e = true, gitignore: enableGitignore = true, jsx = true, pnpm: enablePnpm = !!findUpSync("pnpm-workspace.yaml"), regexp: enableRegexp = false, rotki: enableRotki, storybook: enableStorybook, typescript: enableTypeScript = isPackageExists("typescript") || isPackageExists("@typescript/native-preview"), unicorn: enableUnicorn = true, vue: enableVue = VuePackages.some((i) => isPackageExists(i)), vueI18n: enableVueI18n } = options;
|
|
2095
2123
|
let isInEditor = options.isInEditor;
|
|
2096
2124
|
if (isInEditor === null) {
|
|
2097
2125
|
isInEditor = isInEditorEnv();
|
|
@@ -2121,6 +2149,11 @@ function rotki(options = {}, ...userConfigs) {
|
|
|
2121
2149
|
stylistic: stylisticOptions
|
|
2122
2150
|
}), perfectionist());
|
|
2123
2151
|
if (enableUnicorn) configs.push(unicorn(enableUnicorn === true ? {} : enableUnicorn));
|
|
2152
|
+
if (enableE18e) configs.push(e18e({
|
|
2153
|
+
...typeof enableE18e === "boolean" ? {} : enableE18e,
|
|
2154
|
+
isInEditor,
|
|
2155
|
+
type: options.type
|
|
2156
|
+
}));
|
|
2124
2157
|
if (enableVue) componentExts.push("vue");
|
|
2125
2158
|
if (enableTypeScript) configs.push(typescript({
|
|
2126
2159
|
...typescriptOptions,
|
|
@@ -2202,7 +2235,6 @@ function getOverrides(options, key) {
|
|
|
2202
2235
|
const sub = resolveSubOptions(options, key);
|
|
2203
2236
|
return { ..."overrides" in sub ? sub.overrides : {} };
|
|
2204
2237
|
}
|
|
2205
|
-
|
|
2206
2238
|
//#endregion
|
|
2207
2239
|
//#region src/config-presets.ts
|
|
2208
2240
|
const CONFIG_PRESET_FULL_ON = {
|
|
@@ -2236,10 +2268,8 @@ const CONFIG_PRESET_FULL_OFF = {
|
|
|
2236
2268
|
vue: false,
|
|
2237
2269
|
yaml: false
|
|
2238
2270
|
};
|
|
2239
|
-
|
|
2240
2271
|
//#endregion
|
|
2241
2272
|
//#region src/index.ts
|
|
2242
2273
|
var src_default = rotki;
|
|
2243
|
-
|
|
2244
2274
|
//#endregion
|
|
2245
|
-
export { CONFIG_PRESET_FULL_OFF, CONFIG_PRESET_FULL_ON, GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, StylisticConfigDefaults, combine, comments, src_default as default, defaultPluginRenaming, disables, ensurePackages, formatters, getOverrides, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsonc, markdown, node, parserPlain, perfectionist, pnpm, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, rotki, rotkiPlugin, sortPackageJson, sortTsconfig, storybook, stylistic, test, toArray, typescript, unicorn, vue, vueI18n, yaml };
|
|
2275
|
+
export { CONFIG_PRESET_FULL_OFF, CONFIG_PRESET_FULL_ON, GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, StylisticConfigDefaults, combine, comments, src_default as default, defaultPluginRenaming, disables, e18e, ensurePackages, formatters, getOverrides, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsonc, markdown, node, parserPlain, perfectionist, pnpm, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, rotki, rotkiPlugin, sortPackageJson, sortTsconfig, storybook, stylistic, test, toArray, typescript, unicorn, vue, vueI18n, yaml };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rotki/eslint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "AGPL-3.0",
|
|
6
6
|
"bugs": {
|
|
@@ -42,61 +42,61 @@
|
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@antfu/install-pkg": "1.1.0",
|
|
45
|
-
"@clack/prompts": "1.0
|
|
46
|
-
"@
|
|
47
|
-
"@eslint/
|
|
48
|
-
"@
|
|
49
|
-
"@
|
|
50
|
-
"@typescript-eslint/
|
|
51
|
-
"@
|
|
52
|
-
"eslint-
|
|
45
|
+
"@clack/prompts": "1.1.0",
|
|
46
|
+
"@e18e/eslint-plugin": "0.3.0",
|
|
47
|
+
"@eslint-community/eslint-plugin-eslint-comments": "4.7.1",
|
|
48
|
+
"@eslint/markdown": "8.0.1",
|
|
49
|
+
"@stylistic/eslint-plugin": "5.10.0",
|
|
50
|
+
"@typescript-eslint/eslint-plugin": "8.58.0",
|
|
51
|
+
"@typescript-eslint/parser": "8.58.0",
|
|
52
|
+
"@vitest/eslint-plugin": "1.6.14",
|
|
53
|
+
"eslint-config-flat-gitignore": "2.3.0",
|
|
53
54
|
"eslint-config-prettier": "10.1.8",
|
|
54
|
-
"eslint-flat-config-utils": "3.0.
|
|
55
|
+
"eslint-flat-config-utils": "3.0.2",
|
|
55
56
|
"eslint-merge-processors": "2.0.0",
|
|
56
57
|
"eslint-plugin-antfu": "3.2.2",
|
|
57
|
-
"eslint-plugin-format": "
|
|
58
|
+
"eslint-plugin-format": "2.0.1",
|
|
58
59
|
"eslint-plugin-html": "8.1.4",
|
|
59
|
-
"eslint-plugin-import-lite": "0.
|
|
60
|
-
"eslint-plugin-jsonc": "
|
|
61
|
-
"eslint-plugin-n": "17.
|
|
60
|
+
"eslint-plugin-import-lite": "0.6.0",
|
|
61
|
+
"eslint-plugin-jsonc": "3.1.2",
|
|
62
|
+
"eslint-plugin-n": "17.24.0",
|
|
62
63
|
"eslint-plugin-no-only-tests": "3.3.0",
|
|
63
|
-
"eslint-plugin-perfectionist": "5.
|
|
64
|
-
"eslint-plugin-pnpm": "1.
|
|
64
|
+
"eslint-plugin-perfectionist": "5.7.0",
|
|
65
|
+
"eslint-plugin-pnpm": "1.6.0",
|
|
65
66
|
"eslint-plugin-prettier": "5.5.5",
|
|
66
|
-
"eslint-plugin-regexp": "3.
|
|
67
|
-
"eslint-plugin-unicorn": "
|
|
67
|
+
"eslint-plugin-regexp": "3.1.0",
|
|
68
|
+
"eslint-plugin-unicorn": "64.0.0",
|
|
68
69
|
"eslint-plugin-unused-imports": "4.4.1",
|
|
69
70
|
"eslint-plugin-vue": "10.8.0",
|
|
70
|
-
"eslint-plugin-yml": "3.1
|
|
71
|
+
"eslint-plugin-yml": "3.3.1",
|
|
71
72
|
"eslint-processor-vue-blocks": "2.0.0",
|
|
72
|
-
"find-up-simple": "1.0.
|
|
73
|
-
"globals": "17.
|
|
74
|
-
"jsonc-eslint-parser": "2.4.2",
|
|
73
|
+
"find-up-simple": "1.0.1",
|
|
74
|
+
"globals": "17.4.0",
|
|
75
75
|
"local-pkg": "1.1.2",
|
|
76
76
|
"prettier": "3.8.1",
|
|
77
77
|
"vue-eslint-parser": "10.4.0",
|
|
78
78
|
"yaml-eslint-parser": "2.0.0"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
|
-
"@commitlint/cli": "20.
|
|
82
|
-
"@commitlint/config-conventional": "20.
|
|
83
|
-
"@eslint/config-inspector": "1.
|
|
84
|
-
"@rotki/eslint-plugin": "1.3.
|
|
85
|
-
"@types/node": "24.
|
|
81
|
+
"@commitlint/cli": "20.5.0",
|
|
82
|
+
"@commitlint/config-conventional": "20.5.0",
|
|
83
|
+
"@eslint/config-inspector": "1.5.0",
|
|
84
|
+
"@rotki/eslint-plugin": "1.3.2",
|
|
85
|
+
"@types/node": "24.12.0",
|
|
86
86
|
"@types/prompts": "2.4.9",
|
|
87
|
-
"bumpp": "
|
|
88
|
-
"eslint": "9.39.
|
|
89
|
-
"eslint-typegen": "2.3.
|
|
90
|
-
"execa": "
|
|
87
|
+
"bumpp": "11.0.1",
|
|
88
|
+
"eslint": "9.39.4",
|
|
89
|
+
"eslint-typegen": "2.3.1",
|
|
90
|
+
"execa": "9.6.1",
|
|
91
91
|
"husky": "9.1.7",
|
|
92
|
-
"lint-staged": "16.
|
|
93
|
-
"rimraf": "6.1.
|
|
94
|
-
"tinyglobby": "
|
|
95
|
-
"tsdown": "0.
|
|
92
|
+
"lint-staged": "16.4.0",
|
|
93
|
+
"rimraf": "6.1.3",
|
|
94
|
+
"tinyglobby": "0.2.15",
|
|
95
|
+
"tsdown": "0.21.7",
|
|
96
96
|
"tsx": "4.21.0",
|
|
97
97
|
"typescript": "5.9.3",
|
|
98
|
-
"vitest": "
|
|
99
|
-
"@rotki/eslint-config": "
|
|
98
|
+
"vitest": "4.1.2",
|
|
99
|
+
"@rotki/eslint-config": "6.1.0"
|
|
100
100
|
},
|
|
101
101
|
"engines": {
|
|
102
102
|
"node": ">=24 <25",
|