@ploaness/config 1.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/LICENSE +21 -0
- package/README.md +13 -0
- package/biome-core.json +128 -0
- package/biome.json +12 -0
- package/dependency-cruiser-core.json +59 -0
- package/dependency-cruiser.json +32 -0
- package/dist/a11y.d.ts +3 -0
- package/dist/a11y.d.ts.map +1 -0
- package/dist/a11y.js +9 -0
- package/dist/a11y.js.map +1 -0
- package/dist/access.d.ts +4 -0
- package/dist/access.d.ts.map +1 -0
- package/dist/access.js +4 -0
- package/dist/access.js.map +1 -0
- package/dist/eslint-core.d.ts +167 -0
- package/dist/eslint-core.d.ts.map +1 -0
- package/dist/eslint-core.js +698 -0
- package/dist/eslint-core.js.map +1 -0
- package/dist/eslint-library.d.ts +3 -0
- package/dist/eslint-library.d.ts.map +1 -0
- package/dist/eslint-library.js +53 -0
- package/dist/eslint-library.js.map +1 -0
- package/dist/eslint.d.ts +3 -0
- package/dist/eslint.d.ts.map +1 -0
- package/dist/eslint.js +261 -0
- package/dist/eslint.js.map +1 -0
- package/dist/playwright.d.ts +3 -0
- package/dist/playwright.d.ts.map +1 -0
- package/dist/playwright.js +108 -0
- package/dist/playwright.js.map +1 -0
- package/dist/project-settings.d.ts +3 -0
- package/dist/project-settings.d.ts.map +1 -0
- package/dist/project-settings.js +23 -0
- package/dist/project-settings.js.map +1 -0
- package/dist/vitest-core.d.ts +90 -0
- package/dist/vitest-core.d.ts.map +1 -0
- package/dist/vitest-core.js +101 -0
- package/dist/vitest-core.js.map +1 -0
- package/dist/vitest-library.d.ts +3 -0
- package/dist/vitest-library.d.ts.map +1 -0
- package/dist/vitest-library.js +37 -0
- package/dist/vitest-library.js.map +1 -0
- package/dist/vitest-setup.d.ts +2 -0
- package/dist/vitest-setup.d.ts.map +1 -0
- package/dist/vitest-setup.js +150 -0
- package/dist/vitest-setup.js.map +1 -0
- package/dist/vitest.d.ts +3 -0
- package/dist/vitest.d.ts.map +1 -0
- package/dist/vitest.js +117 -0
- package/dist/vitest.js.map +1 -0
- package/knip.json +5 -0
- package/package.json +117 -0
- package/pins.json +52 -0
- package/stylelint.json +49 -0
- package/tsconfig-core.json +34 -0
- package/tsconfig.json +11 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Herman Ciechanowiec
|
|
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.
|
package/README.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# @ploaness/config
|
|
2
|
+
|
|
3
|
+
Analyzer and tool configurations owned by ploaness: ESLint, Biome, TypeScript, Vitest, Stylelint, dependency-cruiser, knip.
|
|
4
|
+
|
|
5
|
+
This package is published as part of `ploaness` and is not meant to be depended on directly. Install `ploaness`, which re-exports what a project needs.
|
|
6
|
+
|
|
7
|
+
## Documentation
|
|
8
|
+
|
|
9
|
+
<https://github.com/ciechanowiec/ploaness#readme>
|
|
10
|
+
|
|
11
|
+
## License
|
|
12
|
+
|
|
13
|
+
MIT. See the LICENSE file in this package.
|
package/biome-core.json
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://biomejs.dev/schemas/2.5.11/schema.json",
|
|
3
|
+
"root": false,
|
|
4
|
+
"formatter": {
|
|
5
|
+
"enabled": true,
|
|
6
|
+
"indentStyle": "space",
|
|
7
|
+
"indentWidth": 2,
|
|
8
|
+
"lineWidth": 100,
|
|
9
|
+
"lineEnding": "lf"
|
|
10
|
+
},
|
|
11
|
+
"css": {
|
|
12
|
+
"parser": {
|
|
13
|
+
"tailwindDirectives": true
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"javascript": {
|
|
17
|
+
"formatter": {
|
|
18
|
+
"quoteStyle": "single",
|
|
19
|
+
"semicolons": "asNeeded",
|
|
20
|
+
"trailingCommas": "all"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"linter": {
|
|
24
|
+
"enabled": true,
|
|
25
|
+
"rules": {
|
|
26
|
+
"preset": "recommended",
|
|
27
|
+
"complexity": {
|
|
28
|
+
"noExcessiveCognitiveComplexity": {
|
|
29
|
+
"level": "error",
|
|
30
|
+
"options": {
|
|
31
|
+
"maxAllowedComplexity": 8
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"useSimplifiedLogicExpression": "error",
|
|
35
|
+
"useLiteralKeys": "off",
|
|
36
|
+
"noCommaOperator": "error",
|
|
37
|
+
"noThisInStatic": "error"
|
|
38
|
+
},
|
|
39
|
+
"correctness": {
|
|
40
|
+
"noUnusedImports": "error",
|
|
41
|
+
"noUnusedVariables": "error",
|
|
42
|
+
"noUnusedFunctionParameters": "error",
|
|
43
|
+
"useImportExtensions": "off",
|
|
44
|
+
"noUndeclaredDependencies": "off",
|
|
45
|
+
"noUnresolvedImports": "off"
|
|
46
|
+
},
|
|
47
|
+
"style": {
|
|
48
|
+
"noNonNullAssertion": "error",
|
|
49
|
+
"noParameterAssign": "error",
|
|
50
|
+
"useConst": "error",
|
|
51
|
+
"useBlockStatements": "error",
|
|
52
|
+
"noImplicitBoolean": "error",
|
|
53
|
+
"useDefaultSwitchClause": "error",
|
|
54
|
+
"noDefaultExport": "off",
|
|
55
|
+
"useNamingConvention": {
|
|
56
|
+
"level": "error",
|
|
57
|
+
"options": {
|
|
58
|
+
"strictCase": false,
|
|
59
|
+
"conventions": [
|
|
60
|
+
{
|
|
61
|
+
"selector": {
|
|
62
|
+
"kind": "objectLiteralProperty"
|
|
63
|
+
},
|
|
64
|
+
"match": "_*(.+)",
|
|
65
|
+
"formats": ["camelCase", "CONSTANT_CASE", "PascalCase"]
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"selector": {
|
|
69
|
+
"kind": "typeProperty"
|
|
70
|
+
},
|
|
71
|
+
"match": "_*(.+)",
|
|
72
|
+
"formats": ["camelCase", "CONSTANT_CASE", "PascalCase"]
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"useExplicitLengthCheck": "off",
|
|
78
|
+
"useComponentExportOnlyModules": "off",
|
|
79
|
+
"useCollapsedElseIf": "error",
|
|
80
|
+
"useConsistentArrayType": {
|
|
81
|
+
"level": "error",
|
|
82
|
+
"options": {
|
|
83
|
+
"syntax": "shorthand"
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"useForOf": "error",
|
|
87
|
+
"useShorthandAssign": "error",
|
|
88
|
+
"noYodaExpression": "error",
|
|
89
|
+
"useThrowNewError": "error",
|
|
90
|
+
"useThrowOnlyError": "error",
|
|
91
|
+
"useNumberNamespace": "error",
|
|
92
|
+
"noEnum": "error"
|
|
93
|
+
},
|
|
94
|
+
"performance": {
|
|
95
|
+
"noBarrelFile": "off",
|
|
96
|
+
"noJsxPropsBind": "off"
|
|
97
|
+
},
|
|
98
|
+
"suspicious": {
|
|
99
|
+
"noDoubleEquals": "error",
|
|
100
|
+
"noExplicitAny": "error",
|
|
101
|
+
"noVar": "error",
|
|
102
|
+
"noConsole": {
|
|
103
|
+
"level": "error",
|
|
104
|
+
"options": {
|
|
105
|
+
"allow": ["warn", "error", "info"]
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
"noEmptyBlockStatements": "error",
|
|
109
|
+
"noLeakedRender": "error"
|
|
110
|
+
},
|
|
111
|
+
"security": {
|
|
112
|
+
"noSecrets": "off"
|
|
113
|
+
},
|
|
114
|
+
"nursery": {
|
|
115
|
+
"preset": "recommended",
|
|
116
|
+
"noImpliedEval": "error"
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
"assist": {
|
|
121
|
+
"enabled": true,
|
|
122
|
+
"actions": {
|
|
123
|
+
"source": {
|
|
124
|
+
"organizeImports": "on"
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
package/biome.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$comment": "The framework-neutral half of the ploaness architecture contract, extracted for the reason eslint-core.js was: this repository published the rules and ran none of them on itself, and a cycle grew in packages/governance where nothing was looking. Every rule here is about a shape any repository can have. What stays in the sibling configs is the layer map, which is the one genuinely project-shaped part.",
|
|
3
|
+
"forbidden": [
|
|
4
|
+
{
|
|
5
|
+
"name": "no-circular",
|
|
6
|
+
"severity": "error",
|
|
7
|
+
"comment": "Circular dependencies make modules impossible to reason about or test in isolation. Break the cycle (usually by extracting the shared piece into a lower layer).",
|
|
8
|
+
"from": {},
|
|
9
|
+
"to": {
|
|
10
|
+
"circular": true
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"name": "not-to-unresolvable",
|
|
15
|
+
"severity": "error",
|
|
16
|
+
"comment": "An import that does not resolve is a broken path (a typo, a renamed file, a missing dependency). It would fail at runtime; fail it at the gate instead.",
|
|
17
|
+
"from": {},
|
|
18
|
+
"to": {
|
|
19
|
+
"couldNotResolve": true
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"name": "not-to-spec",
|
|
24
|
+
"severity": "error",
|
|
25
|
+
"comment": "Production code must never import a test/spec file.",
|
|
26
|
+
"from": {},
|
|
27
|
+
"to": {
|
|
28
|
+
"path": "\\.(spec|test)\\.(ts|tsx)$"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "no-deprecated-core",
|
|
33
|
+
"severity": "error",
|
|
34
|
+
"comment": "Do not import deprecated Node.js core modules (punycode, domain, sys, the constants module, ...). They are slated for removal.",
|
|
35
|
+
"from": {},
|
|
36
|
+
"to": {
|
|
37
|
+
"dependencyTypes": ["core"],
|
|
38
|
+
"path": [
|
|
39
|
+
"^(v8/tools/codemap)$",
|
|
40
|
+
"^(node:)?(_(linklist|stream_wrap)|sys|constants|domain|punycode)$"
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"options": {
|
|
46
|
+
"doNotFollow": {
|
|
47
|
+
"path": "(^|/)node_modules/"
|
|
48
|
+
},
|
|
49
|
+
"tsConfig": {
|
|
50
|
+
"fileName": "tsconfig.json"
|
|
51
|
+
},
|
|
52
|
+
"tsPreCompilationDeps": true,
|
|
53
|
+
"enhancedResolveOptions": {
|
|
54
|
+
"exportsFields": ["exports"],
|
|
55
|
+
"conditionNames": ["import", "require", "node", "default", "types"],
|
|
56
|
+
"mainFields": ["module", "main", "types", "typings"]
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "./dependency-cruiser-core.json",
|
|
3
|
+
"forbidden": [
|
|
4
|
+
{
|
|
5
|
+
"name": "nothing-imports-app",
|
|
6
|
+
"severity": "error",
|
|
7
|
+
"comment": "The Next.js app/routing layer (src/app) is the top layer: it composes everything else and nothing imports it back. Phrased as 'anything outside src/app must not import src/app' rather than enumerating the lower layers, so a NEW source directory is governed automatically without anyone remembering to add it here.",
|
|
8
|
+
"from": {
|
|
9
|
+
"path": "^src/",
|
|
10
|
+
"pathNot": "^src/app/"
|
|
11
|
+
},
|
|
12
|
+
"to": {
|
|
13
|
+
"path": "^src/app/"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"name": "not-to-dev-dep",
|
|
18
|
+
"severity": "error",
|
|
19
|
+
"comment": "Production source must not import a devDependency (a test util, a build tool). Those are absent from a production install, so this would crash in prod. Move the dependency, or the code.",
|
|
20
|
+
"from": {
|
|
21
|
+
"path": "^src/",
|
|
22
|
+
"pathNot": "\\.(spec|test)\\.(ts|tsx)$"
|
|
23
|
+
},
|
|
24
|
+
"to": {
|
|
25
|
+
"dependencyTypes": ["npm-dev"],
|
|
26
|
+
"dependencyTypesNot": ["type-only"],
|
|
27
|
+
"pathNot": ["node_modules/@types/"]
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"$comment": "The Payload layer map, minus the pure-logic floor. That rule is rendered per project from the declared pureLogicRoots, because the floor is the one genuinely project-shaped part of an architecture contract and a project may not own this file to state it."
|
|
32
|
+
}
|
package/dist/a11y.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"a11y.d.ts","sourceRoot":"","sources":["../src/a11y.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,sBAAsB,EAAE,SAAS,MAAM,EAA4C,CAAA;AAEhG,eAAO,MAAM,gBAAgB,EAAE,MAAiD,CAAA"}
|
package/dist/a11y.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// The two facts the shipped accessibility sweep cannot know about the project it runs in.
|
|
2
|
+
//
|
|
3
|
+
// The sweep itself is a managed file, byte-identical in every consumer, so this module is the whole of
|
|
4
|
+
// its configuration surface. Both entries are one-directional: a project may add a route prefix the
|
|
5
|
+
// crawl must not follow and may lower the route ceiling, and can do neither in the other direction.
|
|
6
|
+
import { projectSettings } from './project-settings.js';
|
|
7
|
+
export const SKIPPED_ROUTE_PREFIXES = projectSettings.accessibilitySkipRoutes;
|
|
8
|
+
export const MAX_SWEEP_ROUTES = projectSettings.accessibilityRouteBudget;
|
|
9
|
+
//# sourceMappingURL=a11y.js.map
|
package/dist/a11y.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"a11y.js","sourceRoot":"","sources":["../src/a11y.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,EAAE;AACF,uGAAuG;AACvG,oGAAoG;AACpG,oGAAoG;AACpG,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAEvD,MAAM,CAAC,MAAM,sBAAsB,GAAsB,eAAe,CAAC,uBAAuB,CAAA;AAEhG,MAAM,CAAC,MAAM,gBAAgB,GAAW,eAAe,CAAC,wBAAwB,CAAA"}
|
package/dist/access.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"access.d.ts","sourceRoot":"","sources":["../src/access.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAGxD,OAAO,EAAE,KAAK,YAAY,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAE1E,eAAO,MAAM,aAAa,EAAE,SAAS,YAAY,EAAiC,CAAA"}
|
package/dist/access.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"access.js","sourceRoot":"","sources":["../src/access.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAEvD,OAAO,EAAqB,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAE1E,MAAM,CAAC,MAAM,aAAa,GAA4B,eAAe,CAAC,YAAY,CAAA"}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import type { Linter } from 'eslint';
|
|
2
|
+
import { defineConfig } from 'eslint/config';
|
|
3
|
+
/**
|
|
4
|
+
* One flat-config block, described by its shape rather than by the plugins' own declarations.
|
|
5
|
+
*
|
|
6
|
+
* Those declarations name symbols from deep inside the dependency tree - `Immutability` from
|
|
7
|
+
* is-immutable-type, `RuleEnforcementComparator` from eslint-plugin-functional - which a declaration
|
|
8
|
+
* file emitted beside this module cannot reference portably, and naming them would make each of those
|
|
9
|
+
* packages resolvable-from-here a condition of consuming this one. `packages/ploaness` records the same
|
|
10
|
+
* decision for its own re-exports. A module that composes blocks and hands them to ESLint needs their
|
|
11
|
+
* shape, not their provenance; ESLint validates the result it is given.
|
|
12
|
+
*/
|
|
13
|
+
export type FlatConfigBlock = Readonly<Record<string, unknown>>;
|
|
14
|
+
/**
|
|
15
|
+
* One rule table: a rule id against whatever that rule's own declaration accepts.
|
|
16
|
+
*
|
|
17
|
+
* ESLint's own type rather than a structural stand-in. `eslint` is a declared dependency of this
|
|
18
|
+
* package - every plugin imported above requires it at runtime - so naming the real type costs nothing
|
|
19
|
+
* and lets a caller spread this table into a config block without an assertion. That matters here
|
|
20
|
+
* because an assertion is uncovered by the type coverage measurement this repository holds at 100%.
|
|
21
|
+
*/
|
|
22
|
+
export type RuleTable = Partial<Linter.RulesRecord>;
|
|
23
|
+
/** One `no-restricted-syntax` entry: the shape to reject, and what to say when it appears. */
|
|
24
|
+
export interface RestrictedSyntax {
|
|
25
|
+
readonly selector: string;
|
|
26
|
+
readonly message: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* A whole `no-restricted-syntax` setting: the severity first, then the shapes.
|
|
30
|
+
*
|
|
31
|
+
* A tuple rather than an array, because that is what the rule's own declaration is. Typed as a plain
|
|
32
|
+
* array, the severity in position zero is indistinguishable from an entry, and a caller spreading this
|
|
33
|
+
* into a config block gets a type error it can only clear with an assertion.
|
|
34
|
+
*
|
|
35
|
+
* The severity is the literal rather than ESLint's own union: a warning severity does not exist in a
|
|
36
|
+
* governed repository, which is the rule the escalation below enforces on every preset layer.
|
|
37
|
+
*/
|
|
38
|
+
export type RestrictedSyntaxSetting = readonly ['error', ...RestrictedSyntax[]];
|
|
39
|
+
/** One `no-restricted-properties` entry: the member access to reject, and what to say instead. */
|
|
40
|
+
export interface RestrictedProperty {
|
|
41
|
+
readonly object: string;
|
|
42
|
+
readonly property: string;
|
|
43
|
+
readonly message: string;
|
|
44
|
+
}
|
|
45
|
+
/** Composes flat-config blocks into the array ESLint reads. */
|
|
46
|
+
export type Compose = (...blocks: readonly unknown[]) => readonly FlatConfigBlock[];
|
|
47
|
+
declare const NO_MOCK_PROPERTIES: readonly RestrictedProperty[];
|
|
48
|
+
declare const NO_INHERITANCE: RestrictedSyntaxSetting;
|
|
49
|
+
declare const NO_LITERAL_ASSERTIONS: readonly RestrictedSyntax[];
|
|
50
|
+
/**
|
|
51
|
+
* Re-exported so a caller declares no plugin version of its own.
|
|
52
|
+
*
|
|
53
|
+
* `defineConfig` rather than `tseslint.config`, which typescript-eslint deprecated in favour of it: the
|
|
54
|
+
* composition of flat-config blocks is ESLint's own concern now, and this is where a governed project
|
|
55
|
+
* reaches it. `eslint` is declared as a dependency of this package for the same reason - every plugin
|
|
56
|
+
* imported above already requires it at runtime, and resolving it out of whatever the consumer happens
|
|
57
|
+
* to have hoisted is a resolution this package should not depend on.
|
|
58
|
+
*
|
|
59
|
+
* Typed against `FlatConfigBlock` rather than against `defineConfig`'s own parameter type, for the
|
|
60
|
+
* reason that alias exists. This assertion is the single place the widening happens: every caller then
|
|
61
|
+
* composes blocks without one of its own, and a block's shape is still checked by ESLint, which is the
|
|
62
|
+
* only thing that can validate a rule's options anyway.
|
|
63
|
+
*/
|
|
64
|
+
export declare const compose: typeof defineConfig;
|
|
65
|
+
/** Formatting is Biome's job; this disables every conflicting stylistic rule and must stay last. */
|
|
66
|
+
export declare const prettierLast: FlatConfigBlock;
|
|
67
|
+
/** The preset layers every ploaness-governed project runs, none of which may report at `warn`. */
|
|
68
|
+
export declare const baseLayers: readonly FlatConfigBlock[];
|
|
69
|
+
/**
|
|
70
|
+
* Type-aware parsing, with the caller supplying the parser options its layout needs.
|
|
71
|
+
* @param parserOptions the typescript-eslint parser options.
|
|
72
|
+
* @returns a flat-config block.
|
|
73
|
+
*/
|
|
74
|
+
export declare const typeAwareParsing: (parserOptions: Readonly<Record<string, unknown>>) => FlatConfigBlock;
|
|
75
|
+
/** The maximum-explicit rule set: the caps, the explicitness rules, the bans, the mock ban. */
|
|
76
|
+
export declare const guidelineRules: RuleTable;
|
|
77
|
+
/**
|
|
78
|
+
* The plugin the block below needs, re-exported so a caller declares no version of its own.
|
|
79
|
+
*
|
|
80
|
+
* Typed as a PLUGIN rather than as a `FlatConfigBlock`, because it is not one: a plugin object carries
|
|
81
|
+
* `meta`, `configs` and `environments`, and ESLint rejects an entire config the moment one of those
|
|
82
|
+
* appears as a top-level entry. Calling it a block is what let `eslint-library.ts` spread it into
|
|
83
|
+
* `compose(...)`, and that config crashed on load for every consumer that used it. The type is derived
|
|
84
|
+
* from the field it has to be assigned to, so it cannot drift from what ESLint accepts there.
|
|
85
|
+
*/
|
|
86
|
+
export type ESLintPlugin = NonNullable<Linter.Config['plugins']>[string];
|
|
87
|
+
export declare const vitestPlugin: ESLintPlugin;
|
|
88
|
+
/** The Vitest half of the test-integrity block, shared by every config that lints a Vitest suite. */
|
|
89
|
+
export declare const testIntegrityRules: RuleTable;
|
|
90
|
+
/**
|
|
91
|
+
* The framework idiom a spec is written in, which the production rules were never aimed at.
|
|
92
|
+
*
|
|
93
|
+
* Only idiom is relaxed. Every rule that carries a rule of the governing standard - the size caps, the
|
|
94
|
+
* explicitness rules, the ban on a non-null assertion, the unsafe-any family - stays ON, because the
|
|
95
|
+
* standard says test code passes the same static-analysis checks as production code. A relaxation that
|
|
96
|
+
* made a test easier to write by making it less checked would exempt the suite from the contract it
|
|
97
|
+
* exists to enforce.
|
|
98
|
+
*
|
|
99
|
+
* Shared by every shipped config rather than stated in each, because what earns the exemption is being a
|
|
100
|
+
* SPEC rather than being a Payload application's spec. Stated twice it drifted: a library consumer's
|
|
101
|
+
* tests were held to the bare-number ban a Payload consumer's were not, and neither config was wrong
|
|
102
|
+
* read on its own, which is why nothing found it for as long as it stood.
|
|
103
|
+
*/
|
|
104
|
+
export declare const testIdiomRules: RuleTable;
|
|
105
|
+
declare const NO_FAST_CHECK_SEED: readonly RestrictedSyntax[];
|
|
106
|
+
declare const NO_NETWORK_GUARD_ESCAPE: readonly RestrictedSyntax[];
|
|
107
|
+
declare const NO_TEST_ORDER_ESCAPE: readonly RestrictedSyntax[];
|
|
108
|
+
/**
|
|
109
|
+
* Everything a Vitest spec is guarded against, as ONE table.
|
|
110
|
+
*
|
|
111
|
+
* Assembled here rather than at each call site because a block that sets `no-restricted-syntax`
|
|
112
|
+
* REPLACES the setting rather than adding to it. A config listing four of these five has not weakened a
|
|
113
|
+
* rule anybody can read; it has silently dropped the fifth. The library config listed none of them and
|
|
114
|
+
* kept only the inheritance ban it inherited from the guideline layer, so a library's specs could assert
|
|
115
|
+
* a literal against itself, pin their own order, seed a property test per-call, and open a transport the
|
|
116
|
+
* network guard cannot reach - seventeen selectors, none of them Payload-specific.
|
|
117
|
+
*
|
|
118
|
+
* A table rather than the bare setting, so a call site spreads it as it spreads every other table here.
|
|
119
|
+
* Handed out as a setting it has to be re-wrapped under its key at each call site, and that re-wrapping
|
|
120
|
+
* is the replacement - the one move this constant exists to stop anybody making by hand.
|
|
121
|
+
*/
|
|
122
|
+
export declare const testSuiteSyntaxRules: RuleTable;
|
|
123
|
+
/**
|
|
124
|
+
* The same contract, applied to a file that is JavaScript rather than TypeScript.
|
|
125
|
+
*
|
|
126
|
+
* A check a repository implements itself is source code of that repository, so the programs that
|
|
127
|
+
* implement one are held to the code rules like anything else - and a build script or a runtime shim
|
|
128
|
+
* cannot be TypeScript, because the tool that loads it reads it as JavaScript. The rule list is not
|
|
129
|
+
* restated here: it is the same object, minus the four rules that ask for syntax a JavaScript file
|
|
130
|
+
* cannot carry, and with the bare-number ban expressed through the base rule because the typed variant
|
|
131
|
+
* reads type information such a file does not have. The allowlist it reads is the same one.
|
|
132
|
+
* @param files the glob patterns this block governs.
|
|
133
|
+
* @returns a flat-config block.
|
|
134
|
+
*/
|
|
135
|
+
export declare const javascriptBlock: (files: readonly string[]) => FlatConfigBlock;
|
|
136
|
+
/** No `let`, no in-place mutation. The caller supplies the files and the generated-role exemptions. */
|
|
137
|
+
export declare const immutabilityBlock: (files: readonly string[], ignores: readonly string[]) => FlatConfigBlock;
|
|
138
|
+
/**
|
|
139
|
+
* The setup file's role, which is to configure the process rather than to hold program logic.
|
|
140
|
+
*
|
|
141
|
+
* A block of its own rather than a whole-file entry in `immutabilityBlock`'s `ignores`, so the file is
|
|
142
|
+
* still held to `no-let` and to every mutation that is not the environment. ploaness's own exemption is
|
|
143
|
+
* whole-file because installing a guard on `net.Socket.prototype` IS mutation of an existing object; a
|
|
144
|
+
* consumer's setup file needs the environment and nothing more.
|
|
145
|
+
*/
|
|
146
|
+
export declare const processConfigBlock: () => FlatConfigBlock;
|
|
147
|
+
/**
|
|
148
|
+
* A spec's need to VARY the environment, which the setup file's carve-out does not cover.
|
|
149
|
+
*
|
|
150
|
+
* The block above admits `process.env` at `vitest.setup.ts`, which configures the process once, before
|
|
151
|
+
* any spec reads it. That is not the same permission a spec needs: a branch taken only when a variable
|
|
152
|
+
* is unset, and another taken only when it is set, cannot both be observed from a value fixed for the
|
|
153
|
+
* whole run. Varying it per case was the missing half, and every mechanism for doing so was banned -
|
|
154
|
+
* `vi.stubEnv` by the mock ban, `test.env` by the Vitest config having to be a bare re-export, and a
|
|
155
|
+
* direct assignment by this rule. Three bans meeting over one need, while the coverage floor still
|
|
156
|
+
* required the branch. Found by a consumer whose endpoint returns 503 with no API key configured, which
|
|
157
|
+
* no legal test could reach.
|
|
158
|
+
*
|
|
159
|
+
* The exemption is the environment and nothing else, so `no-let` and every other in-place mutation still
|
|
160
|
+
* apply to a spec - and it is `tests/**` in both shipped configs rather than the Vitest globs alone,
|
|
161
|
+
* because two configs that disagree about one path are what `eslint-process-scope.spec.ts` exists to
|
|
162
|
+
* catch.
|
|
163
|
+
*/
|
|
164
|
+
export declare const specEnvironmentBlock: () => FlatConfigBlock;
|
|
165
|
+
/** The shared selectors, re-exported so a scoped block can spread rather than restate them. */
|
|
166
|
+
export { NO_FAST_CHECK_SEED, NO_INHERITANCE, NO_LITERAL_ASSERTIONS, NO_MOCK_PROPERTIES, NO_NETWORK_GUARD_ESCAPE, NO_TEST_ORDER_ESCAPE, };
|
|
167
|
+
//# sourceMappingURL=eslint-core.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eslint-core.d.ts","sourceRoot":"","sources":["../src/eslint-core.ts"],"names":[],"mappings":"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"}
|