@diia-inhouse/oxc-config 1.10.2 → 2.0.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 +29 -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;AAqdzD,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;
|
|
@@ -32,6 +32,7 @@ const baseConfig = {
|
|
|
32
32
|
'eslint/no-cond-assign': ['error', 'always'],
|
|
33
33
|
'eslint/no-console': 'error',
|
|
34
34
|
'eslint/no-underscore-dangle': ['warn', { allow: ['_id'] }],
|
|
35
|
+
'eslint/default-case': 'error',
|
|
35
36
|
// Projects use vitest; disable duplicate jest plugin diagnostics
|
|
36
37
|
'jest/valid-title': 'off',
|
|
37
38
|
'jest/no-conditional-expect': 'off',
|
|
@@ -220,7 +221,7 @@ const baseConfig = {
|
|
|
220
221
|
},
|
|
221
222
|
},
|
|
222
223
|
{
|
|
223
|
-
files: ['**/deps/**', '**/deps.ts', 'src/index.ts'],
|
|
224
|
+
files: ['**/deps/**', '**/deps.ts', 'src/index.ts', 'src/workerEntry.ts'],
|
|
224
225
|
rules: {
|
|
225
226
|
'eslint/no-restricted-imports': 'off',
|
|
226
227
|
},
|
|
@@ -359,6 +360,8 @@ const boundariesExtension = {
|
|
|
359
360
|
{ type: 'deps' },
|
|
360
361
|
{ type: 'configs' },
|
|
361
362
|
{ type: 'worker' },
|
|
363
|
+
{ type: 'workerActivities' },
|
|
364
|
+
{ type: 'workerWorkflows' },
|
|
362
365
|
],
|
|
363
366
|
},
|
|
364
367
|
},
|
|
@@ -441,11 +444,32 @@ const boundariesExtension = {
|
|
|
441
444
|
],
|
|
442
445
|
},
|
|
443
446
|
};
|
|
444
|
-
export const base =
|
|
445
|
-
export const boundaries =
|
|
447
|
+
export const base = defineOxlintConfig(baseConfig);
|
|
448
|
+
export const boundaries = defineOxlintConfig({
|
|
446
449
|
...baseConfig,
|
|
447
450
|
jsPlugins: [...(baseConfig.jsPlugins ?? []), ...(boundariesExtension.jsPlugins ?? [])],
|
|
448
451
|
settings: { ...boundariesExtension.settings },
|
|
449
452
|
rules: { ...baseConfig.rules, ...boundariesExtension.rules },
|
|
450
453
|
});
|
|
451
|
-
|
|
454
|
+
const sharedOverrides = baseConfig.overrides ?? [];
|
|
455
|
+
/**
|
|
456
|
+
* `defineConfig` used by every service's `oxlint.config.ts`.
|
|
457
|
+
*
|
|
458
|
+
* A service that sets its own `overrides` array does `{ ...boundaries, overrides: [...] }`.
|
|
459
|
+
* The shallow spread copies `boundaries.overrides`, but the explicit `overrides` key then
|
|
460
|
+
* *replaces* it — silently dropping the shared exemptions. To make consumption safe, we
|
|
461
|
+
* always prepend the shared overrides.
|
|
462
|
+
*
|
|
463
|
+
* Dedupe is by object identity, not by `files`: we only strip the shared overrides a service
|
|
464
|
+
* re-introduced by spreading `...boundaries.overrides` (oxlint's `defineConfig` is identity, so
|
|
465
|
+
* those are the same object references). Everything a service actually authored is kept and
|
|
466
|
+
* appended *after* the shared overrides — and since a later matching override wins in oxlint, a
|
|
467
|
+
* service can still redefine rules for the same `files` glob (e.g. re-enable a shared exemption).
|
|
468
|
+
*/
|
|
469
|
+
export const defineConfig = (config) => {
|
|
470
|
+
const serviceOverrides = (config.overrides ?? []).filter((override) => !sharedOverrides.includes(override));
|
|
471
|
+
return defineOxlintConfig({
|
|
472
|
+
...config,
|
|
473
|
+
overrides: [...sharedOverrides, ...serviceOverrides],
|
|
474
|
+
});
|
|
475
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@diia-inhouse/oxc-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.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"
|