@rotki/eslint-config 2.4.5 → 2.6.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 CHANGED
@@ -99,7 +99,7 @@ var import_local_pkg2 = require("local-pkg");
99
99
  // src/plugins.ts
100
100
  var import_eslint_plugin_antfu = __toESM(require("eslint-plugin-antfu"), 1);
101
101
  var import_eslint_plugin_eslint_comments = __toESM(require("eslint-plugin-eslint-comments"), 1);
102
- var pluginImport = __toESM(require("eslint-plugin-i"), 1);
102
+ var pluginImport = __toESM(require("eslint-plugin-import-x"), 1);
103
103
  var import_eslint_plugin_n = __toESM(require("eslint-plugin-n"), 1);
104
104
  var import_eslint_plugin_unicorn = __toESM(require("eslint-plugin-unicorn"), 1);
105
105
  var import_eslint_plugin_unused_imports = __toESM(require("eslint-plugin-unused-imports"), 1);
@@ -180,6 +180,34 @@ async function ensurePackages(packages) {
180
180
  if (result)
181
181
  await import("@antfu/install-pkg").then((i) => i.installPackage(nonExistingPackages, { dev: true }));
182
182
  }
183
+ function renameRules(rules, map) {
184
+ return Object.fromEntries(
185
+ Object.entries(rules).map(([key, value]) => {
186
+ for (const [from, to] of Object.entries(map)) {
187
+ if (key.startsWith(`${from}/`))
188
+ return [to + key.slice(from.length), value];
189
+ }
190
+ return [key, value];
191
+ })
192
+ );
193
+ }
194
+ function renamePluginInConfigs(configs, map) {
195
+ return configs.map((i) => {
196
+ const clone = { ...i };
197
+ if (clone.rules)
198
+ clone.rules = renameRules(clone.rules, map);
199
+ if (clone.plugins) {
200
+ clone.plugins = Object.fromEntries(
201
+ Object.entries(clone.plugins).map(([key, value]) => {
202
+ if (key in map)
203
+ return [map[key], value];
204
+ return [key, value];
205
+ })
206
+ );
207
+ }
208
+ return clone;
209
+ });
210
+ }
183
211
 
184
212
  // src/globs.ts
185
213
  var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
@@ -1159,6 +1187,22 @@ function sortPackageJson() {
1159
1187
  {
1160
1188
  order: ["types", "require", "import", "default"],
1161
1189
  pathPattern: "^exports.*$"
1190
+ },
1191
+ {
1192
+ order: [
1193
+ // client hooks only
1194
+ "pre-commit",
1195
+ "prepare-commit-msg",
1196
+ "commit-msg",
1197
+ "post-commit",
1198
+ "pre-rebase",
1199
+ "post-rewrite",
1200
+ "post-checkout",
1201
+ "post-merge",
1202
+ "pre-push",
1203
+ "pre-auto-gc"
1204
+ ],
1205
+ pathPattern: "^(?:gitHooks|husky|simple-git-hooks)$"
1162
1206
  }
1163
1207
  ]
1164
1208
  }
@@ -1693,6 +1737,26 @@ async function vue(options = {}) {
1693
1737
  };
1694
1738
  return [
1695
1739
  {
1740
+ // This allows Vue plugin to work with auto imports
1741
+ // https://github.com/vuejs/eslint-plugin-vue/pull/2422
1742
+ languageOptions: {
1743
+ globals: {
1744
+ computed: "readonly",
1745
+ defineEmits: "readonly",
1746
+ defineExpose: "readonly",
1747
+ defineProps: "readonly",
1748
+ onMounted: "readonly",
1749
+ onUnmounted: "readonly",
1750
+ reactive: "readonly",
1751
+ ref: "readonly",
1752
+ shallowReactive: "readonly",
1753
+ shallowRef: "readonly",
1754
+ toRef: "readonly",
1755
+ toRefs: "readonly",
1756
+ watch: "readonly",
1757
+ watchEffect: "readonly"
1758
+ }
1759
+ },
1696
1760
  plugins: {
1697
1761
  vue: pluginVue
1698
1762
  }
@@ -2095,6 +2159,12 @@ var VuePackages = [
2095
2159
  "vitepress",
2096
2160
  "@slidev/cli"
2097
2161
  ];
2162
+ var defaultPluginRenaming = {
2163
+ "import-x": "import",
2164
+ "n": "node",
2165
+ "vitest": "test",
2166
+ "yml": "yaml"
2167
+ };
2098
2168
  async function rotki(options = {}, ...userConfigs) {
2099
2169
  const {
2100
2170
  componentExts = [],
@@ -2234,11 +2304,11 @@ async function rotki(options = {}, ...userConfigs) {
2234
2304
  }, {});
2235
2305
  if (Object.keys(fusedConfig).length > 0)
2236
2306
  configs.push([fusedConfig]);
2237
- const merged = combine(
2307
+ const merged = await combine(
2238
2308
  ...configs,
2239
2309
  ...userConfigs
2240
2310
  );
2241
- return merged;
2311
+ return renamePluginInConfigs(merged, defaultPluginRenaming);
2242
2312
  }
2243
2313
  function resolveSubOptions(options, key) {
2244
2314
  return typeof options[key] === "boolean" ? {} : options[key] || {};
package/dist/index.d.cts CHANGED
@@ -9,8 +9,8 @@ import { Rules as Rules$1 } from 'eslint-plugin-antfu';
9
9
  export { default as pluginAntfu } from 'eslint-plugin-antfu';
10
10
  import { StylisticCustomizeOptions, UnprefixedRuleOptions } from '@stylistic/eslint-plugin';
11
11
  export { default as pluginComments } from 'eslint-plugin-eslint-comments';
12
- import * as eslintPluginI from 'eslint-plugin-i';
13
- export { eslintPluginI as pluginImport };
12
+ import * as eslintPluginImportX from 'eslint-plugin-import-x';
13
+ export { eslintPluginImportX as pluginImport };
14
14
  export { default as pluginNode } from 'eslint-plugin-n';
15
15
  export { default as pluginUnicorn } from 'eslint-plugin-unicorn';
16
16
  export { default as pluginUnusedImports } from 'eslint-plugin-unused-imports';
@@ -83,42 +83,42 @@ interface VuetifyRules {
83
83
 
84
84
  interface VueI18nRules {
85
85
  'key-format-style': RuleConfig<['camelCase' | 'kebab-case' | 'snake_case', {
86
- 'allowArray'?: boolean;
87
- 'splitByDots'?: boolean;
86
+ allowArray?: boolean;
87
+ splitByDots?: boolean;
88
88
  }]>;
89
89
  'no-deprecated-i18n-component': RuleConfig<[]>;
90
90
  'no-deprecated-i18n-place-attr': RuleConfig<[]>;
91
91
  'no-deprecated-i18n-places-prop': RuleConfig<[]>;
92
92
  'no-duplicate-keys-in-locale': RuleConfig<[{
93
- 'ignoreI18nBlock'?: boolean;
93
+ ignoreI18nBlock?: boolean;
94
94
  }]>;
95
95
  'no-dynamic-keys': RuleConfig<[]>;
96
96
  'no-html-messages': RuleConfig<[]>;
97
97
  'no-i18n-t-path-prop': RuleConfig<[]>;
98
98
  'no-missing-keys': RuleConfig<[]>;
99
99
  'no-missing-keys-in-other-locales': RuleConfig<[{
100
- 'ignoreLocales'?: string[];
100
+ ignoreLocales?: string[];
101
101
  }]>;
102
102
  'no-raw-text': RuleConfig<[
103
103
  {
104
- 'attributes'?: Record<string, string[]>;
105
- 'ignoreNodes'?: string[];
106
- 'ignorePattern'?: string;
107
- 'ignoreText'?: string[];
104
+ attributes?: Record<string, string[]>;
105
+ ignoreNodes?: string[];
106
+ ignorePattern?: string;
107
+ ignoreText?: string[];
108
108
  }
109
109
  ]>;
110
110
  'no-unknown-locale': RuleConfig<[
111
111
  {
112
- 'locales'?: string[];
113
- 'disableRFC5646'?: boolean;
112
+ locales?: string[];
113
+ disableRFC5646?: boolean;
114
114
  }
115
115
  ]>;
116
116
  'no-unused-keys': RuleConfig<[
117
117
  {
118
- 'src'?: string;
119
- 'extensions'?: string[];
120
- 'ignores'?: string[];
121
- 'enableFix'?: boolean;
118
+ src?: string;
119
+ extensions?: string[];
120
+ ignores?: string[];
121
+ enableFix?: boolean;
122
122
  }
123
123
  ]>;
124
124
  'no-v-html': RuleConfig<[]>;
package/dist/index.d.ts CHANGED
@@ -9,8 +9,8 @@ import { Rules as Rules$1 } from 'eslint-plugin-antfu';
9
9
  export { default as pluginAntfu } from 'eslint-plugin-antfu';
10
10
  import { StylisticCustomizeOptions, UnprefixedRuleOptions } from '@stylistic/eslint-plugin';
11
11
  export { default as pluginComments } from 'eslint-plugin-eslint-comments';
12
- import * as eslintPluginI from 'eslint-plugin-i';
13
- export { eslintPluginI as pluginImport };
12
+ import * as eslintPluginImportX from 'eslint-plugin-import-x';
13
+ export { eslintPluginImportX as pluginImport };
14
14
  export { default as pluginNode } from 'eslint-plugin-n';
15
15
  export { default as pluginUnicorn } from 'eslint-plugin-unicorn';
16
16
  export { default as pluginUnusedImports } from 'eslint-plugin-unused-imports';
@@ -83,42 +83,42 @@ interface VuetifyRules {
83
83
 
84
84
  interface VueI18nRules {
85
85
  'key-format-style': RuleConfig<['camelCase' | 'kebab-case' | 'snake_case', {
86
- 'allowArray'?: boolean;
87
- 'splitByDots'?: boolean;
86
+ allowArray?: boolean;
87
+ splitByDots?: boolean;
88
88
  }]>;
89
89
  'no-deprecated-i18n-component': RuleConfig<[]>;
90
90
  'no-deprecated-i18n-place-attr': RuleConfig<[]>;
91
91
  'no-deprecated-i18n-places-prop': RuleConfig<[]>;
92
92
  'no-duplicate-keys-in-locale': RuleConfig<[{
93
- 'ignoreI18nBlock'?: boolean;
93
+ ignoreI18nBlock?: boolean;
94
94
  }]>;
95
95
  'no-dynamic-keys': RuleConfig<[]>;
96
96
  'no-html-messages': RuleConfig<[]>;
97
97
  'no-i18n-t-path-prop': RuleConfig<[]>;
98
98
  'no-missing-keys': RuleConfig<[]>;
99
99
  'no-missing-keys-in-other-locales': RuleConfig<[{
100
- 'ignoreLocales'?: string[];
100
+ ignoreLocales?: string[];
101
101
  }]>;
102
102
  'no-raw-text': RuleConfig<[
103
103
  {
104
- 'attributes'?: Record<string, string[]>;
105
- 'ignoreNodes'?: string[];
106
- 'ignorePattern'?: string;
107
- 'ignoreText'?: string[];
104
+ attributes?: Record<string, string[]>;
105
+ ignoreNodes?: string[];
106
+ ignorePattern?: string;
107
+ ignoreText?: string[];
108
108
  }
109
109
  ]>;
110
110
  'no-unknown-locale': RuleConfig<[
111
111
  {
112
- 'locales'?: string[];
113
- 'disableRFC5646'?: boolean;
112
+ locales?: string[];
113
+ disableRFC5646?: boolean;
114
114
  }
115
115
  ]>;
116
116
  'no-unused-keys': RuleConfig<[
117
117
  {
118
- 'src'?: string;
119
- 'extensions'?: string[];
120
- 'ignores'?: string[];
121
- 'enableFix'?: boolean;
118
+ src?: string;
119
+ extensions?: string[];
120
+ ignores?: string[];
121
+ enableFix?: boolean;
122
122
  }
123
123
  ]>;
124
124
  'no-v-html': RuleConfig<[]>;
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import { isPackageExists as isPackageExists2 } from "local-pkg";
6
6
  // src/plugins.ts
7
7
  import { default as default2 } from "eslint-plugin-antfu";
8
8
  import { default as default3 } from "eslint-plugin-eslint-comments";
9
- import * as pluginImport from "eslint-plugin-i";
9
+ import * as pluginImport from "eslint-plugin-import-x";
10
10
  import { default as default4 } from "eslint-plugin-n";
11
11
  import { default as default5 } from "eslint-plugin-unicorn";
12
12
  import { default as default6 } from "eslint-plugin-unused-imports";
@@ -87,6 +87,34 @@ async function ensurePackages(packages) {
87
87
  if (result)
88
88
  await import("@antfu/install-pkg").then((i) => i.installPackage(nonExistingPackages, { dev: true }));
89
89
  }
90
+ function renameRules(rules, map) {
91
+ return Object.fromEntries(
92
+ Object.entries(rules).map(([key, value]) => {
93
+ for (const [from, to] of Object.entries(map)) {
94
+ if (key.startsWith(`${from}/`))
95
+ return [to + key.slice(from.length), value];
96
+ }
97
+ return [key, value];
98
+ })
99
+ );
100
+ }
101
+ function renamePluginInConfigs(configs, map) {
102
+ return configs.map((i) => {
103
+ const clone = { ...i };
104
+ if (clone.rules)
105
+ clone.rules = renameRules(clone.rules, map);
106
+ if (clone.plugins) {
107
+ clone.plugins = Object.fromEntries(
108
+ Object.entries(clone.plugins).map(([key, value]) => {
109
+ if (key in map)
110
+ return [map[key], value];
111
+ return [key, value];
112
+ })
113
+ );
114
+ }
115
+ return clone;
116
+ });
117
+ }
90
118
 
91
119
  // src/globs.ts
92
120
  var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
@@ -1066,6 +1094,22 @@ function sortPackageJson() {
1066
1094
  {
1067
1095
  order: ["types", "require", "import", "default"],
1068
1096
  pathPattern: "^exports.*$"
1097
+ },
1098
+ {
1099
+ order: [
1100
+ // client hooks only
1101
+ "pre-commit",
1102
+ "prepare-commit-msg",
1103
+ "commit-msg",
1104
+ "post-commit",
1105
+ "pre-rebase",
1106
+ "post-rewrite",
1107
+ "post-checkout",
1108
+ "post-merge",
1109
+ "pre-push",
1110
+ "pre-auto-gc"
1111
+ ],
1112
+ pathPattern: "^(?:gitHooks|husky|simple-git-hooks)$"
1069
1113
  }
1070
1114
  ]
1071
1115
  }
@@ -1600,6 +1644,26 @@ async function vue(options = {}) {
1600
1644
  };
1601
1645
  return [
1602
1646
  {
1647
+ // This allows Vue plugin to work with auto imports
1648
+ // https://github.com/vuejs/eslint-plugin-vue/pull/2422
1649
+ languageOptions: {
1650
+ globals: {
1651
+ computed: "readonly",
1652
+ defineEmits: "readonly",
1653
+ defineExpose: "readonly",
1654
+ defineProps: "readonly",
1655
+ onMounted: "readonly",
1656
+ onUnmounted: "readonly",
1657
+ reactive: "readonly",
1658
+ ref: "readonly",
1659
+ shallowReactive: "readonly",
1660
+ shallowRef: "readonly",
1661
+ toRef: "readonly",
1662
+ toRefs: "readonly",
1663
+ watch: "readonly",
1664
+ watchEffect: "readonly"
1665
+ }
1666
+ },
1603
1667
  plugins: {
1604
1668
  vue: pluginVue
1605
1669
  }
@@ -2002,6 +2066,12 @@ var VuePackages = [
2002
2066
  "vitepress",
2003
2067
  "@slidev/cli"
2004
2068
  ];
2069
+ var defaultPluginRenaming = {
2070
+ "import-x": "import",
2071
+ "n": "node",
2072
+ "vitest": "test",
2073
+ "yml": "yaml"
2074
+ };
2005
2075
  async function rotki(options = {}, ...userConfigs) {
2006
2076
  const {
2007
2077
  componentExts = [],
@@ -2141,11 +2211,11 @@ async function rotki(options = {}, ...userConfigs) {
2141
2211
  }, {});
2142
2212
  if (Object.keys(fusedConfig).length > 0)
2143
2213
  configs.push([fusedConfig]);
2144
- const merged = combine(
2214
+ const merged = await combine(
2145
2215
  ...configs,
2146
2216
  ...userConfigs
2147
2217
  );
2148
- return merged;
2218
+ return renamePluginInConfigs(merged, defaultPluginRenaming);
2149
2219
  }
2150
2220
  function resolveSubOptions(options, key) {
2151
2221
  return typeof options[key] === "boolean" ? {} : options[key] || {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rotki/eslint-config",
3
- "version": "2.4.5",
4
- "packageManager": "pnpm@8.14.3",
3
+ "version": "2.6.0",
4
+ "packageManager": "pnpm@8.15.5",
5
5
  "type": "module",
6
6
  "license": "AGPL-3.0",
7
7
  "bugs": {
@@ -51,57 +51,57 @@
51
51
  "dependencies": {
52
52
  "@antfu/eslint-define-config": "1.23.0-2",
53
53
  "@antfu/install-pkg": "0.3.1",
54
- "@eslint-types/typescript-eslint": "6.18.1",
55
- "@eslint-types/unicorn": "50.0.1",
56
- "@stylistic/eslint-plugin": "1.5.4",
57
- "@typescript-eslint/eslint-plugin": "6.19.1",
58
- "@typescript-eslint/parser": "6.19.1",
59
- "eslint-config-flat-gitignore": "0.1.2",
54
+ "@eslint-types/typescript-eslint": "7.2.0",
55
+ "@eslint-types/unicorn": "51.0.1",
56
+ "@stylistic/eslint-plugin": "1.7.0",
57
+ "@typescript-eslint/eslint-plugin": "7.3.1",
58
+ "@typescript-eslint/parser": "7.3.1",
59
+ "eslint-config-flat-gitignore": "0.1.3",
60
60
  "eslint-config-prettier": "9.1.0",
61
61
  "eslint-merge-processors": "0.1.0",
62
62
  "eslint-plugin-antfu": "2.1.2",
63
63
  "eslint-plugin-eslint-comments": "3.2.0",
64
64
  "eslint-plugin-format": "0.1.0",
65
- "eslint-plugin-html": "7.1.0",
66
- "eslint-plugin-i": "2.29.1",
67
- "eslint-plugin-jsonc": "2.13.0",
68
- "eslint-plugin-markdown": "3.0.1",
65
+ "eslint-plugin-html": "8.0.0",
66
+ "eslint-plugin-import-x": "0.4.1",
67
+ "eslint-plugin-jsonc": "2.14.1",
68
+ "eslint-plugin-markdown": "4.0.1",
69
69
  "eslint-plugin-n": "16.6.2",
70
70
  "eslint-plugin-no-only-tests": "3.1.0",
71
- "eslint-plugin-perfectionist": "2.5.0",
71
+ "eslint-plugin-perfectionist": "2.7.0",
72
72
  "eslint-plugin-prettier": "5.1.3",
73
- "eslint-plugin-unicorn": "50.0.1",
74
- "eslint-plugin-unused-imports": "3.0.0",
75
- "eslint-plugin-vitest": "0.3.20",
76
- "eslint-plugin-vue": "9.20.1",
77
- "eslint-plugin-yml": "1.12.2",
73
+ "eslint-plugin-unicorn": "51.0.1",
74
+ "eslint-plugin-unused-imports": "3.1.0",
75
+ "eslint-plugin-vitest": "0.3.26",
76
+ "eslint-plugin-vue": "9.23.0",
77
+ "eslint-plugin-yml": "1.13.2",
78
78
  "eslint-processor-vue-blocks": "0.1.1",
79
- "globals": "13.24.0",
79
+ "globals": "14.0.0",
80
80
  "jsonc-eslint-parser": "2.4.0",
81
81
  "local-pkg": "0.5.0",
82
- "prettier": "3.2.4",
82
+ "prettier": "3.2.5",
83
83
  "prompts": "2.4.2",
84
84
  "vue-eslint-parser": "9.4.2",
85
85
  "yaml-eslint-parser": "1.2.2"
86
86
  },
87
87
  "devDependencies": {
88
- "@commitlint/cli": "18.5.0",
89
- "@commitlint/config-conventional": "18.5.0",
88
+ "@commitlint/cli": "19.2.1",
89
+ "@commitlint/config-conventional": "19.1.0",
90
90
  "@rotki/eslint-config": "*",
91
- "@types/eslint": "8.56.2",
92
- "@types/node": "20.11.6",
91
+ "@types/eslint": "8.56.6",
92
+ "@types/node": "20.11.30",
93
93
  "@types/prompts": "2.4.9",
94
- "bumpp": "9.3.0",
95
- "eslint": "8.56.0",
96
- "eslint-flat-config-viewer": "0.1.11",
97
- "husky": "8.0.3",
98
- "lint-staged": "15.2.0",
94
+ "bumpp": "9.4.0",
95
+ "eslint": "8.57.0",
96
+ "eslint-flat-config-viewer": "0.1.14",
97
+ "husky": "9.0.11",
98
+ "lint-staged": "15.2.2",
99
99
  "rimraf": "5.0.5",
100
- "tsup": "8.0.1",
101
- "typescript": "5.3.3"
100
+ "tsup": "8.0.2",
101
+ "typescript": "5.4.3"
102
102
  },
103
103
  "engines": {
104
- "node": ">=16 <19",
104
+ "node": ">=20 <21",
105
105
  "pnpm": ">=8 <9"
106
106
  },
107
107
  "lint-staged": {