pob 38.6.0 → 38.8.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.
@@ -213,7 +213,7 @@ export default class CommonBabelGenerator extends Generator {
213
213
  version,
214
214
  formats:
215
215
  babelConfig.formats && babelConfig.formats.includes("cjs")
216
- ? // eslint-disable-next-line unicorn/no-nested-ternary
216
+ ? // oxlint-disable-next-line unicorn/no-nested-ternary
217
217
  version === `${latestLTS}` || version === `${maintenanceLTS}`
218
218
  ? babelConfig.formats
219
219
  : undefined
@@ -229,7 +229,7 @@ export default class CommonBabelGenerator extends Generator {
229
229
  version: version === "supported" ? undefined : version,
230
230
  formats:
231
231
  babelConfig.formats && babelConfig.formats.includes("cjs")
232
- ? // eslint-disable-next-line unicorn/no-nested-ternary
232
+ ? // oxlint-disable-next-line unicorn/no-nested-ternary
233
233
  version === "supported"
234
234
  ? babelConfig.formats
235
235
  : undefined
@@ -163,6 +163,7 @@ export default class CommonFormatLintGenerator extends Generator {
163
163
  : babelEnvs.length > 0;
164
164
  const useTypescript = this.options.typescript;
165
165
  const hasReact = useTypescript && packageUtils.hasReact(pkg);
166
+ const useAppConfig = hasReact && this.options.isApp;
166
167
  const useNode = !useBabel || babelEnvs.some((env) => env.target === "node");
167
168
  const useNodeOnly =
168
169
  (!useBabel && !useTypescript) ||
@@ -414,7 +415,7 @@ export default class CommonFormatLintGenerator extends Generator {
414
415
 
415
416
  return [
416
417
  useNode ? "...pobConfig.configs.node" : "...pobConfig.configs.base",
417
- this.options.isApp && "...pobConfig.configs.app",
418
+ useAppConfig && "...pobConfig.configs.app",
418
419
  pkg.dependencies?.["react-native-web"] &&
419
420
  '...pobTypescriptConfigReact.configs["react-native-web"]',
420
421
  ];
@@ -532,14 +533,41 @@ export default class CommonFormatLintGenerator extends Generator {
532
533
  // ignorePatterns are fully owned by the generator: merging with existing
533
534
  // ones would never remove stale patterns
534
535
  const oxlintConfig = this.fs.readJSON(oxlintConfigPath, {});
536
+ const oxlintExtends = oxlintConfig.extends || [];
537
+ const pobOxlintConfigPath = (name) =>
538
+ `./node_modules/@pob/eslint-config/oxlint/${name}.json`;
535
539
  await writeAndFormatJson(this.fs, oxlintConfigPath, {
536
540
  ...oxlintConfig,
537
541
  extends: [
538
- "./node_modules/@pob/eslint-config/oxlint/base.json",
539
- ...(oxlintConfig.extends || []).filter(
542
+ pobOxlintConfigPath("base"),
543
+ // like configs.node and configs.nodeModule (not configs.nodeCommonjs)
544
+ useNode &&
545
+ (useTypescript || pkg.type !== "commonjs") &&
546
+ pobOxlintConfigPath("node"),
547
+ // type-aware rules: oxlint fails without tsgolint, even in a
548
+ // project without TypeScript files
549
+ useTypescript && pobOxlintConfigPath("typescript"),
550
+ // overrides of typescript.json, like the matching eslint configs
551
+ // (configs.app, configs.allowUnsafe, ...). Only app is known here:
552
+ // the others are kept when added by hand.
553
+ ...(useTypescript
554
+ ? [
555
+ "app",
556
+ "allow-implicit-return-type",
557
+ "allow-unsafe",
558
+ "allow-unsafe-as-warn",
559
+ ]
560
+ .filter(
561
+ (name) =>
562
+ (name === "app" && useAppConfig) ||
563
+ oxlintExtends.includes(pobOxlintConfigPath(name)),
564
+ )
565
+ .map(pobOxlintConfigPath)
566
+ : []),
567
+ ...oxlintExtends.filter(
540
568
  (value) => !value.includes("@pob/eslint-config/"),
541
569
  ),
542
- ],
570
+ ].filter(Boolean),
543
571
  ignorePatterns: [
544
572
  ...new Set([...oxlintBaseIgnorePatterns, ...ignorePatterns]),
545
573
  ],
@@ -558,8 +586,8 @@ export default class CommonFormatLintGenerator extends Generator {
558
586
  ? `${packageManagerExecWithCwd(this.options.packageManager, "../..", "eslint")} ${args} ${quoteArg(path.relative("../..", "."))}`
559
587
  : `eslint ${args} .`,
560
588
  "lint:oxlint": globalEslint
561
- ? `${packageManagerExecWithCwd(this.options.packageManager, "../..", "oxlint")} ${quoteArg(path.relative("../..", "."))}`
562
- : "oxlint",
589
+ ? `${packageManagerExecWithCwd(this.options.packageManager, "../..", "oxlint")} ${args} ${quoteArg(path.relative("../..", "."))}`
590
+ : `oxlint ${args}`,
563
591
  lint: `${packageManagerRun(this.options.packageManager, "lint:oxlint")} && ${
564
592
  useTypescript && !composite ? "tsc && " : ""
565
593
  }${packageManagerRun(this.options.packageManager, "lint:eslint")}`,
@@ -167,7 +167,7 @@ export default class CommonTestingGenerator extends Generator {
167
167
  const transpileWithEsbuild = false;
168
168
  const transpileWithBabel = transpileWithEsbuild
169
169
  ? false
170
- : // eslint-disable-next-line unicorn/no-nested-ternary
170
+ : // oxlint-disable-next-line unicorn/no-nested-ternary
171
171
  this.options.monorepo
172
172
  ? yoConfigPobMonorepo.typescript &&
173
173
  yoConfigPobMonorepo.typescript !== "check-only"
@@ -252,7 +252,7 @@ export default class CommonTypescriptGenerator extends Generator {
252
252
  packageName,
253
253
  `../../${
254
254
  packageName[0] === "@"
255
- ? // eslint-disable-next-line unicorn/no-nested-ternary
255
+ ? // oxlint-disable-next-line unicorn/no-nested-ternary
256
256
  yoConfig.pob.project.type === "app"
257
257
  ? `packages/${packageName.slice(packageName.indexOf("/") + 1)}`
258
258
  : packageName
@@ -8,7 +8,7 @@ export default class CoreSortPackageGenerator extends Generator {
8
8
  return writeAndFormatJson(
9
9
  this.fs,
10
10
  this.destinationPath("package.json"),
11
- // eslint-disable-next-line unicorn/no-array-sort
11
+ // oxlint-disable-next-line unicorn/no-array-sort
12
12
  packageUtils.sort(pkg),
13
13
  );
14
14
  }
@@ -99,7 +99,8 @@ export default class MonorepoWorkspacesGenerator extends Generator {
99
99
  lint: `${packageManager} run format && ${packageManager} run lint:oxlint && ${packageManager} run lint:eslint`,
100
100
  format: "oxfmt",
101
101
  "format:check": "oxfmt --check .",
102
- "lint:oxlint": monorepoConfig && monorepoConfig.eslint && "oxlint",
102
+ "lint:oxlint":
103
+ monorepoConfig && monorepoConfig.eslint && "oxlint --quiet",
103
104
  "lint:eslint":
104
105
  monorepoConfig &&
105
106
  monorepoConfig.eslint &&
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pob",
3
- "version": "38.6.0",
3
+ "version": "38.8.0",
4
4
  "description": "Pile of bones, library generator with git/babel/typescript/typedoc/readme/vitest",
5
5
  "keywords": [
6
6
  "skeleton"
@@ -48,17 +48,17 @@
48
48
  "validate-npm-package-name": "^8.0.0",
49
49
  "yeoman-environment": "6.1.0",
50
50
  "yeoman-generator": "8.2.2",
51
- "@pob/eslint-config": "67.5.0",
52
- "@pob/sort-object": "11.1.2",
53
- "@pob/eslint-config-typescript-react": "67.5.0",
54
- "@pob/sort-pkg": "13.1.3",
55
- "pob-dependencies": "27.5.0"
51
+ "@pob/eslint-config": "67.7.0",
52
+ "@pob/eslint-config-typescript-react": "67.7.0",
53
+ "@pob/sort-object": "11.2.0",
54
+ "@pob/sort-pkg": "13.2.0",
55
+ "pob-dependencies": "27.7.0"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@types/node": "24.13.3",
59
59
  "@typescript/native": "npm:typescript@7.0.2",
60
60
  "@yeoman/types": "1.11.1",
61
- "@pob/root": "27.6.0"
61
+ "@pob/root": "27.8.0"
62
62
  },
63
63
  "engines": {
64
64
  "node": ">=22.18.0"
@@ -71,7 +71,7 @@
71
71
  "build:definitions": "tsc -p tsconfig.json",
72
72
  "lint": "pnpm run lint:oxlint && pnpm run lint:eslint",
73
73
  "lint:eslint": "pnpm --dir '../..' exec eslint --quiet 'packages/pob'",
74
- "lint:oxlint": "pnpm --dir '../..' exec oxlint 'packages/pob'",
74
+ "lint:oxlint": "pnpm --dir '../..' exec oxlint --quiet 'packages/pob'",
75
75
  "tsc": "tsc"
76
76
  },
77
77
  "bin": {