vize 0.390.0 → 0.404.8

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.mjs CHANGED
@@ -142,11 +142,11 @@ export default defineConfig({
142
142
  jsPlugins: ["oxlint-plugin-vize"],
143
143
  settings: {
144
144
  vize: {
145
- preset: "general-recommended",
145
+ preset: "happy-path",
146
146
  helpLevel: "short",
147
147
  },
148
148
  },
149
- rules: configs.recommended,
149
+ rules: configs.happyPath,
150
150
  });
151
151
  `;
152
152
  function readRequiredFile(filename, message) {
@@ -240,8 +240,8 @@ function isNodeError(value) {
240
240
  * `vp lint` block and the `oxlint` config can never describe different presets.
241
241
  * See `lint-target.ts` for why writing the wrong one of the two is silent.
242
242
  */
243
- /** Preset both Oxlint entry points run with. The bridge's own default. */
244
- const INIT_LINT_PRESET = "general-recommended";
243
+ /** User-facing preset alias both Oxlint entry points run with. */
244
+ const INIT_LINT_PRESET = "happy-path";
245
245
  /** `settings.vize.helpLevel` both Oxlint entry points run with. */
246
246
  const INIT_LINT_HELP_LEVEL = "short";
247
247
  /** VS Code extension id published from `editors/vscode`. */
@@ -302,7 +302,7 @@ function renderTypecheckTsconfig(typescript) {
302
302
  /**
303
303
  * Config for the `oxlint` binary.
304
304
  *
305
- * `.oxlintrc.json` cannot import `configs.recommended`, and the bridge only runs
305
+ * `.oxlintrc.json` cannot import `configs.happyPath`, and the bridge only runs
306
306
  * `vize/*` rules that appear in `rules`, so a JSON config would need every rule
307
307
  * id inlined and would rot on the next rule addition. `oxlint.config.ts` is
308
308
  * Oxlint's TypeScript config format and is auto-discovered (verified against
@@ -321,7 +321,7 @@ export default defineConfig({
321
321
  helpLevel: "${INIT_LINT_HELP_LEVEL}",
322
322
  },
323
323
  },
324
- rules: configs.recommended,
324
+ rules: configs.happyPath,
325
325
  });
326
326
  `;
327
327
  /** Import line the Vite+ `lint` block needs. */
@@ -330,9 +330,9 @@ const VITE_LINT_IMPORT = "import { createVizeLintConfig } from \"oxlint-plugin-v
330
330
  * The Vite+ `lint` block, the only Oxlint configuration `vp lint` and `vp check`
331
331
  * read.
332
332
  *
333
- * `createVizeLintConfig()` returns the whole block rather than fragments, which
334
- * is what makes the `jsPlugins` entry impossible to omit. Hand-assembling the
335
- * block is how a config ends up looking wired while reporting nothing.
333
+ * `createVizeLintConfig()` returns a complete block, which is what makes the
334
+ * `jsPlugins` entry impossible to omit. Hand-assembling the block is how a config
335
+ * ends up looking wired while reporting nothing.
336
336
  */
337
337
  const VITE_LINT_BLOCK = ` lint: createVizeLintConfig({
338
338
  preset: "${INIT_LINT_PRESET}",
@@ -1833,18 +1833,13 @@ const VITE_CONFIG_FILES = [
1833
1833
  "vite.config.js",
1834
1834
  "vite.config.mjs"
1835
1835
  ];
1836
- const VITE_PLUS_LINT_IMPORT = "import { configs as vizePlusLintConfigs } from \"oxlint-plugin-vize\";\n";
1837
- const VITE_PLUS_LINT_BLOCK = ` lint: {
1838
- plugins: ["vue"],
1839
- jsPlugins: ["oxlint-plugin-vize"],
1836
+ const VITE_PLUS_LINT_IMPORT = "import { createVizeLintConfig } from \"oxlint-plugin-vize\";\n";
1837
+ const VITE_PLUS_LINT_BLOCK = ` lint: createVizeLintConfig({
1838
+ preset: "happy-path",
1840
1839
  settings: {
1841
- vize: {
1842
- preset: "general-recommended",
1843
- helpLevel: "short",
1844
- },
1840
+ helpLevel: "short",
1845
1841
  },
1846
- rules: vizePlusLintConfigs.recommended,
1847
- },
1842
+ }),
1848
1843
  `;
1849
1844
  function planViteMigration(root, mayConfigureVitePlusLint) {
1850
1845
  const existing = VITE_CONFIG_FILES.filter((candidate) => fs.existsSync(path.join(root, candidate)));
@@ -1910,7 +1905,7 @@ function planViteMigration(root, mayConfigureVitePlusLint) {
1910
1905
  };
1911
1906
  }
1912
1907
  function canInjectVitePlusLint(source) {
1913
- if (!/from\s+["']vite-plus["']/u.test(source) || /^\s*lint\s*:/mu.test(source) || /\bvizePlusLintConfigs\b/u.test(source)) return false;
1908
+ if (!/from\s+["']vite-plus["']/u.test(source) || /^\s*lint\s*:/mu.test(source) || /\bcreateVizeLintConfig\b/u.test(source)) return false;
1914
1909
  return [...source.matchAll(/\bdefineConfig\s*\(\s*\{/gu)].length === 1;
1915
1910
  }
1916
1911
  function injectVitePlusLint(source) {