@cuiqg/eslint-config 2.2.2 → 2.2.3

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.
Files changed (2) hide show
  1. package/dist/index.js +4 -33
  2. package/package.json +2 -4
package/dist/index.js CHANGED
@@ -11,12 +11,6 @@ async function interopDefault(m) {
11
11
  const resolved = await m;
12
12
  return resolved.default || m;
13
13
  }
14
- function renameRules(rules, map) {
15
- return Object.fromEntries(Object.entries(rules).map(([key, value]) => {
16
- for (const [from, to] of Object.entries(map)) if (key.startsWith(`${from}/`)) return [to + key.slice(from.length), value];
17
- return [key, value];
18
- }));
19
- }
20
14
 
21
15
  //#endregion
22
16
  //#region src/configs/comments.js
@@ -851,29 +845,6 @@ const toml = async () => {
851
845
  }];
852
846
  };
853
847
 
854
- //#endregion
855
- //#region src/configs/typescript.js
856
- /**
857
- * TypeScript
858
- *
859
- * @see https://typescript-eslint.io/
860
- * @returns {import('eslint').Linter.FlatConfig[]}
861
- */
862
- async function typescript() {
863
- const files = [GLOB_TS, GLOB_TSX];
864
- const [pluginTs, parserTs] = await Promise.all([interopDefault(import("@typescript-eslint/eslint-plugin")), interopDefault(import("@typescript-eslint/parser"))]);
865
- return [{
866
- files,
867
- languageOptions: {
868
- parser: parserTs,
869
- parserOptions: { sourceType: "module" }
870
- },
871
- name: "cuiqg/typescript",
872
- plugins: { "ts": pluginTs },
873
- rules: { ...renameRules(pluginTs.configs["flat/recommended"].rules, { "@typescript-eslint": "ts" }) }
874
- }];
875
- }
876
-
877
848
  //#endregion
878
849
  //#region src/configs/unicorn.js
879
850
  /**
@@ -1144,10 +1115,11 @@ const defaultPluginRenaming = {
1144
1115
  "@stylistic": "style",
1145
1116
  "import-x": "import",
1146
1117
  "n": "node",
1147
- "yml": "yaml"
1118
+ "yml": "yaml",
1119
+ "@typescript-eslint": "ts"
1148
1120
  };
1149
1121
  function cuiqg(options = {}, ...userConfigs) {
1150
- const { prettier: enablePrettier = false, gitignore: enableGitignore = true, unocss: enableUnocss = hasUnocss, vue: enableVue = hasVue, stylistic: enableStylistic = true, typescript: enableTypescript = hasTypescript, jsdoc: enableJsdoc = false, pnpm: enablePnpm = false } = options;
1122
+ const { prettier: enablePrettier = false, gitignore: enableGitignore = true, unocss: enableUnocss = hasUnocss, vue: enableVue = hasVue, stylistic: enableStylistic = true, jsdoc: enableJsdoc = false, pnpm: enablePnpm = false } = options;
1151
1123
  const configs = [
1152
1124
  unplugin(),
1153
1125
  ignores(),
@@ -1171,7 +1143,6 @@ function cuiqg(options = {}, ...userConfigs) {
1171
1143
  if (enablePrettier) configs.push(prettier());
1172
1144
  if (enableJsdoc) configs.push(jsdoc());
1173
1145
  if (enablePnpm) configs.push(pnpm());
1174
- if (enableTypescript) configs.push(typescript());
1175
1146
  let composer = new FlatConfigComposer(...configs, ...userConfigs);
1176
1147
  composer = composer.renamePlugins(defaultPluginRenaming);
1177
1148
  return composer;
@@ -1182,4 +1153,4 @@ function cuiqg(options = {}, ...userConfigs) {
1182
1153
  var src_default = cuiqg;
1183
1154
 
1184
1155
  //#endregion
1185
- export { GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVG, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, comments, cuiqg, src_default as default, defaultPluginRenaming, disables, gitignore, hasTypescript, hasUnocss, hasVue, ignores, imports, interopDefault, isInEditor, isInGitHooksOrLintStaged, javascript, jsdoc, jsonc, macros, node, pnpm, prettier, renameRules, sortJsconfig, sortPackageJson, stylistic, toml, typescript, unicorn, unocss, unplugin, vue, yaml };
1156
+ export { GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVG, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, comments, cuiqg, src_default as default, defaultPluginRenaming, disables, gitignore, hasTypescript, hasUnocss, hasVue, ignores, imports, interopDefault, isInEditor, isInGitHooksOrLintStaged, javascript, jsdoc, jsonc, macros, node, pnpm, prettier, sortJsconfig, sortPackageJson, stylistic, toml, unicorn, unocss, unplugin, vue, yaml };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cuiqg/eslint-config",
3
- "version": "2.2.2",
3
+ "version": "2.2.3",
4
4
  "description": "ESLint config preset for @cuiqg",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
@@ -23,7 +23,7 @@
23
23
  "scripts": {
24
24
  "build": "tsdown",
25
25
  "build:inspector": "npx @eslint/config-inspector build",
26
- "dev": "npx @eslint/config-inspector --open false",
26
+ "lint:inspector": "npx @eslint/config-inspector --open false",
27
27
  "lint": "eslint .",
28
28
  "lint:fix": "eslint . --fix",
29
29
  "prepublishOnly": "npm run build",
@@ -31,8 +31,6 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "@stylistic/eslint-plugin": "^4.4.0",
34
- "@typescript-eslint/eslint-plugin": "^8.33.1",
35
- "@typescript-eslint/parser": "^8.33.1",
36
34
  "@unocss/eslint-plugin": "^66.1.2",
37
35
  "eslint-config-flat-gitignore": "^2.1.0",
38
36
  "eslint-flat-config-utils": "^2.1.0",