@particle/tooling 0.1.2 → 0.1.3

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
@@ -20,7 +20,7 @@ It asks what kind of project this is (or takes `--style`), prints everything it
20
20
 
21
21
  What it does, depending on what it finds:
22
22
 
23
- - **Dependencies:** removes ESLint and its configs and plugins, adds `@particle/tooling` (which installs `oxlint` and `oxfmt` as peers), and moves `typescript` to version 7. TypeScript projects also get `oxlint-tsgolint`, which runs the type-aware lint rules.
23
+ - **Dependencies:** removes ESLint and its configs and plugins, adds `@particle/tooling` (which installs `oxlint`, `oxfmt` and `oxlint-tsgolint` as peers), and moves `typescript` to version 7.
24
24
  - **Lint and format configs:** deletes `eslint.config.*`, `.eslintrc*`, `.oxlintrc.json` and `.oxfmtrc.json`, and creates `oxlint.config.ts` and `oxfmt.config.ts` that re-export the shared configs. TypeScript projects re-export `@particle/tooling/oxlint-typescript`, JavaScript projects `@particle/tooling/oxlint`.
25
25
  - **tsconfigs:** rewrites `tsconfig.json` and `tsconfig.build.json` to extend the shared configs, keeping the project's own `include`, `exclude` and `types`. A config with other project-specific compiler options, or one that already extends something else, is left alone and reported for you to migrate by hand.
26
26
  - **Sentry:** when the project depends on a `@sentry/*` package, the build config gets `"sourceRoot": "/"`, which strips the build path from source references so Sentry groups issues consistently. Without Sentry it is removed, because it makes Node stack traces point at paths that do not exist.
@@ -55,7 +55,7 @@ The config files are TypeScript, which requires Node 22.23.4 or later.
55
55
  | `@particle/tooling/oxlint` | JavaScript projects |
56
56
  | `@particle/tooling/oxlint-typescript` | TypeScript projects: the same rules plus the TypeScript rules, with type-aware linting on |
57
57
 
58
- Type-aware rules such as `no-floating-promises` need the `oxlint-tsgolint` package and a `tsconfig.json`. Only the typed rules named in `oxlint-typescript.js` are enforced. The other typed rules in the enabled categories are switched off there, and a project can turn one on in its own config.
58
+ Type-aware rules such as `no-floating-promises` run through `oxlint-tsgolint`, which is installed as a peer dependency, and need a `tsconfig.json`. Only the typed rules named in `oxlint-typescript.js` are enforced. The other typed rules in the enabled categories are switched off there, and a project can turn one on in its own config.
59
59
 
60
60
  ## Overriding
61
61
 
package/lib/migrate.js CHANGED
@@ -19,7 +19,7 @@ export const STYLES = {
19
19
  };
20
20
 
21
21
  const LEGACY_PACKAGES =
22
- /^(eslint|eslint-config-.+|eslint-plugin-.+|@eslint\/.+|typescript-eslint|@typescript-eslint\/.+|oxlint|oxfmt)$/;
22
+ /^(eslint|eslint-config-.+|eslint-plugin-.+|@eslint\/.+|typescript-eslint|@typescript-eslint\/.+|oxlint|oxfmt|oxlint-tsgolint)$/;
23
23
 
24
24
  const LEGACY_FILES = [
25
25
  'eslint.config.js',
@@ -39,8 +39,6 @@ const LEGACY_FILES = [
39
39
  '.oxfmtrc.jsonc'
40
40
  ];
41
41
 
42
- const TYPE_AWARE_LINTER = 'oxlint-tsgolint';
43
-
44
42
  /**
45
43
  * @param {string} style
46
44
  * @returns {Record<string, string>} lint and format config contents by file name. TypeScript styles get the type-aware lint config.
@@ -578,16 +576,11 @@ export async function createPlan(dir, style, options = {}) {
578
576
  pkg.devDependencies = { ...pkg.devDependencies, typescript: typescriptSpec };
579
577
  plan.dependencies.push(`add typescript ${typescriptSpec}`);
580
578
  }
581
- if (style !== 'js' && pkg.devDependencies?.[TYPE_AWARE_LINTER] === undefined) {
582
- const spec = toolingPackage.peerDependencies[TYPE_AWARE_LINTER];
583
- pkg.devDependencies = { ...pkg.devDependencies, [TYPE_AWARE_LINTER]: spec };
584
- plan.dependencies.push(
585
- `add ${TYPE_AWARE_LINTER} ${spec} (runs the type-aware lint rules, such as no-floating-promises)`
586
- );
587
- }
588
579
  if (pkg.devDependencies?.[TOOLING] !== toolingSpec) {
589
580
  pkg.devDependencies = { ...pkg.devDependencies, [TOOLING]: toolingSpec };
590
- plan.dependencies.push(`add ${TOOLING} ${toolingSpec} (installs oxlint and oxfmt as peer dependencies)`);
581
+ plan.dependencies.push(
582
+ `add ${TOOLING} ${toolingSpec} (installs oxlint, oxfmt and oxlint-tsgolint as peer dependencies)`
583
+ );
591
584
  }
592
585
  if (pkg.devDependencies) {
593
586
  pkg.devDependencies = Object.fromEntries(
package/oxfmt.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ /** Types for `oxfmt.js`. */
1
2
  import type { OxfmtConfig } from 'oxfmt';
2
3
 
3
4
  declare const config: OxfmtConfig;
package/oxfmt.js CHANGED
@@ -1,3 +1,4 @@
1
+ /** The oxfmt config published as `@particle/tooling/oxfmt`. */
1
2
  import { defineConfig } from 'oxfmt';
2
3
 
3
4
  export default defineConfig({
@@ -1,3 +1,4 @@
1
+ /** Types for `oxlint-typescript.js`. */
1
2
  import type { OxlintConfig } from 'oxlint';
2
3
 
3
4
  declare const config: OxlintConfig;
@@ -1,3 +1,4 @@
1
+ /** The oxlint config published as `@particle/tooling/oxlint-typescript`, for TypeScript projects. */
1
2
  import { defineConfig } from 'oxlint';
2
3
 
3
4
  import base from './oxlint.js';
package/oxlint.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ /** Types for `oxlint.js`. */
1
2
  import type { OxlintConfig } from 'oxlint';
2
3
 
3
4
  declare const config: OxlintConfig;
package/oxlint.js CHANGED
@@ -1,3 +1,4 @@
1
+ /** The oxlint config published as `@particle/tooling/oxlint`, for JavaScript projects. */
1
2
  import { defineConfig } from 'oxlint';
2
3
 
3
4
  const TEST_FILES = ['**/*.{spec,test,e2e,unit,integration}.{mjs,cjs,js,ts}', '**/test/**/*.{mjs,cjs,js,ts}'];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@particle/tooling",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Shared oxlint, oxfmt and TypeScript configuration for Particle projects",
5
5
  "homepage": "https://github.com/particle-iot-inc/particle-tooling",
6
6
  "bugs": {
@@ -68,9 +68,6 @@
68
68
  "peerDependenciesMeta": {
69
69
  "typescript": {
70
70
  "optional": true
71
- },
72
- "oxlint-tsgolint": {
73
- "optional": true
74
71
  }
75
72
  },
76
73
  "engines": {