@ladamczyk/qoq-eslint-v9-ts-react 5.3.1 → 6.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/AGENTS.md CHANGED
@@ -1,21 +1,26 @@
1
1
  # @ladamczyk/qoq-eslint-v9-ts-react — Agent Context
2
2
 
3
- ESLint flat config template for TypeScript + React projects. Merges `@ladamczyk/qoq-eslint-v9-js-react` and `@ladamczyk/qoq-eslint-v9-ts`.
3
+ ESLint flat config template for TypeScript + React projects. Composes `@ladamczyk/qoq-eslint-v9-js-react`'s `reactLayer` and `@ladamczyk/qoq-eslint-v9-ts`'s `tsLayer`.
4
4
 
5
5
  ## Exports
6
6
 
7
- - `baseConfig` — TS + React config
7
+ - `tsReactLayer` — only this package's own delta on top of the composed chain (typescript-eslint's `recommended-typescript` react rules)
8
+ - `configs.base` — the `defineConfig` array form: the full chain (JS base → React layer → ts layer → `tsReactLayer`), merged per file by ESLint's cascade
8
9
 
9
10
  ## Usage
10
11
 
11
12
  Typically consumed via `qoq.config.js` using the `template` field. For manual use:
12
13
 
13
14
  ```js
14
- import { baseConfig } from '@ladamczyk/qoq-eslint-v9-ts-react';
15
+ import { configs } from '@ladamczyk/qoq-eslint-v9-ts-react';
16
+ import { defineConfig } from 'eslint/config';
15
17
 
16
- export default [baseConfig];
18
+ export default defineConfig({
19
+ files: ['**/*.tsx'],
20
+ extends: [configs.base],
21
+ });
17
22
  ```
18
23
 
19
24
  ## Inheritance
20
25
 
21
- Merges JS-React base (plugins: `@eslint-react`, `@stylistic`, `compat`, `react-refresh`) with the TS base (TypeScript parser + `@typescript-eslint` rules). Uses `@eslint-react/recommended-typescript` rules on top of both. The custom `@eslint-react/no-multi-comp` rule (defined in `eslint-v9-js-react`) is inherited via the JS-React base and re-asserted here so it survives the `recommended-typescript` merge. The Fast-Refresh rule `react-refresh/only-export-components` is likewise inherited from the JS-React base (plugin and rule both flow through the base spread; no re-assertion needed since `recommended-typescript` doesn't touch that namespace).
26
+ Composes JS-React's `reactLayer` (plugins: `@eslint-react`, `@stylistic`, `compat`, `react-refresh`) with `eslint-v9-ts`'s `tsLayer` (TypeScript parser + `@typescript-eslint` rules) and this package's own `tsReactLayer` (`@eslint-react/recommended-typescript` rules), all as delta layers merged per file by ESLint's cascade — never from another package's own `configs.*`, since `defineConfig` doesn't dedupe diamond extends. The custom `@eslint-react/no-multi-comp` rule (defined in `eslint-v9-js-react`) is inherited via `reactLayer`; layer composition never clobbers it, so it needs no re-assertion here. The Fast-Refresh rule `react-refresh/only-export-components` is likewise inherited from `reactLayer` unchanged.
package/README.md CHANGED
@@ -15,17 +15,16 @@ These configurations inherit from base presets and include all necessary package
15
15
 
16
16
  ## Usage
17
17
 
18
- This package ships **ESM only** (its React plugin dependencies are ESM-only). Import the named `baseConfig` export in your ESLint flat config — use `eslint.config.js` in an ESM project (`"type": "module"`) or `eslint.config.mjs` otherwise.
18
+ This package ships **ESM only** (its React plugin dependencies are ESM-only). Import the named `configs` export in your ESLint flat config — use `eslint.config.js` in an ESM project (`"type": "module"`) or `eslint.config.mjs` otherwise.
19
19
 
20
20
  ```js
21
- import { baseConfig } from '@ladamczyk/qoq-eslint-v9-ts-react';
22
-
23
- export default [
24
- {
25
- ...baseConfig,
26
- files: [...]
27
- }
28
- ];
21
+ import { configs } from '@ladamczyk/qoq-eslint-v9-ts-react';
22
+ import { defineConfig } from 'eslint/config';
23
+
24
+ export default defineConfig({
25
+ files: [...],
26
+ extends: [configs.base],
27
+ });
29
28
  ```
30
29
 
31
30
  ## Rules preview with ESLint Config Inspector
@@ -1,5 +1,5 @@
1
1
  import { resolve } from 'path';
2
2
 
3
- const { baseConfig } = await import(resolve(__dirname, 'lib/index.mjs'));
3
+ const { configs } = await import(resolve(__dirname, 'lib/index.mjs'));
4
4
 
5
- export default baseConfig;
5
+ export default configs.base;
package/lib/index.mjs CHANGED
@@ -1,26 +1,28 @@
1
1
  import reactPlugin from "@eslint-react/eslint-plugin";
2
- import { REACT_ONLY_SONARJS_RULES, restoreSonarjsRules } from "@ladamczyk/qoq-eslint-v9-js";
3
- import { NO_MULTI_COMP_RULE_NAME, baseConfig as baseConfig$1, disabledRules } from "@ladamczyk/qoq-eslint-v9-js-react";
4
- import { baseConfig as baseConfig$2 } from "@ladamczyk/qoq-eslint-v9-ts";
5
- import { objectMergeRight } from "@ladamczyk/qoq-utils";
2
+ import { jsLayer } from "@ladamczyk/qoq-eslint-v9-js";
3
+ import { reactLayer } from "@ladamczyk/qoq-eslint-v9-js-react";
4
+ import { tsLayer } from "@ladamczyk/qoq-eslint-v9-ts";
5
+ import { defineConfig } from "eslint/config";
6
6
  //#region src/index.ts
7
- const { plugins: jsReactBaseConfigPlugins, ...jsReactBaseConfigRest } = baseConfig$1;
8
- const { plugins: tsBaseConfigPlugins, ...tsBaseConfigRest } = baseConfig$2;
9
- const restoredReactRules = restoreSonarjsRules(REACT_ONLY_SONARJS_RULES, ["no-hook-setter-in-body"]);
10
- const baseConfig = {
11
- ...objectMergeRight(jsReactBaseConfigRest, tsBaseConfigRest, {
12
- name: "qoq-eslint-v9-ts-react",
13
- rules: {
14
- ...restoredReactRules,
15
- ...disabledRules,
16
- ...reactPlugin.configs["recommended-typescript"].rules ?? {},
17
- [`@eslint-react/${NO_MULTI_COMP_RULE_NAME}`]: 2
18
- }
19
- }),
20
- plugins: {
21
- ...jsReactBaseConfigPlugins,
22
- ...tsBaseConfigPlugins
23
- }
7
+ /**
8
+ * The delta this package itself contributes. Under `defineConfig` composition,
9
+ * `tsLayer` is a true delta that never carries the JS base's disabled React-only
10
+ * sonarjs rules, so `reactLayer`'s restorations (and its `@eslint-react/no-multi-comp`
11
+ * enable) are never clobbered — neither needs to be re-applied here. Only the
12
+ * `recommended-typescript` rules are genuinely this package's own.
13
+ */
14
+ const tsReactLayer = {
15
+ name: "qoq-eslint-v9-ts-react",
16
+ rules: reactPlugin.configs["recommended-typescript"].rules ?? {}
24
17
  };
18
+ /**
19
+ * Flat-config array form: the full chain (JS base → React layer → ts layer →
20
+ * this package's delta), merged per file by ESLint's own cascade instead of being
21
+ * pre-merged. Composed from delta layers only — a nested
22
+ * `configs.*` would re-apply the JS base mid-chain and clobber `reactLayer`'s
23
+ * sonarjs restorations. `testLayer` is deliberately absent: this bundle is the
24
+ * base delta chain only, not the test-file relaxations.
25
+ */
26
+ const configs = { base: defineConfig(jsLayer, reactLayer, tsLayer, tsReactLayer) };
25
27
  //#endregion
26
- export { baseConfig };
28
+ export { configs, tsReactLayer };
@@ -1,2 +1,19 @@
1
- import { EslintConfig } from '@ladamczyk/qoq-eslint-v9-js';
2
- export declare const baseConfig: EslintConfig;
1
+ import { EslintLayer } from '@ladamczyk/qoq-eslint-v9-js';
2
+ import type { Linter } from 'eslint';
3
+ /**
4
+ * The delta this package itself contributes. Under `defineConfig` composition,
5
+ * `tsLayer` is a true delta that never carries the JS base's disabled React-only
6
+ * sonarjs rules, so `reactLayer`'s restorations (and its `@eslint-react/no-multi-comp`
7
+ * enable) are never clobbered — neither needs to be re-applied here. Only the
8
+ * `recommended-typescript` rules are genuinely this package's own.
9
+ */
10
+ export declare const tsReactLayer: EslintLayer;
11
+ /**
12
+ * Flat-config array form: the full chain (JS base → React layer → ts layer →
13
+ * this package's delta), merged per file by ESLint's own cascade instead of being
14
+ * pre-merged. Composed from delta layers only — a nested
15
+ * `configs.*` would re-apply the JS base mid-chain and clobber `reactLayer`'s
16
+ * sonarjs restorations. `testLayer` is deliberately absent: this bundle is the
17
+ * base delta chain only, not the test-file relaxations.
18
+ */
19
+ export declare const configs: Record<'base', Linter.Config[]>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ladamczyk/qoq-eslint-v9-ts-react",
3
- "version": "5.3.1",
3
+ "version": "6.0.0",
4
4
  "description": "Eslint flat config template for TS + React",
5
5
  "keywords": [
6
6
  "eslint TypeScript + React template",
@@ -43,14 +43,15 @@
43
43
  "typecheck": "tsc --noEmit"
44
44
  },
45
45
  "dependencies": {
46
- "@eslint-react/eslint-plugin": "5.18.3",
47
- "@ladamczyk/qoq-eslint-v9-js-react": "^5.3.1",
48
- "@ladamczyk/qoq-eslint-v9-ts": "^5.3.1",
49
- "@ladamczyk/qoq-utils": "^5.3.1"
46
+ "@eslint-react/eslint-plugin": "5.18.6",
47
+ "@ladamczyk/qoq-eslint-v9-js": "^6.0.0",
48
+ "@ladamczyk/qoq-eslint-v9-js-react": "^6.0.0",
49
+ "@ladamczyk/qoq-eslint-v9-ts": "^6.0.0",
50
+ "@ladamczyk/qoq-utils": "^6.0.0"
50
51
  },
51
52
  "devDependencies": {
52
53
  "rimraf": "6.1.3",
53
- "rolldown": "1.2.3",
54
+ "rolldown": "1.2.4",
54
55
  "typescript": "6.0.3"
55
56
  },
56
57
  "peerDependencies": {
@@ -63,5 +64,5 @@
63
64
  "publishConfig": {
64
65
  "access": "public"
65
66
  },
66
- "gitHead": "57360d73edf56a1451eeb5bf3abfa3804cc67171"
67
+ "gitHead": "c3e463890d0b11669b719d256b1ed307d2ae1ee3"
67
68
  }