@ladamczyk/qoq-eslint-v9-ts-react 5.3.2 → 6.0.1
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 +10 -5
- package/README.md +8 -9
- package/eslint.config.local.js +2 -2
- package/lib/index.mjs +24 -22
- package/lib/src/index.d.ts +19 -2
- package/package.json +6 -5
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.
|
|
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
|
-
- `
|
|
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 {
|
|
15
|
+
import { configs } from '@ladamczyk/qoq-eslint-v9-ts-react';
|
|
16
|
+
import { defineConfig } from 'eslint/config';
|
|
15
17
|
|
|
16
|
-
export default
|
|
18
|
+
export default defineConfig({
|
|
19
|
+
files: ['**/*.tsx'],
|
|
20
|
+
extends: [configs.base],
|
|
21
|
+
});
|
|
17
22
|
```
|
|
18
23
|
|
|
19
24
|
## Inheritance
|
|
20
25
|
|
|
21
|
-
|
|
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 `
|
|
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 {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
package/eslint.config.local.js
CHANGED
package/lib/index.mjs
CHANGED
|
@@ -1,26 +1,28 @@
|
|
|
1
1
|
import reactPlugin from "@eslint-react/eslint-plugin";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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 {
|
|
28
|
+
export { configs, tsReactLayer };
|
package/lib/src/index.d.ts
CHANGED
|
@@ -1,2 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
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": "
|
|
3
|
+
"version": "6.0.1",
|
|
4
4
|
"description": "Eslint flat config template for TS + React",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint TypeScript + React template",
|
|
@@ -44,9 +44,10 @@
|
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@eslint-react/eslint-plugin": "5.18.6",
|
|
47
|
-
"@ladamczyk/qoq-eslint-v9-js
|
|
48
|
-
"@ladamczyk/qoq-eslint-v9-
|
|
49
|
-
"@ladamczyk/qoq-
|
|
47
|
+
"@ladamczyk/qoq-eslint-v9-js": "^6.0.1",
|
|
48
|
+
"@ladamczyk/qoq-eslint-v9-js-react": "^6.0.1",
|
|
49
|
+
"@ladamczyk/qoq-eslint-v9-ts": "^6.0.1",
|
|
50
|
+
"@ladamczyk/qoq-utils": "^6.0.1"
|
|
50
51
|
},
|
|
51
52
|
"devDependencies": {
|
|
52
53
|
"rimraf": "6.1.3",
|
|
@@ -63,5 +64,5 @@
|
|
|
63
64
|
"publishConfig": {
|
|
64
65
|
"access": "public"
|
|
65
66
|
},
|
|
66
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "a5fb1fef809e1517b34741e8ea8ba7ecb0fc05ab"
|
|
67
68
|
}
|