@interlace/eslint-config 0.1.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/CHANGELOG.md +12 -0
- package/LICENSE +23 -0
- package/README.md +153 -0
- package/package.json +89 -0
- package/src/index.d.ts +79 -0
- package/src/index.js +155 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
## [0.1.0] - 2026-05-16
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
- Initial release. One-extends meta-config for the Interlace ESLint ecosystem.
|
|
6
|
+
- `flagship` preset — composes the 9 flagship-hosting plugins (10 rules total) from `.agent/flagship-rules.md`.
|
|
7
|
+
- `security` preset — composes the 11 security plugins (`secure-coding`, `node-security`, `browser-security`, `jwt`, `pg`, `mongodb-security`, `express-security`, `lambda-security`, `nestjs-security`, `vercel-ai-security`).
|
|
8
|
+
- `quality` preset — composes the 7 code-quality plugins (`import-next`, `conventions`, `maintainability`, `reliability`, `operability`, `modularity`, `modernization`).
|
|
9
|
+
- `react` preset — composes the 2 React plugins (`react-features`, `react-a11y`).
|
|
10
|
+
- `recommended` preset — full default; security + quality + react.
|
|
11
|
+
|
|
12
|
+
Replaces the manual 11-plugin compose previously documented in `.agent/flagship-rules.md`.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Ofri Peretz
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
|
package/README.md
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
# `@interlace/eslint-config`
|
|
2
|
+
|
|
3
|
+
> One-extends meta-config for the [Interlace ESLint ecosystem][monorepo].
|
|
4
|
+
> Replaces the manual 11-plugin compose previously documented in
|
|
5
|
+
> [`.agent/flagship-rules.md`][flagship-spec].
|
|
6
|
+
|
|
7
|
+
ESLint 8 / 9 / 10 — **flat-config only**. If you're still on
|
|
8
|
+
`.eslintrc.js`, see [ESLint's flat-config migration guide][migrate].
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
npm install --save-dev eslint @interlace/eslint-config
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
This package depends on every Interlace plugin. One install brings them all.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Use
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
// eslint.config.mjs
|
|
26
|
+
import interlace from '@interlace/eslint-config';
|
|
27
|
+
|
|
28
|
+
export default [
|
|
29
|
+
...interlace.recommended,
|
|
30
|
+
];
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
That's it. Nineteen plugins, hundreds of rules, one import.
|
|
34
|
+
|
|
35
|
+
### Presets
|
|
36
|
+
|
|
37
|
+
| Preset | Plugins | Use when |
|
|
38
|
+
| -------------- | ------: | ------------------------------------------------------------------------------------------------- |
|
|
39
|
+
| `flagship` | 9 | CI gate that should fail on the highest-signal 10 rules only. See [`flagship-rules.md`][flagship-spec]. |
|
|
40
|
+
| `security` | 10 | All security plugins' recommended presets. |
|
|
41
|
+
| `quality` | 7 | All code-quality plugins' recommended presets (`import-next`, `maintainability`, etc.). |
|
|
42
|
+
| `react` | 2 | `react-features` + `react-a11y` recommended. |
|
|
43
|
+
| `recommended` | 19 | The full default. Equivalent to `[...security, ...quality, ...react]`. |
|
|
44
|
+
|
|
45
|
+
Every preset is a `readonly FlatConfig[]` — spread it into your config array.
|
|
46
|
+
|
|
47
|
+
### CI-gate (flagship only)
|
|
48
|
+
|
|
49
|
+
```js
|
|
50
|
+
// eslint.config.mjs
|
|
51
|
+
import { flagship } from '@interlace/eslint-config';
|
|
52
|
+
|
|
53
|
+
export default [
|
|
54
|
+
...flagship,
|
|
55
|
+
];
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
The flagship preset enables exactly the 10 rules in
|
|
59
|
+
[`.agent/flagship-rules.md`][flagship-spec] § "The 10", all at `error`. No
|
|
60
|
+
opinionated extras, no `recommended`-tier noise — drop it into a release
|
|
61
|
+
gate and it'll fail closed on real bugs only.
|
|
62
|
+
|
|
63
|
+
### React only on JSX/TSX
|
|
64
|
+
|
|
65
|
+
The React presets bind globally by default. To scope them:
|
|
66
|
+
|
|
67
|
+
```js
|
|
68
|
+
import interlace from '@interlace/eslint-config';
|
|
69
|
+
|
|
70
|
+
export default [
|
|
71
|
+
...interlace.security,
|
|
72
|
+
...interlace.quality,
|
|
73
|
+
...interlace.react.map(c => ({ ...c, files: ['**/*.{jsx,tsx}'] })),
|
|
74
|
+
];
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Overrides
|
|
78
|
+
|
|
79
|
+
Flat config is order-sensitive — later entries win. Place your overrides
|
|
80
|
+
after the preset spread:
|
|
81
|
+
|
|
82
|
+
```js
|
|
83
|
+
import interlace from '@interlace/eslint-config';
|
|
84
|
+
|
|
85
|
+
export default [
|
|
86
|
+
...interlace.recommended,
|
|
87
|
+
{
|
|
88
|
+
files: ['**/*.test.ts'],
|
|
89
|
+
rules: {
|
|
90
|
+
'secure-coding/no-hardcoded-credentials': 'off',
|
|
91
|
+
'maintainability/max-lines-per-function': 'off',
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
];
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## What's inside
|
|
100
|
+
|
|
101
|
+
### Security (10)
|
|
102
|
+
|
|
103
|
+
`eslint-plugin-secure-coding` · `eslint-plugin-node-security` ·
|
|
104
|
+
`eslint-plugin-browser-security` · `eslint-plugin-jwt` ·
|
|
105
|
+
`eslint-plugin-pg` · `eslint-plugin-mongodb-security` ·
|
|
106
|
+
`eslint-plugin-express-security` · `eslint-plugin-lambda-security` ·
|
|
107
|
+
`eslint-plugin-nestjs-security` · `eslint-plugin-vercel-ai-security`
|
|
108
|
+
|
|
109
|
+
Covers OWASP Web Top 10 2021, OWASP LLM Top 10 2025 (partial), and a
|
|
110
|
+
broad MITRE CWE map. Domain-vertical depth where the generic
|
|
111
|
+
`eslint-plugin-security` stops.
|
|
112
|
+
|
|
113
|
+
### Code quality (7)
|
|
114
|
+
|
|
115
|
+
`eslint-plugin-import-next` · `eslint-plugin-conventions` ·
|
|
116
|
+
`eslint-plugin-maintainability` · `eslint-plugin-reliability` ·
|
|
117
|
+
`eslint-plugin-operability` · `eslint-plugin-modularity` ·
|
|
118
|
+
`eslint-plugin-modernization`
|
|
119
|
+
|
|
120
|
+
### React (2)
|
|
121
|
+
|
|
122
|
+
`eslint-plugin-react-features` · `eslint-plugin-react-a11y`
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## ESLint version support
|
|
127
|
+
|
|
128
|
+
Peer dep: `eslint@^8.0.0 || ^9.0.0 || ^10.0.0`. The ESLint 10 compat
|
|
129
|
+
matrix runs on every PR in the parent monorepo — see
|
|
130
|
+
[`.github/workflows/eslint-version-matrix.yml`][matrix].
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## Engine portability
|
|
135
|
+
|
|
136
|
+
Every rule in every preset has an oxlint manifest entry in
|
|
137
|
+
[`.agent/oxlint-jsplugins-manifest.json`][oxlint-manifest] (currently
|
|
138
|
+
398/398 compatible). Once oxlint flat-config consumes ESLint configs
|
|
139
|
+
directly, this preset will work there unchanged. See
|
|
140
|
+
[`INTEROP_PHILOSOPHY.md`][interop].
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## License
|
|
145
|
+
|
|
146
|
+
[MIT](./LICENSE) © Ofri Peretz.
|
|
147
|
+
|
|
148
|
+
[monorepo]: https://github.com/ofri-peretz/eslint
|
|
149
|
+
[flagship-spec]: https://github.com/ofri-peretz/eslint/blob/main/.agent/flagship-rules.md
|
|
150
|
+
[migrate]: https://eslint.org/docs/latest/use/configure/migration-guide
|
|
151
|
+
[matrix]: https://github.com/ofri-peretz/eslint/blob/main/.github/workflows/eslint-version-matrix.yml
|
|
152
|
+
[oxlint-manifest]: https://github.com/ofri-peretz/eslint/blob/main/.agent/oxlint-jsplugins-manifest.json
|
|
153
|
+
[interop]: https://github.com/ofri-peretz/eslint/blob/main/INTEROP_PHILOSOPHY.md
|
package/package.json
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@interlace/eslint-config",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "One-extends meta-config for the Interlace ESLint ecosystem. Composes the 9 flagship-hosting plugins (10 rules) and the full 19-plugin recommended preset (security + code-quality + React) into a single import. Replaces the manual 11-plugin compose documented in .agent/flagship-rules.md.",
|
|
5
|
+
"type": "commonjs",
|
|
6
|
+
"main": "./src/index.js",
|
|
7
|
+
"types": "./src/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./src/index.d.ts",
|
|
11
|
+
"default": "./src/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"author": "Ofri Peretz <ofriperetzdev@gmail.com>",
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"homepage": "https://github.com/ofri-peretz/eslint/tree/main/packages/eslint-config-interlace#readme",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/ofri-peretz/eslint",
|
|
20
|
+
"directory": "packages/eslint-config-interlace"
|
|
21
|
+
},
|
|
22
|
+
"bugs": {
|
|
23
|
+
"url": "https://github.com/ofri-peretz/eslint/issues"
|
|
24
|
+
},
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"access": "public"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"src/",
|
|
30
|
+
"dist/",
|
|
31
|
+
"README.md",
|
|
32
|
+
"LICENSE",
|
|
33
|
+
"CHANGELOG.md"
|
|
34
|
+
],
|
|
35
|
+
"keywords": [
|
|
36
|
+
"eslint",
|
|
37
|
+
"eslint-config",
|
|
38
|
+
"eslintconfig",
|
|
39
|
+
"flat-config",
|
|
40
|
+
"interlace",
|
|
41
|
+
"interlace-security",
|
|
42
|
+
"security",
|
|
43
|
+
"owasp",
|
|
44
|
+
"owasp-top-10",
|
|
45
|
+
"react",
|
|
46
|
+
"import",
|
|
47
|
+
"code-quality",
|
|
48
|
+
"meta-config",
|
|
49
|
+
"shareable-config",
|
|
50
|
+
"flagship",
|
|
51
|
+
"recommended",
|
|
52
|
+
"static-analysis"
|
|
53
|
+
],
|
|
54
|
+
"engines": {
|
|
55
|
+
"node": ">=18.0.0"
|
|
56
|
+
},
|
|
57
|
+
"scripts": {
|
|
58
|
+
"build": "tsx ../../scripts/build-package.ts",
|
|
59
|
+
"test": "vitest run",
|
|
60
|
+
"test:coverage": "vitest run --coverage",
|
|
61
|
+
"typecheck": "tsc -p tsconfig.lib.json --noEmit"
|
|
62
|
+
},
|
|
63
|
+
"dependencies": {
|
|
64
|
+
"tslib": "^2.3.0",
|
|
65
|
+
"@interlace/eslint-devkit": "^1.2.1",
|
|
66
|
+
"eslint-plugin-browser-security": "^1.2.3",
|
|
67
|
+
"eslint-plugin-conventions": "^4.0.7",
|
|
68
|
+
"eslint-plugin-express-security": "^1.2.3",
|
|
69
|
+
"eslint-plugin-import-next": "^2.3.6",
|
|
70
|
+
"eslint-plugin-jwt": "^2.2.3",
|
|
71
|
+
"eslint-plugin-lambda-security": "^1.2.3",
|
|
72
|
+
"eslint-plugin-maintainability": "^3.0.3",
|
|
73
|
+
"eslint-plugin-modernization": "^2.0.4",
|
|
74
|
+
"eslint-plugin-modularity": "^2.0.4",
|
|
75
|
+
"eslint-plugin-mongodb-security": "^8.2.3",
|
|
76
|
+
"eslint-plugin-nestjs-security": "^1.2.3",
|
|
77
|
+
"eslint-plugin-node-security": "^4.1.0",
|
|
78
|
+
"eslint-plugin-operability": "^3.0.5",
|
|
79
|
+
"eslint-plugin-pg": "^1.4.3",
|
|
80
|
+
"eslint-plugin-react-a11y": "^2.1.5",
|
|
81
|
+
"eslint-plugin-react-features": "^1.1.4",
|
|
82
|
+
"eslint-plugin-reliability": "^3.1.3",
|
|
83
|
+
"eslint-plugin-secure-coding": "^3.2.0",
|
|
84
|
+
"eslint-plugin-vercel-ai-security": "^1.3.5"
|
|
85
|
+
},
|
|
86
|
+
"peerDependencies": {
|
|
87
|
+
"eslint": "^8.0.0 || ^9.0.0 || ^10.0.0"
|
|
88
|
+
}
|
|
89
|
+
}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026 Ofri Peretz
|
|
3
|
+
* Licensed under the MIT License. Use of this source code is governed by the
|
|
4
|
+
* MIT license that can be found in the LICENSE file.
|
|
5
|
+
*/
|
|
6
|
+
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
7
|
+
type FlatConfig = TSESLint.FlatConfig.Config;
|
|
8
|
+
/**
|
|
9
|
+
* The 10 flagship rules in `.agent/flagship-rules.md`, one preset per plugin.
|
|
10
|
+
* Order matches the spec table; spreading produces deterministic output.
|
|
11
|
+
*
|
|
12
|
+
* Each entry is a single flat-config object — wrap or spread as needed
|
|
13
|
+
* depending on whether you compose with `[...flagship, ...rest]` or with
|
|
14
|
+
* an array literal `[flagship[0], myOverride, flagship[1], ...]`.
|
|
15
|
+
*/
|
|
16
|
+
export declare const flagship: readonly FlatConfig[];
|
|
17
|
+
/**
|
|
18
|
+
* Recommended preset for every security plugin. 10 plugins.
|
|
19
|
+
*/
|
|
20
|
+
export declare const security: readonly FlatConfig[];
|
|
21
|
+
/**
|
|
22
|
+
* Recommended preset for every code-quality plugin. 7 plugins.
|
|
23
|
+
*/
|
|
24
|
+
export declare const quality: readonly FlatConfig[];
|
|
25
|
+
/**
|
|
26
|
+
* Recommended preset for the React plugins. 2 plugins.
|
|
27
|
+
*
|
|
28
|
+
* Apply only to JSX/TSX files in consumer configs:
|
|
29
|
+
*
|
|
30
|
+
* ```js
|
|
31
|
+
* import { react } from '@interlace/eslint-config';
|
|
32
|
+
* export default [
|
|
33
|
+
* ...react.map(c => ({ ...c, files: ['**\/*.{jsx,tsx}'] })),
|
|
34
|
+
* ];
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export declare const react: readonly FlatConfig[];
|
|
38
|
+
/**
|
|
39
|
+
* Component-API preset — the mechanical R5/R6/R8/R18/R19 rules from the
|
|
40
|
+
* `interlace-component` skill. Opt-in: apply to packages that ship shared
|
|
41
|
+
* React components (design-system, `@interlace/ui`, marketing surfaces).
|
|
42
|
+
* Not included in `recommended` because the rules are too strict for
|
|
43
|
+
* application code that hasn't been migrated yet.
|
|
44
|
+
*
|
|
45
|
+
* ```js
|
|
46
|
+
* import { componentApi } from '@interlace/eslint-config';
|
|
47
|
+
* export default [
|
|
48
|
+
* ...componentApi.map(c => ({ ...c, files: ['**\/*.{jsx,tsx}'] })),
|
|
49
|
+
* ];
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export declare const componentApi: readonly FlatConfig[];
|
|
53
|
+
/**
|
|
54
|
+
* Full recommended preset — security + quality + react. 19 plugins.
|
|
55
|
+
*
|
|
56
|
+
* For most projects this is the right starting point:
|
|
57
|
+
*
|
|
58
|
+
* ```js
|
|
59
|
+
* import interlace from '@interlace/eslint-config';
|
|
60
|
+
* export default [
|
|
61
|
+
* ...interlace.recommended,
|
|
62
|
+
* { files: ['**\/*.test.ts'], rules: { 'secure-coding/no-hardcoded-credentials': 'off' } },
|
|
63
|
+
* ];
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
export declare const recommended: readonly FlatConfig[];
|
|
67
|
+
/**
|
|
68
|
+
* Default export aggregates every named preset under one namespace so
|
|
69
|
+
* consumers can `import interlace from '@interlace/eslint-config'`.
|
|
70
|
+
*/
|
|
71
|
+
declare const presets: {
|
|
72
|
+
readonly flagship: readonly TSESLint.FlatConfig.Config[];
|
|
73
|
+
readonly security: readonly TSESLint.FlatConfig.Config[];
|
|
74
|
+
readonly quality: readonly TSESLint.FlatConfig.Config[];
|
|
75
|
+
readonly react: readonly TSESLint.FlatConfig.Config[];
|
|
76
|
+
readonly componentApi: readonly TSESLint.FlatConfig.Config[];
|
|
77
|
+
readonly recommended: readonly TSESLint.FlatConfig.Config[];
|
|
78
|
+
};
|
|
79
|
+
export default presets;
|
package/src/index.js
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2026 Ofri Peretz
|
|
4
|
+
* Licensed under the MIT License. Use of this source code is governed by the
|
|
5
|
+
* MIT license that can be found in the LICENSE file.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.recommended = exports.componentApi = exports.react = exports.quality = exports.security = exports.flagship = void 0;
|
|
9
|
+
/**
|
|
10
|
+
* @interlace/eslint-config
|
|
11
|
+
*
|
|
12
|
+
* One-extends meta-config for the Interlace ESLint ecosystem. Replaces the
|
|
13
|
+
* manual 11-plugin compose documented in `.agent/flagship-rules.md` § "Using
|
|
14
|
+
* the flagship preset".
|
|
15
|
+
*
|
|
16
|
+
* Presets (all are flat-config arrays — drop them into ESLint 9/10 with
|
|
17
|
+
* spread, e.g. `export default [...flagship, ...myOverrides]`):
|
|
18
|
+
*
|
|
19
|
+
* - `flagship` — the 10 flagship rules from 9 plugins
|
|
20
|
+
* - `security` — recommended preset of every security plugin (10)
|
|
21
|
+
* - `quality` — recommended preset of every code-quality plugin (7)
|
|
22
|
+
* - `react` — recommended preset of `react-features` + `react-a11y`
|
|
23
|
+
* - `recommended` — security + quality + react (full default, 19 plugins)
|
|
24
|
+
*
|
|
25
|
+
* See README.md for usage.
|
|
26
|
+
*/
|
|
27
|
+
const eslint_plugin_import_next_1 = require("eslint-plugin-import-next");
|
|
28
|
+
const eslint_plugin_pg_1 = require("eslint-plugin-pg");
|
|
29
|
+
const eslint_plugin_secure_coding_1 = require("eslint-plugin-secure-coding");
|
|
30
|
+
const eslint_plugin_mongodb_security_1 = require("eslint-plugin-mongodb-security");
|
|
31
|
+
const eslint_plugin_jwt_1 = require("eslint-plugin-jwt");
|
|
32
|
+
const eslint_plugin_browser_security_1 = require("eslint-plugin-browser-security");
|
|
33
|
+
const eslint_plugin_react_features_1 = require("eslint-plugin-react-features");
|
|
34
|
+
const eslint_plugin_react_a11y_1 = require("eslint-plugin-react-a11y");
|
|
35
|
+
const eslint_plugin_vercel_ai_security_1 = require("eslint-plugin-vercel-ai-security");
|
|
36
|
+
const eslint_plugin_node_security_1 = require("eslint-plugin-node-security");
|
|
37
|
+
const eslint_plugin_express_security_1 = require("eslint-plugin-express-security");
|
|
38
|
+
const eslint_plugin_lambda_security_1 = require("eslint-plugin-lambda-security");
|
|
39
|
+
const eslint_plugin_nestjs_security_1 = require("eslint-plugin-nestjs-security");
|
|
40
|
+
const eslint_plugin_conventions_1 = require("eslint-plugin-conventions");
|
|
41
|
+
const eslint_plugin_maintainability_1 = require("eslint-plugin-maintainability");
|
|
42
|
+
const eslint_plugin_reliability_1 = require("eslint-plugin-reliability");
|
|
43
|
+
const eslint_plugin_operability_1 = require("eslint-plugin-operability");
|
|
44
|
+
const eslint_plugin_modularity_1 = require("eslint-plugin-modularity");
|
|
45
|
+
const eslint_plugin_modernization_1 = require("eslint-plugin-modernization");
|
|
46
|
+
/**
|
|
47
|
+
* The 10 flagship rules in `.agent/flagship-rules.md`, one preset per plugin.
|
|
48
|
+
* Order matches the spec table; spreading produces deterministic output.
|
|
49
|
+
*
|
|
50
|
+
* Each entry is a single flat-config object — wrap or spread as needed
|
|
51
|
+
* depending on whether you compose with `[...flagship, ...rest]` or with
|
|
52
|
+
* an array literal `[flagship[0], myOverride, flagship[1], ...]`.
|
|
53
|
+
*/
|
|
54
|
+
exports.flagship = [
|
|
55
|
+
eslint_plugin_import_next_1.configs['flagship'],
|
|
56
|
+
eslint_plugin_pg_1.configs['flagship'],
|
|
57
|
+
eslint_plugin_secure_coding_1.configs['flagship'],
|
|
58
|
+
eslint_plugin_mongodb_security_1.configs['flagship'],
|
|
59
|
+
eslint_plugin_jwt_1.configs['flagship'],
|
|
60
|
+
eslint_plugin_browser_security_1.configs['flagship'],
|
|
61
|
+
eslint_plugin_react_features_1.configs['flagship'],
|
|
62
|
+
eslint_plugin_react_a11y_1.configs['flagship'],
|
|
63
|
+
eslint_plugin_vercel_ai_security_1.configs['flagship'],
|
|
64
|
+
];
|
|
65
|
+
/**
|
|
66
|
+
* Recommended preset for every security plugin. 10 plugins.
|
|
67
|
+
*/
|
|
68
|
+
exports.security = [
|
|
69
|
+
eslint_plugin_secure_coding_1.configs['recommended'],
|
|
70
|
+
eslint_plugin_node_security_1.configs['recommended'],
|
|
71
|
+
eslint_plugin_browser_security_1.configs['recommended'],
|
|
72
|
+
eslint_plugin_jwt_1.configs['recommended'],
|
|
73
|
+
eslint_plugin_pg_1.configs['recommended'],
|
|
74
|
+
eslint_plugin_mongodb_security_1.configs['recommended'],
|
|
75
|
+
eslint_plugin_express_security_1.configs['recommended'],
|
|
76
|
+
eslint_plugin_lambda_security_1.configs['recommended'],
|
|
77
|
+
eslint_plugin_nestjs_security_1.configs['recommended'],
|
|
78
|
+
eslint_plugin_vercel_ai_security_1.configs['recommended'],
|
|
79
|
+
];
|
|
80
|
+
/**
|
|
81
|
+
* Recommended preset for every code-quality plugin. 7 plugins.
|
|
82
|
+
*/
|
|
83
|
+
exports.quality = [
|
|
84
|
+
eslint_plugin_import_next_1.configs['recommended'],
|
|
85
|
+
eslint_plugin_conventions_1.configs['recommended'],
|
|
86
|
+
eslint_plugin_maintainability_1.configs['recommended'],
|
|
87
|
+
eslint_plugin_reliability_1.configs['recommended'],
|
|
88
|
+
eslint_plugin_operability_1.configs['recommended'],
|
|
89
|
+
eslint_plugin_modularity_1.configs['recommended'],
|
|
90
|
+
eslint_plugin_modernization_1.configs['recommended'],
|
|
91
|
+
];
|
|
92
|
+
/**
|
|
93
|
+
* Recommended preset for the React plugins. 2 plugins.
|
|
94
|
+
*
|
|
95
|
+
* Apply only to JSX/TSX files in consumer configs:
|
|
96
|
+
*
|
|
97
|
+
* ```js
|
|
98
|
+
* import { react } from '@interlace/eslint-config';
|
|
99
|
+
* export default [
|
|
100
|
+
* ...react.map(c => ({ ...c, files: ['**\/*.{jsx,tsx}'] })),
|
|
101
|
+
* ];
|
|
102
|
+
* ```
|
|
103
|
+
*/
|
|
104
|
+
exports.react = [
|
|
105
|
+
eslint_plugin_react_features_1.configs['recommended'],
|
|
106
|
+
eslint_plugin_react_a11y_1.configs['recommended'],
|
|
107
|
+
];
|
|
108
|
+
/**
|
|
109
|
+
* Component-API preset — the mechanical R5/R6/R8/R18/R19 rules from the
|
|
110
|
+
* `interlace-component` skill. Opt-in: apply to packages that ship shared
|
|
111
|
+
* React components (design-system, `@interlace/ui`, marketing surfaces).
|
|
112
|
+
* Not included in `recommended` because the rules are too strict for
|
|
113
|
+
* application code that hasn't been migrated yet.
|
|
114
|
+
*
|
|
115
|
+
* ```js
|
|
116
|
+
* import { componentApi } from '@interlace/eslint-config';
|
|
117
|
+
* export default [
|
|
118
|
+
* ...componentApi.map(c => ({ ...c, files: ['**\/*.{jsx,tsx}'] })),
|
|
119
|
+
* ];
|
|
120
|
+
* ```
|
|
121
|
+
*/
|
|
122
|
+
exports.componentApi = [
|
|
123
|
+
eslint_plugin_react_features_1.configs['componentApi'],
|
|
124
|
+
];
|
|
125
|
+
/**
|
|
126
|
+
* Full recommended preset — security + quality + react. 19 plugins.
|
|
127
|
+
*
|
|
128
|
+
* For most projects this is the right starting point:
|
|
129
|
+
*
|
|
130
|
+
* ```js
|
|
131
|
+
* import interlace from '@interlace/eslint-config';
|
|
132
|
+
* export default [
|
|
133
|
+
* ...interlace.recommended,
|
|
134
|
+
* { files: ['**\/*.test.ts'], rules: { 'secure-coding/no-hardcoded-credentials': 'off' } },
|
|
135
|
+
* ];
|
|
136
|
+
* ```
|
|
137
|
+
*/
|
|
138
|
+
exports.recommended = [
|
|
139
|
+
...exports.security,
|
|
140
|
+
...exports.quality,
|
|
141
|
+
...exports.react,
|
|
142
|
+
];
|
|
143
|
+
/**
|
|
144
|
+
* Default export aggregates every named preset under one namespace so
|
|
145
|
+
* consumers can `import interlace from '@interlace/eslint-config'`.
|
|
146
|
+
*/
|
|
147
|
+
const presets = {
|
|
148
|
+
flagship: exports.flagship,
|
|
149
|
+
security: exports.security,
|
|
150
|
+
quality: exports.quality,
|
|
151
|
+
react: exports.react,
|
|
152
|
+
componentApi: exports.componentApi,
|
|
153
|
+
recommended: exports.recommended,
|
|
154
|
+
};
|
|
155
|
+
exports.default = presets;
|