@kirill.konshin/lint 0.8.0 → 0.8.1

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
@@ -170,6 +170,7 @@ export default defineConfig(vitePlusConfig());
170
170
 
171
171
  - Merging: lists add up (`plugins`, `jsPlugins`, `overrides`, `ignorePatterns`), maps merge by key (`rules`, `settings`, `env`), a `staged` block replaces the default
172
172
  - Building blocks are exported: `lintConfig(config)` (synchronous, takes a resolved config), `fmtConfig()`, `stagedConfig()`
173
+ - Rolldown module-directive warnings (`'use server'`, `'use client'`) default off for builds and dependency optimization; set `build.rolldownOptions.checks.moduleLevelDirective` or `optimizeDeps.rolldownOptions.checks.moduleLevelDirective` to `true` to re-enable. This changes logging only, not directive handling.
173
174
  - Lint and format settings live in the **root** config only: Vite+ ignores nested `lint`/`fmt` blocks, use `lint.overrides` / `fmt.overrides` with workspace paths
174
175
  - `.gitignore` and `.prettierignore` are honoured by Oxfmt; the recommended `.prettierignore` entries are default `fmt.ignorePatterns`, add others there
175
176
 
@@ -33,8 +33,8 @@ export declare function stagedConfig(): StagedConfig;
33
33
  /**
34
34
  * The shared Vite+ config, from the workspace root `lint.config.ts`: {@link lintConfig}, {@link fmtConfig} and
35
35
  * {@link stagedConfig}, then the project's own blocks (`vitePlus` key of `lint.config.ts`), then `config` (see
36
- * `mergeUserConfig` for how blocks merge). `overrides` merge deep over `lint.config.ts`. Async: wrap the Promise in
37
- * `defineConfig`, Vite+ awaits it:
36
+ * `mergeUserConfig` for how blocks merge). Rolldown's module-directive warning defaults off in builds and dependency
37
+ * optimization. `overrides` merge deep over `lint.config.ts`. Async: wrap the Promise in `defineConfig`, Vite+ awaits it:
38
38
  *
39
39
  * ```ts
40
40
  * import { vitePlusConfig } from '@kirill.konshin/lint/vite-plus';
package/dist/vitePlus.js CHANGED
@@ -404,8 +404,8 @@ function mergeUserConfig(base, extra) {
404
404
  /**
405
405
  * The shared Vite+ config, from the workspace root `lint.config.ts`: {@link lintConfig}, {@link fmtConfig} and
406
406
  * {@link stagedConfig}, then the project's own blocks (`vitePlus` key of `lint.config.ts`), then `config` (see
407
- * `mergeUserConfig` for how blocks merge). `overrides` merge deep over `lint.config.ts`. Async: wrap the Promise in
408
- * `defineConfig`, Vite+ awaits it:
407
+ * `mergeUserConfig` for how blocks merge). Rolldown's module-directive warning defaults off in builds and dependency
408
+ * optimization. `overrides` merge deep over `lint.config.ts`. Async: wrap the Promise in `defineConfig`, Vite+ awaits it:
409
409
  *
410
410
  * ```ts
411
411
  * import { vitePlusConfig } from '@kirill.konshin/lint/vite-plus';
@@ -417,11 +417,36 @@ function mergeUserConfig(base, extra) {
417
417
  async function vitePlusConfig(config = {}, overrides = {}) {
418
418
  const options = await resolveLintConfig(overrides);
419
419
  const { typeAware: _typeAware, ...blocks } = options.vitePlus ?? {};
420
- return mergeUserConfig(mergeUserConfig({
420
+ const merged = mergeUserConfig(mergeUserConfig({
421
421
  lint: lintConfig(options),
422
422
  fmt: fmtConfig(),
423
423
  staged: stagedConfig()
424
424
  }, blocks), config);
425
+ const buildOptions = merged.build?.rolldownOptions ?? merged.build?.rollupOptions;
426
+ const optimizeOptions = merged.optimizeDeps?.rolldownOptions ?? merged.optimizeDeps?.rollupOptions;
427
+ return {
428
+ ...merged,
429
+ build: {
430
+ ...merged.build,
431
+ rolldownOptions: {
432
+ ...buildOptions,
433
+ checks: {
434
+ moduleLevelDirective: false,
435
+ ...buildOptions?.checks
436
+ }
437
+ }
438
+ },
439
+ optimizeDeps: {
440
+ ...merged.optimizeDeps,
441
+ rolldownOptions: {
442
+ ...optimizeOptions,
443
+ checks: {
444
+ moduleLevelDirective: false,
445
+ ...optimizeOptions?.checks
446
+ }
447
+ }
448
+ }
449
+ };
425
450
  }
426
451
  //#endregion
427
452
  export { fmtConfig, lintConfig, stagedConfig, tsExts, vitePlusConfig };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kirill.konshin/lint",
3
3
  "description": "Vite+ (Oxlint + Oxfmt), ESLint + Prettier + lint-staged configs and AI agent rules/skills for monorepos",
4
- "version": "0.8.0",
4
+ "version": "0.8.1",
5
5
  "type": "module",
6
6
  "skipGenerate": true,
7
7
  "bin": {