@liangmi/vp-config 0.5.0 → 0.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/README.md CHANGED
@@ -32,7 +32,7 @@ Here are some real-world examples using `@liangmi/vp-config`.
32
32
  - `@liangmi/vp-config` uses itself to manage its own codebase.
33
33
 
34
34
  > [!WARNING]
35
- > Considering Vite+ is now still alpha, the internal API can be unstable and expected to change, please manage to use `@liangmi/vp-config` with the latest Vite+. If you found something that doesn't work expectedly, please [submit an issue](https://github.com/liangmiQwQ/vp-config/issues/new).
35
+ > This preset requires `vite-plus@1.0.0-rc.1`. Vite+ is still pre-stable, so keep the installed version aligned with the preset's peer dependency. If something does not work as expected, please [submit an issue](https://github.com/liangmiQwQ/vp-config/issues/new).
36
36
 
37
37
  ### Categories
38
38
 
@@ -90,7 +90,7 @@ Vite+ is a united toolchain for JavaScript development, it includes linting, for
90
90
 
91
91
  ### Lint
92
92
 
93
- The lint config prioritizes correctness and fast feedback. Rules that prevent bugs report errors, while style and fixable readability rules generally report warnings and are left to autofixes. Warnings also fail the lint command, keeping the codebase consistent without treating every style concern as a hand-written task.
93
+ The lint config prioritizes correctness and fast feedback. Rules that prevent bugs report errors, while selected style and fixable readability rules report warnings and are left to autofixes. Style rules are explicitly allowlisted to keep lint behavior stable across Oxlint upgrades: new upstream style rules stay disabled until they are reviewed and added. Warnings also fail the lint command, keeping the codebase consistent without treating every style concern as a hand-written task.
94
94
 
95
95
  All categories include a strict Oxlint config with type-aware linting and type checking enabled, which means you do not need to run `tsc` manually. Correctness, performance, suspicious, and nursery rules report errors.
96
96
 
@@ -126,6 +126,8 @@ In most cases, they should be treated more like cached versions of Vite+ command
126
126
  | `ccheck` | `vp check` |
127
127
  | `ctest` | `vp test` |
128
128
 
129
+ Task cache options belong under `run.tasks.<name>.cache`, including `input`, `output`, `env`, and `untrackedEnv`.
130
+
129
131
  Run them with `vp run <task>`, such as `vp run cpack`, or shorthand `vpr cpack`. They can also be used in `package.json` scripts while retaining Vite+ task caching.
130
132
 
131
133
  ### Staged files
package/dist/index.mjs CHANGED
@@ -74,34 +74,119 @@ const style = {
74
74
  "typescript/method-signature-style": ["warn", "property"],
75
75
  "unicorn/prefer-ternary": ["warn", "only-single-line"],
76
76
  "prefer-destructuring": ["warn", { array: false }],
77
- "import/exports-last": "off",
78
- "func-style": "off",
79
- "init-declarations": "off",
80
- "import/no-anonymous-default-export": "off",
81
- "unicorn/no-await-expression-member": "off",
82
- "unicorn/explicit-timer-delay": "off",
83
- "max-params": "off",
84
- "max-statements": "off",
85
- "no-continue": "off",
86
- "no-nested-ternary": "off",
87
- "unicorn/no-nested-ternary": "off",
88
- "no-magic-numbers": "off",
89
- "import/no-namespace": "off",
90
- "import/no-named-export": "off",
91
- "no-ternary": "off",
92
- "sort-imports": "off",
93
- "sort-keys": "off",
94
- "import/group-exports": "off",
95
- "import/no-nodejs-modules": "off",
96
- "import/prefer-default-export": "off",
97
- "prefer-await-to-then": "off",
98
- "unicorn/no-null": "off",
99
- "prefer-named-capture-group": "off",
100
- "id-length": "off",
101
- "promise/avoid-new": "off",
102
- "eslint/new-cap": "off",
103
- "eslint/no-template-curly-in-string": "off",
104
- "eslint/one-var": "off"
77
+ "arrow-body-style": "warn",
78
+ "capitalized-comments": "warn",
79
+ curly: "warn",
80
+ "default-case-last": "warn",
81
+ "default-param-last": "warn",
82
+ "func-name-matching": "warn",
83
+ "grouped-accessor-pairs": "warn",
84
+ "guard-for-in": "warn",
85
+ "id-denylist": "warn",
86
+ "id-match": "warn",
87
+ "logical-assignment-operators": "warn",
88
+ "no-extra-label": "warn",
89
+ "no-implicit-coercion": "warn",
90
+ "no-label-var": "warn",
91
+ "no-labels": "warn",
92
+ "no-lone-blocks": "warn",
93
+ "no-multi-assign": "warn",
94
+ "no-multi-str": "warn",
95
+ "no-new-func": "warn",
96
+ "no-return-assign": "warn",
97
+ "no-script-url": "warn",
98
+ "no-useless-computed-key": "warn",
99
+ "object-shorthand": "warn",
100
+ "operator-assignment": "warn",
101
+ "prefer-arrow-callback": "warn",
102
+ "prefer-const": "warn",
103
+ "prefer-exponentiation-operator": "warn",
104
+ "prefer-numeric-literals": "warn",
105
+ "prefer-object-has-own": "warn",
106
+ "prefer-object-spread": "warn",
107
+ "prefer-regex-literals": "warn",
108
+ "prefer-rest-params": "warn",
109
+ "prefer-spread": "warn",
110
+ "prefer-template": "warn",
111
+ "vars-on-top": "warn",
112
+ yoda: "warn",
113
+ "import/consistent-type-specifier-style": "warn",
114
+ "import/first": "warn",
115
+ "import/newline-after-import": "warn",
116
+ "import/no-duplicates": "warn",
117
+ "import/no-mutable-exports": "warn",
118
+ "import/no-named-default": "warn",
119
+ "promise/no-nesting": "warn",
120
+ "promise/no-return-wrap": "warn",
121
+ "promise/param-names": "warn",
122
+ "promise/prefer-await-to-callbacks": "warn",
123
+ "promise/prefer-catch": "warn",
124
+ "typescript/adjacent-overload-signatures": "warn",
125
+ "typescript/array-type": "warn",
126
+ "typescript/ban-tslint-comment": "warn",
127
+ "typescript/class-literal-property-style": "warn",
128
+ "typescript/consistent-generic-constructors": "warn",
129
+ "typescript/consistent-type-assertions": "warn",
130
+ "typescript/consistent-type-exports": "warn",
131
+ "typescript/consistent-type-imports": "warn",
132
+ "typescript/dot-notation": "warn",
133
+ "typescript/no-empty-interface": "warn",
134
+ "typescript/no-inferrable-types": "warn",
135
+ "typescript/no-unnecessary-qualifier": "warn",
136
+ "typescript/parameter-properties": "warn",
137
+ "typescript/prefer-find": "warn",
138
+ "typescript/prefer-for-of": "warn",
139
+ "typescript/prefer-function-type": "warn",
140
+ "typescript/prefer-readonly": "warn",
141
+ "typescript/prefer-reduce-type-parameter": "warn",
142
+ "typescript/prefer-regexp-exec": "warn",
143
+ "typescript/prefer-return-this-type": "warn",
144
+ "typescript/prefer-string-starts-ends-with": "warn",
145
+ "typescript/unified-signatures": "warn",
146
+ "unicorn/catch-error-name": "warn",
147
+ "unicorn/consistent-date-clone": "warn",
148
+ "unicorn/consistent-existence-index-check": "warn",
149
+ "unicorn/consistent-template-literal-escape": "warn",
150
+ "unicorn/custom-error-definition": "warn",
151
+ "unicorn/empty-brace-spaces": "warn",
152
+ "unicorn/error-message": "warn",
153
+ "unicorn/filename-case": "warn",
154
+ "unicorn/max-nested-calls": "warn",
155
+ "unicorn/no-array-method-this-argument": "warn",
156
+ "unicorn/no-console-spaces": "warn",
157
+ "unicorn/no-unreadable-array-destructuring": "warn",
158
+ "unicorn/no-useless-collection-argument": "warn",
159
+ "unicorn/no-zero-fractions": "warn",
160
+ "unicorn/number-literal-case": "warn",
161
+ "unicorn/numeric-separators-style": "warn",
162
+ "unicorn/prefer-array-index-of": "warn",
163
+ "unicorn/prefer-bigint-literals": "warn",
164
+ "unicorn/prefer-class-fields": "warn",
165
+ "unicorn/prefer-classlist-toggle": "warn",
166
+ "unicorn/prefer-default-parameters": "warn",
167
+ "unicorn/prefer-dom-node-text-content": "warn",
168
+ "unicorn/prefer-export-from": "warn",
169
+ "unicorn/prefer-global-this": "warn",
170
+ "unicorn/prefer-includes": "warn",
171
+ "unicorn/prefer-keyboard-event-key": "warn",
172
+ "unicorn/prefer-logical-operator-over-ternary": "warn",
173
+ "unicorn/prefer-modern-dom-apis": "warn",
174
+ "unicorn/prefer-negative-index": "warn",
175
+ "unicorn/prefer-object-from-entries": "warn",
176
+ "unicorn/prefer-optional-catch-binding": "warn",
177
+ "unicorn/prefer-reflect-apply": "warn",
178
+ "unicorn/prefer-response-static-json": "warn",
179
+ "unicorn/prefer-spread": "warn",
180
+ "unicorn/prefer-string-raw": "warn",
181
+ "unicorn/prefer-string-trim-start-end": "warn",
182
+ "unicorn/prefer-structured-clone": "warn",
183
+ "unicorn/relative-url-style": "warn",
184
+ "unicorn/require-array-join-separator": "warn",
185
+ "unicorn/require-module-attributes": "warn",
186
+ "unicorn/switch-case-braces": "warn",
187
+ "unicorn/switch-case-break-position": "warn",
188
+ "unicorn/text-encoding-identifier-case": "warn",
189
+ "unicorn/throw-new-error": "warn"
105
190
  };
106
191
  const restriction = {
107
192
  "oxc/bad-bitwise-operator": "error",
@@ -216,7 +301,7 @@ const lintBase = {
216
301
  perf: "error",
217
302
  suspicious: "error",
218
303
  nursery: "error",
219
- style: "warn",
304
+ style: "off",
220
305
  restriction: "off",
221
306
  pedantic: "off"
222
307
  },
@@ -309,13 +394,13 @@ const runBase = { tasks: {
309
394
  cbuild: "vp build",
310
395
  ccheck: {
311
396
  command: "vp check",
312
- input: lintInput
397
+ cache: { input: lintInput }
313
398
  },
314
399
  cfmt: "vp fmt",
315
400
  cformat: "vp format",
316
401
  clint: {
317
402
  command: "vp lint",
318
- input: lintInput
403
+ cache: { input: lintInput }
319
404
  },
320
405
  cpack: "vp pack",
321
406
  ctest: "vp test"
@@ -425,7 +510,7 @@ const libConfig = {
425
510
  pack: {
426
511
  fixedExtension: true,
427
512
  exports: true,
428
- dts: { tsgo: true }
513
+ dts: { generator: "tsgo" }
429
514
  },
430
515
  run: runBase,
431
516
  staged: stagedBase
@@ -3,8 +3,8 @@ declare const configNames: readonly ["base", "cli", "lib", "website"];
3
3
  type ConfigName = (typeof configNames)[number];
4
4
  //#endregion
5
5
  //#region src/oxlint-plugin/project.d.ts
6
- declare function getAllowedConfigNames(filename: string): readonly ConfigName[];
7
- declare function isVpConfigImportAllowed(filename: string, importedNames: readonly string[]): boolean;
6
+ export declare function getAllowedConfigNames(filename: string): readonly ConfigName[];
7
+ export declare function isVpConfigImportAllowed(filename: string, importedNames: readonly string[]): boolean;
8
8
  //#endregion
9
9
  //#region src/oxlint-plugin/info.d.ts
10
10
  interface VpConfigRuntimeInfo {
@@ -25,12 +25,12 @@ interface RuntimeConfigInput {
25
25
  category?: ConfigName;
26
26
  config: Record<string, unknown>;
27
27
  }
28
- declare function getInfoPath(configDirectory: string): string;
29
- declare function readRuntimeInfo(configDirectory: string): VpConfigRuntimeInfo | undefined;
30
- declare function writeRuntimeInfo(input: RuntimeConfigInput): void;
31
- declare function cleanupRuntimeInfo(configDirectory: string): void;
28
+ export declare function getInfoPath(configDirectory: string): string;
29
+ export declare function readRuntimeInfo(configDirectory: string): VpConfigRuntimeInfo | undefined;
30
+ export declare function writeRuntimeInfo(input: RuntimeConfigInput): void;
31
+ export declare function cleanupRuntimeInfo(configDirectory: string): void;
32
32
  //#endregion
33
33
  //#region src/oxlint-plugin/index.d.ts
34
- declare const _default: import("@oxlint/plugins").Plugin;
34
+ declare const _default: import("vite-plus/lint/plugins").Plugin;
35
35
  //#endregion
36
- export { cleanupRuntimeInfo, _default as default, getAllowedConfigNames, getInfoPath, isVpConfigImportAllowed, readRuntimeInfo, writeRuntimeInfo };
36
+ export { _default as default };
@@ -1,7 +1,7 @@
1
1
  import { a as isProject, c as writeRuntimeInfo, d as projectConfigNames, f as rootConfigNames, i as isLibProject, l as packageName, n as ensureRuntimeInfo, o as isWebsiteProject, p as viteConfigNames, r as getInfoPath, s as readRuntimeInfo, t as cleanupRuntimeInfo, u as pluginName } from "../info-DJqaJFGi.mjs";
2
2
  import { existsSync } from "node:fs";
3
3
  import { basename, dirname, join } from "node:path";
4
- import { definePlugin, defineRule } from "@oxlint/plugins";
4
+ import { definePlugin, defineRule } from "vite-plus/lint/plugins";
5
5
  //#region src/oxlint-plugin/ast.ts
6
6
  function isVpConfigSpecifier(specifier) {
7
7
  return specifier === packageName;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@liangmi/vp-config",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "Liang's JavaScript development toolchain config with Vite+.",
5
5
  "homepage": "https://github.com/liangmiQwQ/vp-config#readme",
6
6
  "bugs": {
@@ -25,16 +25,15 @@
25
25
  "access": "public"
26
26
  },
27
27
  "devDependencies": {
28
- "@types/node": "^26.4.0",
28
+ "@types/node": "^26.6.3",
29
29
  "@typescript/native-preview": "7.0.0-dev.20260707.2",
30
- "bumpp": "^12.2.2",
30
+ "bumpp": "^12.3.0",
31
31
  "typescript": "^7.0.2",
32
- "vite": "npm:@voidzero-dev/vite-plus-core@0.3.0",
33
- "vite-plus": "0.3.0"
32
+ "vite": "npm:@voidzero-dev/vite-plus-core@1.0.0-rc.1",
33
+ "vite-plus": "1.0.0-rc.1"
34
34
  },
35
35
  "peerDependencies": {
36
- "@oxlint/plugins": "1.61.0",
37
- "vite-plus": "0.3.0"
36
+ "vite-plus": "1.0.0-rc.1"
38
37
  },
39
38
  "scripts": {
40
39
  "build": "vp run cpack",