@diia-inhouse/oxc-config 1.10.2 → 1.11.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/dist/oxlint/config.d.ts +17 -2
- package/dist/oxlint/config.d.ts.map +1 -1
- package/dist/oxlint/config.js +28 -5
- package/package.json +8 -8
package/dist/oxlint/config.d.ts
CHANGED
|
@@ -1,8 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type OxlintConfig } from 'oxlint';
|
|
2
2
|
type Config = OxlintConfig & {
|
|
3
3
|
ignorePatterns: string[];
|
|
4
4
|
};
|
|
5
5
|
export declare const base: Config;
|
|
6
6
|
export declare const boundaries: Config;
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* `defineConfig` used by every service's `oxlint.config.ts`.
|
|
9
|
+
*
|
|
10
|
+
* A service that sets its own `overrides` array does `{ ...boundaries, overrides: [...] }`.
|
|
11
|
+
* The shallow spread copies `boundaries.overrides`, but the explicit `overrides` key then
|
|
12
|
+
* *replaces* it — silently dropping the shared exemptions. To make consumption safe, we
|
|
13
|
+
* always prepend the shared overrides.
|
|
14
|
+
*
|
|
15
|
+
* Dedupe is by object identity, not by `files`: we only strip the shared overrides a service
|
|
16
|
+
* re-introduced by spreading `...boundaries.overrides` (oxlint's `defineConfig` is identity, so
|
|
17
|
+
* those are the same object references). Everything a service actually authored is kept and
|
|
18
|
+
* appended *after* the shared overrides — and since a later matching override wins in oxlint, a
|
|
19
|
+
* service can still redefine rules for the same `files` glob (e.g. re-enable a shared exemption).
|
|
20
|
+
*/
|
|
21
|
+
export declare const defineConfig: (config: OxlintConfig) => OxlintConfig;
|
|
22
|
+
export {};
|
|
8
23
|
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../oxlint/config.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../oxlint/config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAsC,KAAK,YAAY,EAAE,MAAM,QAAQ,CAAA;AAE9E,KAAK,MAAM,GAAG,YAAY,GAAG;IAAE,cAAc,EAAE,MAAM,EAAE,CAAA;CAAE,CAAA;AAodzD,eAAO,MAAM,IAAI,EAAE,MAAiD,CAAA;AAEpE,eAAO,MAAM,UAAU,EAAE,MAKb,CAAA;AAIZ;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,YAAY,GAAI,QAAQ,YAAY,KAAG,YAOnD,CAAA"}
|
package/dist/oxlint/config.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';
|
|
2
|
-
import { defineConfig } from 'oxlint';
|
|
2
|
+
import { defineConfig as defineOxlintConfig } from 'oxlint';
|
|
3
3
|
const require = createRequire(import.meta.url);
|
|
4
4
|
const resolve = (pkg) => require.resolve(pkg).replace(/\/[^/]+$/, '');
|
|
5
5
|
const resolveFile = (path) => new URL(path, import.meta.url).pathname;
|
|
@@ -220,7 +220,7 @@ const baseConfig = {
|
|
|
220
220
|
},
|
|
221
221
|
},
|
|
222
222
|
{
|
|
223
|
-
files: ['**/deps/**', '**/deps.ts', 'src/index.ts'],
|
|
223
|
+
files: ['**/deps/**', '**/deps.ts', 'src/index.ts', 'src/workerEntry.ts'],
|
|
224
224
|
rules: {
|
|
225
225
|
'eslint/no-restricted-imports': 'off',
|
|
226
226
|
},
|
|
@@ -359,6 +359,8 @@ const boundariesExtension = {
|
|
|
359
359
|
{ type: 'deps' },
|
|
360
360
|
{ type: 'configs' },
|
|
361
361
|
{ type: 'worker' },
|
|
362
|
+
{ type: 'workerActivities' },
|
|
363
|
+
{ type: 'workerWorkflows' },
|
|
362
364
|
],
|
|
363
365
|
},
|
|
364
366
|
},
|
|
@@ -441,11 +443,32 @@ const boundariesExtension = {
|
|
|
441
443
|
],
|
|
442
444
|
},
|
|
443
445
|
};
|
|
444
|
-
export const base =
|
|
445
|
-
export const boundaries =
|
|
446
|
+
export const base = defineOxlintConfig(baseConfig);
|
|
447
|
+
export const boundaries = defineOxlintConfig({
|
|
446
448
|
...baseConfig,
|
|
447
449
|
jsPlugins: [...(baseConfig.jsPlugins ?? []), ...(boundariesExtension.jsPlugins ?? [])],
|
|
448
450
|
settings: { ...boundariesExtension.settings },
|
|
449
451
|
rules: { ...baseConfig.rules, ...boundariesExtension.rules },
|
|
450
452
|
});
|
|
451
|
-
|
|
453
|
+
const sharedOverrides = baseConfig.overrides ?? [];
|
|
454
|
+
/**
|
|
455
|
+
* `defineConfig` used by every service's `oxlint.config.ts`.
|
|
456
|
+
*
|
|
457
|
+
* A service that sets its own `overrides` array does `{ ...boundaries, overrides: [...] }`.
|
|
458
|
+
* The shallow spread copies `boundaries.overrides`, but the explicit `overrides` key then
|
|
459
|
+
* *replaces* it — silently dropping the shared exemptions. To make consumption safe, we
|
|
460
|
+
* always prepend the shared overrides.
|
|
461
|
+
*
|
|
462
|
+
* Dedupe is by object identity, not by `files`: we only strip the shared overrides a service
|
|
463
|
+
* re-introduced by spreading `...boundaries.overrides` (oxlint's `defineConfig` is identity, so
|
|
464
|
+
* those are the same object references). Everything a service actually authored is kept and
|
|
465
|
+
* appended *after* the shared overrides — and since a later matching override wins in oxlint, a
|
|
466
|
+
* service can still redefine rules for the same `files` glob (e.g. re-enable a shared exemption).
|
|
467
|
+
*/
|
|
468
|
+
export const defineConfig = (config) => {
|
|
469
|
+
const serviceOverrides = (config.overrides ?? []).filter((override) => !sharedOverrides.includes(override));
|
|
470
|
+
return defineOxlintConfig({
|
|
471
|
+
...config,
|
|
472
|
+
overrides: [...sharedOverrides, ...serviceOverrides],
|
|
473
|
+
});
|
|
474
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@diia-inhouse/oxc-config",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
4
4
|
"description": "OXC toolchain configs for Diia services: oxlint, oxfmt, oxc transformer",
|
|
5
5
|
"author": "Diia",
|
|
6
6
|
"type": "module",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"eslint-import-resolver-oxc": "0.15.0",
|
|
37
37
|
"eslint-plugin-regexp": "3.1.0",
|
|
38
38
|
"eslint-plugin-security": "4.0.0",
|
|
39
|
-
"tsx": "4.
|
|
39
|
+
"tsx": "4.22.4"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"oxfmt": ">= 0.43.0",
|
|
@@ -45,17 +45,17 @@
|
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@diia-inhouse/configs": "7.0.1",
|
|
48
|
-
"@typescript-eslint/parser": "8.
|
|
49
|
-
"@typescript-eslint/rule-tester": "8.
|
|
50
|
-
"@vitest/coverage-v8": "4.1.
|
|
51
|
-
"@vitest/ui": "4.1.
|
|
48
|
+
"@typescript-eslint/parser": "8.60.1",
|
|
49
|
+
"@typescript-eslint/rule-tester": "8.60.1",
|
|
50
|
+
"@vitest/coverage-v8": "4.1.8",
|
|
51
|
+
"@vitest/ui": "4.1.8",
|
|
52
52
|
"lockfile-lint": "5.0.0",
|
|
53
53
|
"madge": "8.0.0",
|
|
54
54
|
"oxfmt": "0.47.0",
|
|
55
55
|
"oxlint": "1.62.0",
|
|
56
56
|
"oxlint-tsgolint": "0.22.1",
|
|
57
|
-
"semantic-release": "
|
|
58
|
-
"vitest": "4.1.
|
|
57
|
+
"semantic-release": "25.0.3",
|
|
58
|
+
"vitest": "4.1.8"
|
|
59
59
|
},
|
|
60
60
|
"commitlint": {
|
|
61
61
|
"extends": "@diia-inhouse/configs/dist/commitlint"
|