@vida0905/eslint-config 2.1.1 → 2.1.2

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/cli/index.js CHANGED
@@ -6,7 +6,7 @@ import path from "node:path";
6
6
  import { green } from "ansis";
7
7
 
8
8
  //#region package.json
9
- var version = "2.1.1";
9
+ var version = "2.1.2";
10
10
 
11
11
  //#endregion
12
12
  //#region src/cli/constants.ts
@@ -63,7 +63,7 @@ const vscodeSettingsString = `
63
63
  `;
64
64
 
65
65
  //#endregion
66
- //#region src/cli/update-vscode-settings.ts
66
+ //#region src/cli/update/update-vscode-settings.ts
67
67
  async function updateVSCodeSettings() {
68
68
  const cwd = process.cwd();
69
69
  const dotVscodePath = path.join(cwd, ".vscode");
@@ -83,17 +83,17 @@ async function updateVSCodeSettings() {
83
83
  }
84
84
 
85
85
  //#endregion
86
- //#region src/cli/run.ts
87
- async function run(options = {}) {
88
- if (options.vscode) await updateVSCodeSettings();
86
+ //#region src/cli/update/index.ts
87
+ async function update(files = []) {
88
+ if (files.includes("vscode")) await updateVSCodeSettings();
89
89
  }
90
90
 
91
91
  //#endregion
92
92
  //#region src/cli/index.ts
93
93
  const cli = cac("@vida0905/eslint-config");
94
- cli.command("update", "update configuration files").option("--vscode", "Update .vscode/settings.json").action(async (args) => {
94
+ cli.command("update [...files]", "Update configuration files for specified files").alias("up").option("vscode", "Update .vscode/settings.json").action(async (files) => {
95
95
  try {
96
- await run(args);
96
+ await update(files);
97
97
  } catch (error) {
98
98
  console.error(`✘ ${String(error)}`);
99
99
  process.exit(1);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vida0905/eslint-config",
3
3
  "type": "module",
4
- "version": "2.1.1",
4
+ "version": "2.1.2",
5
5
  "packageManager": "pnpm@10.4.1",
6
6
  "description": "Vida Xie's ESLint Config",
7
7
  "author": "Vida Xie <vida_2020@163.com> (https://github.com/9romise/)",
@@ -33,7 +33,7 @@
33
33
  "typegen": "tsx scripts/typegen",
34
34
  "typecheck": "tsc --noEmit",
35
35
  "lint": "eslint .",
36
- "lint:fix": "eslint . --fix",
36
+ "check": "npm run typecheck && npm run lint",
37
37
  "prepack": "npm run build",
38
38
  "prepare": "npm run typegen && simple-git-hooks"
39
39
  },
@@ -46,26 +46,25 @@
46
46
  "cac": "^6.7.14",
47
47
  "eslint-flat-config-utils": "^2.0.1",
48
48
  "eslint-import-resolver-oxc": "^0.11.0",
49
- "eslint-plugin-de-morgan": "^1.0.1",
49
+ "eslint-plugin-de-morgan": "^1.1.0",
50
50
  "eslint-plugin-pinia": "^0.4.1",
51
51
  "local-pkg": "^1.0.0"
52
52
  },
53
53
  "devDependencies": {
54
- "@eslint/config-inspector": "^1.0.0",
55
54
  "@types/node": "^22.13.4",
56
55
  "eslint": "^9.20.1",
57
56
  "eslint-typegen": "^2.0.0",
58
- "lint-staged": "^15.4.3",
57
+ "nano-staged": "^0.8.0",
59
58
  "oxc-transform": "^0.51.0",
60
59
  "simple-git-hooks": "^2.11.1",
61
60
  "tsdown": "^0.5.10",
62
- "tsx": "^4.19.2",
61
+ "tsx": "^4.19.3",
63
62
  "typescript": "^5.7.3"
64
63
  },
65
64
  "simple-git-hooks": {
66
- "pre-commit": "pnpm lint-staged"
65
+ "pre-commit": "npx nano-staged"
67
66
  },
68
- "lint-staged": {
67
+ "nano-staged": {
69
68
  "*": "eslint --fix"
70
69
  }
71
70
  }