@liangmi/vp-config 0.1.2 → 0.2.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 +12 -1
- package/dist/index.mjs +23 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,6 +20,17 @@ export default base({
|
|
|
20
20
|
});
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
+
We provide a skill for agent to handle migrations automatically
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
skills add liangmiQwQ/vp-config
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Here are some real-world examples using `@liangmi/vp-config`.
|
|
30
|
+
|
|
31
|
+
- `mo` is cli and tui tool to help you manage your opensource projects.
|
|
32
|
+
- `@liangmi/vp-config` uses itself to manage its own codebase.
|
|
33
|
+
|
|
23
34
|
> [!WARNING]
|
|
24
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).
|
|
25
36
|
|
|
@@ -36,7 +47,7 @@ We provide four config categories for different kinds of projects.
|
|
|
36
47
|
|
|
37
48
|
The `website` category is experimental and its defaults may change before the package reaches a stable release. React and browser linting are available, but Vue template linting is still waiting for [better Vue support in Oxlint](https://github.com/oxc-project/oxc/issues/15761).
|
|
38
49
|
|
|
39
|
-
For monorepos, different presets should be used in combination. We should use `base` the workspace root, and use other categories as needed.
|
|
50
|
+
For monorepos, [Vite+ do not support nested `lint`/`fmt` config for now](https://github.com/voidzero-dev/vite-plus/issues/997). In the future, different presets should be used in combination. We should use `base` the workspace root, and use other categories as needed.
|
|
40
51
|
|
|
41
52
|
### Customizable
|
|
42
53
|
|
package/dist/index.mjs
CHANGED
|
@@ -52,6 +52,7 @@ const componentOverride = {
|
|
|
52
52
|
"react/jsx-props-no-spreading": "off"
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
|
+
const tuiOverride = mergeConfig(cliOverride, componentOverride);
|
|
55
56
|
//#endregion
|
|
56
57
|
//#region src/base/lint.ts
|
|
57
58
|
const suspicious = {
|
|
@@ -94,7 +95,9 @@ const style = {
|
|
|
94
95
|
"unicorn/no-null": "off",
|
|
95
96
|
"prefer-named-capture-group": "off",
|
|
96
97
|
"id-length": "off",
|
|
97
|
-
"promise/avoid-new": "off"
|
|
98
|
+
"promise/avoid-new": "off",
|
|
99
|
+
"eslint/new-cap": "off",
|
|
100
|
+
"eslint/no-template-curly-in-string": "off"
|
|
98
101
|
};
|
|
99
102
|
const restriction = {
|
|
100
103
|
"oxc/bad-bitwise-operator": "error",
|
|
@@ -247,6 +250,7 @@ const lintBase = {
|
|
|
247
250
|
reportUnusedDisableDirectives: "warn",
|
|
248
251
|
respectEslintDisableDirectives: false
|
|
249
252
|
},
|
|
253
|
+
ignorePatterns: ["bin/**"],
|
|
250
254
|
overrides: [
|
|
251
255
|
{
|
|
252
256
|
env: {
|
|
@@ -293,7 +297,11 @@ const lintBase = {
|
|
|
293
297
|
};
|
|
294
298
|
//#endregion
|
|
295
299
|
//#region src/base/run.ts
|
|
296
|
-
const lintInput = [
|
|
300
|
+
const lintInput = [
|
|
301
|
+
{ auto: true },
|
|
302
|
+
"!node_modules/.vp-config/info.json",
|
|
303
|
+
"index.html"
|
|
304
|
+
];
|
|
297
305
|
const runBase = {
|
|
298
306
|
tasks: {
|
|
299
307
|
cbuild: "vp build",
|
|
@@ -338,10 +346,7 @@ const fmtWebsite = {
|
|
|
338
346
|
//#region src/cli/index.ts
|
|
339
347
|
const cliConfig = {
|
|
340
348
|
fmt: fmtWebsite,
|
|
341
|
-
lint: mergeConfig(lintBase,
|
|
342
|
-
rules: { "import/no-unassigned-import": "off" },
|
|
343
|
-
files: ["bin/**"]
|
|
344
|
-
}] })),
|
|
349
|
+
lint: mergeConfig(lintBase, tuiOverride),
|
|
345
350
|
pack: {
|
|
346
351
|
dts: false,
|
|
347
352
|
minify: true,
|
|
@@ -411,7 +416,15 @@ function isStagedObjectConfig(config) {
|
|
|
411
416
|
//#region src/lib/index.ts
|
|
412
417
|
const libConfig = {
|
|
413
418
|
fmt: fmtBase,
|
|
414
|
-
lint: mergeConfig(lintBase, {
|
|
419
|
+
lint: mergeConfig(lintBase, { overrides: [{
|
|
420
|
+
files: [
|
|
421
|
+
"cli.*",
|
|
422
|
+
"**/cli/**",
|
|
423
|
+
"tui.*",
|
|
424
|
+
"**/tui/**"
|
|
425
|
+
],
|
|
426
|
+
...tuiOverride
|
|
427
|
+
}] }),
|
|
415
428
|
pack: {
|
|
416
429
|
fixedExtension: true,
|
|
417
430
|
exports: true,
|
|
@@ -432,7 +445,9 @@ const websiteConfig = {
|
|
|
432
445
|
"unicorn/prefer-query-selector": "warn",
|
|
433
446
|
"prefer-dom-node-remove": "warn",
|
|
434
447
|
"prefer-blob-reading-methods": "warn",
|
|
435
|
-
"import/no-unassigned-import": ["error", { allow: ["**/*.css"] }]
|
|
448
|
+
"import/no-unassigned-import": ["error", { allow: ["**/*.css"] }],
|
|
449
|
+
"import/no-default-export": "off",
|
|
450
|
+
"unicorn/filename-case": "off"
|
|
436
451
|
}
|
|
437
452
|
}),
|
|
438
453
|
run: runBase,
|