@sister.software/oxlint-config 9.3.0 → 11.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/README.md +198 -10
- package/out/browser-globals.d.ts +15 -0
- package/out/browser-globals.d.ts.map +1 -0
- package/out/browser-globals.js +76 -0
- package/out/browser-globals.js.map +1 -0
- package/out/console-padding-plugin.d.ts +16 -0
- package/out/console-padding-plugin.d.ts.map +1 -0
- package/out/console-padding-plugin.js +68 -0
- package/out/console-padding-plugin.js.map +1 -0
- package/out/constant-doc-plugin.d.ts +32 -0
- package/out/constant-doc-plugin.d.ts.map +1 -0
- package/out/constant-doc-plugin.js +91 -0
- package/out/constant-doc-plugin.js.map +1 -0
- package/out/headers-plugin.d.ts +6 -2
- package/out/headers-plugin.d.ts.map +1 -1
- package/out/headers-plugin.js +4 -2
- package/out/headers-plugin.js.map +1 -1
- package/out/index.d.ts +166 -13
- package/out/index.d.ts.map +1 -1
- package/out/index.js +332 -6
- package/out/index.js.map +1 -1
- package/out/jsdoc-plugin.d.ts +16 -0
- package/out/jsdoc-plugin.d.ts.map +1 -0
- package/out/jsdoc-plugin.js +68 -0
- package/out/jsdoc-plugin.js.map +1 -0
- package/out/length-truthiness-plugin.d.ts +18 -0
- package/out/length-truthiness-plugin.d.ts.map +1 -0
- package/out/length-truthiness-plugin.js +123 -0
- package/out/length-truthiness-plugin.js.map +1 -0
- package/out/multiline-statement-plugin.d.ts +18 -0
- package/out/multiline-statement-plugin.d.ts.map +1 -0
- package/out/multiline-statement-plugin.js +93 -0
- package/out/multiline-statement-plugin.js.map +1 -0
- package/out/padding-plugin.d.ts +4 -3
- package/out/padding-plugin.d.ts.map +1 -1
- package/out/padding-plugin.js +44 -27
- package/out/padding-plugin.js.map +1 -1
- package/out/padding-utils.d.ts +34 -0
- package/out/padding-utils.d.ts.map +1 -0
- package/out/padding-utils.js +50 -0
- package/out/padding-utils.js.map +1 -0
- package/out/plugin-types.d.ts +68 -3
- package/out/plugin-types.d.ts.map +1 -1
- package/out/plugin.d.ts.map +1 -1
- package/out/plugin.js +17 -0
- package/out/plugin.js.map +1 -1
- package/out/process-globals-plugin.d.ts.map +1 -1
- package/out/process-globals-plugin.js +6 -2
- package/out/process-globals-plugin.js.map +1 -1
- package/out/restrictions.d.ts +9 -3
- package/out/restrictions.d.ts.map +1 -1
- package/out/restrictions.js +4 -70
- package/out/restrictions.js.map +1 -1
- package/out/section-marker-plugin.d.ts +25 -0
- package/out/section-marker-plugin.d.ts.map +1 -0
- package/out/section-marker-plugin.js +234 -0
- package/out/section-marker-plugin.js.map +1 -0
- package/out/threshold-plugin.d.ts +27 -0
- package/out/threshold-plugin.d.ts.map +1 -0
- package/out/threshold-plugin.js +78 -0
- package/out/threshold-plugin.js.map +1 -0
- package/package.json +2 -2
- package/src/browser-globals.ts +77 -0
- package/src/console-padding-plugin.ts +76 -0
- package/src/constant-doc-plugin.ts +124 -0
- package/src/headers-plugin.ts +7 -3
- package/src/index.ts +490 -17
- package/src/jsdoc-plugin.ts +75 -0
- package/src/length-truthiness-plugin.ts +142 -0
- package/src/multiline-statement-plugin.ts +104 -0
- package/src/padding-plugin.ts +44 -29
- package/src/padding-utils.ts +70 -0
- package/src/plugin-types.ts +68 -3
- package/src/plugin.ts +22 -0
- package/src/process-globals-plugin.ts +6 -2
- package/src/restrictions.ts +16 -77
- package/src/section-marker-plugin.ts +306 -0
- package/src/threshold-plugin.ts +105 -0
package/out/index.d.ts
CHANGED
|
@@ -5,37 +5,190 @@
|
|
|
5
5
|
* @file oxlint configuration factory for Sister Software projects.
|
|
6
6
|
*/
|
|
7
7
|
export * from "./restrictions.js";
|
|
8
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* An oxlint configuration object, as consumed by `oxlint.config.ts` / `.oxlintrc.json`.
|
|
10
|
+
*/
|
|
9
11
|
export type OxlintConfig = Record<string, unknown>;
|
|
10
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* Numeric ceilings for the legibility-guardrail rules. Each is a hard ceiling, not a target.
|
|
14
|
+
*/
|
|
15
|
+
export interface OxlintConfigLimits {
|
|
16
|
+
/**
|
|
17
|
+
* Maximum block nesting depth.
|
|
18
|
+
*/
|
|
19
|
+
maxDepth: number;
|
|
20
|
+
/**
|
|
21
|
+
* Maximum parameters on a single function.
|
|
22
|
+
*/
|
|
23
|
+
maxParams: number;
|
|
24
|
+
/**
|
|
25
|
+
* Maximum statements in a single function body.
|
|
26
|
+
*/
|
|
27
|
+
maxStatements: number;
|
|
28
|
+
/**
|
|
29
|
+
* Maximum lines in a single function body, blank lines and comments excluded.
|
|
30
|
+
*/
|
|
31
|
+
maxLinesPerFunction: number;
|
|
32
|
+
/**
|
|
33
|
+
* Maximum lines in a single file, blank lines and comments excluded.
|
|
34
|
+
*/
|
|
35
|
+
maxLines: number;
|
|
36
|
+
/**
|
|
37
|
+
* Maximum nested callback depth.
|
|
38
|
+
*/
|
|
39
|
+
maxNestedCallbacks: number;
|
|
40
|
+
/**
|
|
41
|
+
* Maximum nested call-expression depth, e.g. `a(b(c(d())))`.
|
|
42
|
+
*/
|
|
43
|
+
maxNestedCalls: number;
|
|
44
|
+
/**
|
|
45
|
+
* Maximum cyclomatic complexity of a single function.
|
|
46
|
+
*/
|
|
47
|
+
complexity: number;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Calibrated against the mailwoman corpus (1,048 non-test source files). Each value sits just past the knee in that
|
|
51
|
+
* repo's distribution, so considered human code stays silent and runaway generation does not. See the design spec for
|
|
52
|
+
* the full sweep.
|
|
53
|
+
*
|
|
54
|
+
* The four SIZE ceilings are deliberately looser than the knee. Adopting v10 surfaced 172 pre-existing violations, and
|
|
55
|
+
* splitting that many functions across a parser — with no accuracy gate available to verify the result — is a larger
|
|
56
|
+
* risk than the legibility it buys. They are set at the p90 of the measured overage instead, so the worst decile had to
|
|
57
|
+
* be fixed at adoption while the body was grandfathered:
|
|
58
|
+
*
|
|
59
|
+
* max-statements n=88 median= 73 p90= 115 max= 272
|
|
60
|
+
* complexity n=32 median= 49 p90= 84 max= 173
|
|
61
|
+
* max-lines-per-function n=26 median=283 p90= 829 max=1329
|
|
62
|
+
* max-params n=15 median= 7 p90= 8 max= 10
|
|
63
|
+
*
|
|
64
|
+
* RATCHET THESE DOWN as the grandfathered functions are split. They exist to stop new code drifting, and every step
|
|
65
|
+
* toward the knee makes them do more of that job.
|
|
66
|
+
*/
|
|
67
|
+
export declare const DefaultLimits: OxlintConfigLimits;
|
|
68
|
+
/**
|
|
69
|
+
* Globs treated as test files, where the size and named-constant rules are switched off.
|
|
70
|
+
*/
|
|
71
|
+
export declare const DefaultTestFilePatterns: string[];
|
|
72
|
+
/**
|
|
73
|
+
* Globs whose contents are emitted by a generator, not written by hand. The size ceilings are meaningless there — the
|
|
74
|
+
* file is as long as its input is wide, and no reviewer reads it top to bottom — but every correctness rule still
|
|
75
|
+
* applies, because generated code ships.
|
|
76
|
+
*/
|
|
77
|
+
export declare const DefaultGeneratedFilePatterns: string[];
|
|
78
|
+
/**
|
|
79
|
+
* Globs for files JavaScript checks at runtime rather than TypeScript checking ahead of it. A JSDoc block there often
|
|
80
|
+
* IS the type annotation, and a one-line `@type` cast is the idiomatic form — so the multi-line requirement, which
|
|
81
|
+
* exists to make prose read as documentation, does not apply.
|
|
82
|
+
*/
|
|
83
|
+
export declare const DefaultUntypedFilePatterns: string[];
|
|
84
|
+
/**
|
|
85
|
+
* Options for {@link createOxlintConfig}.
|
|
86
|
+
*/
|
|
11
87
|
export interface OxlintConfigOptions {
|
|
12
|
-
/**
|
|
88
|
+
/**
|
|
89
|
+
* The package namespace whose runtime boundaries are enforced, e.g. `@sister.software`.
|
|
90
|
+
*/
|
|
13
91
|
packageNamespace?: string;
|
|
14
|
-
/**
|
|
92
|
+
/**
|
|
93
|
+
* The copyright holder stamped into file headers.
|
|
94
|
+
*/
|
|
15
95
|
copyrightHolder?: string;
|
|
16
|
-
/**
|
|
96
|
+
/**
|
|
97
|
+
* The SPDX license identifier stamped into file headers.
|
|
98
|
+
*/
|
|
17
99
|
spdxLicenseIdentifier?: string;
|
|
18
|
-
/**
|
|
100
|
+
/**
|
|
101
|
+
* The author stamped into file headers.
|
|
102
|
+
*/
|
|
19
103
|
author?: string;
|
|
20
|
-
/**
|
|
104
|
+
/**
|
|
105
|
+
* Enable oxlint's React plugin (off by default).
|
|
106
|
+
*/
|
|
21
107
|
react?: boolean;
|
|
22
|
-
/**
|
|
108
|
+
/**
|
|
109
|
+
* Enforce file headers via the bundled JS plugin (on by default).
|
|
110
|
+
*/
|
|
23
111
|
headers?: boolean;
|
|
24
|
-
/**
|
|
112
|
+
/**
|
|
113
|
+
* Require a blank line before `return`/block-like statements (on by default).
|
|
114
|
+
*/
|
|
25
115
|
padding?: boolean;
|
|
26
|
-
/**
|
|
116
|
+
/**
|
|
117
|
+
* Blank line on each side of a `console.*` call, with runs of them grouped (on by default).
|
|
118
|
+
*/
|
|
119
|
+
consolePadding?: boolean;
|
|
120
|
+
/**
|
|
121
|
+
* Blank line on each side of a statement that spans lines (on by default).
|
|
122
|
+
*/
|
|
123
|
+
multilineStatementPadding?: boolean;
|
|
124
|
+
/**
|
|
125
|
+
* Require braces around single-statement work bodies (bare `return` exempt; on by default).
|
|
126
|
+
*/
|
|
27
127
|
braces?: boolean;
|
|
28
128
|
/**
|
|
29
129
|
* Forbid direct `process.env` / `process.argv` access (off by default). Turn on once the project funnels those reads
|
|
30
130
|
* through blessed helpers, which disable `sister-software/no-process-globals`.
|
|
31
131
|
*/
|
|
32
132
|
restrictProcessGlobals?: boolean;
|
|
33
|
-
/**
|
|
133
|
+
/**
|
|
134
|
+
* Flag numeric literals used as comparison thresholds (off by default). Pass an object to change the ignore list or
|
|
135
|
+
* to stop exempting radix-prefixed literals.
|
|
136
|
+
*/
|
|
137
|
+
unnamedThresholds?: boolean | {
|
|
138
|
+
ignore?: number[];
|
|
139
|
+
allowHex?: boolean;
|
|
140
|
+
};
|
|
141
|
+
/**
|
|
142
|
+
* Require a JSDoc block on module-level constants (off by default). `scope` selects which ones: `"exported"`,
|
|
143
|
+
* `"screaming"`, or the default `"exported-or-screaming"`.
|
|
144
|
+
*/
|
|
145
|
+
constantDocs?: boolean | {
|
|
146
|
+
scope?: "exported" | "screaming" | "exported-or-screaming";
|
|
147
|
+
};
|
|
148
|
+
/**
|
|
149
|
+
* Rewrite explicit length comparisons to truthiness in boolean positions (on by default).
|
|
150
|
+
*/
|
|
151
|
+
lengthTruthiness?: boolean;
|
|
152
|
+
/**
|
|
153
|
+
* Require JSDoc blocks to span multiple lines (on by default). Off for untyped files.
|
|
154
|
+
*/
|
|
155
|
+
multilineJSDoc?: boolean;
|
|
156
|
+
/**
|
|
157
|
+
* Enforce the section-marker ladder — `----` banners become `// MARK:`, long labels are flagged, and a file with many
|
|
158
|
+
* markers is nudged toward regions and then toward being several files (on by default).
|
|
159
|
+
*/
|
|
160
|
+
sectionMarkers?: boolean | {
|
|
161
|
+
maxBodyLength?: number;
|
|
162
|
+
maxRegions?: number;
|
|
163
|
+
};
|
|
164
|
+
/**
|
|
165
|
+
* Override individual legibility ceilings. Unspecified keys keep their calibrated default.
|
|
166
|
+
*/
|
|
167
|
+
limits?: Partial<OxlintConfigLimits>;
|
|
168
|
+
/**
|
|
169
|
+
* Replace the globs treated as test files.
|
|
170
|
+
*/
|
|
171
|
+
testFilePatterns?: string[];
|
|
172
|
+
/**
|
|
173
|
+
* Replace the globs treated as generated files, where only the size ceilings are switched off.
|
|
174
|
+
*/
|
|
175
|
+
generatedFilePatterns?: string[];
|
|
176
|
+
/**
|
|
177
|
+
* Replace the globs treated as untyped, where the multi-line JSDoc requirement switches off.
|
|
178
|
+
*/
|
|
179
|
+
untypedFilePatterns?: string[];
|
|
180
|
+
/**
|
|
181
|
+
* Override the default ignore patterns.
|
|
182
|
+
*/
|
|
34
183
|
ignorePatterns?: string[];
|
|
35
|
-
/**
|
|
184
|
+
/**
|
|
185
|
+
* Extra config deep-merged last; an escape hatch for per-repo tweaks.
|
|
186
|
+
*/
|
|
36
187
|
overrides?: OxlintConfig;
|
|
37
188
|
}
|
|
38
|
-
/**
|
|
189
|
+
/**
|
|
190
|
+
* Default ignore patterns for generated/build output and vendored tooling.
|
|
191
|
+
*/
|
|
39
192
|
export declare const DefaultIgnorePatterns: string[];
|
|
40
193
|
/**
|
|
41
194
|
* Builds the complete oxlint configuration for a Sister Software package.
|
package/out/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,cAAc,mBAAmB,CAAA;AAEjC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,cAAc,mBAAmB,CAAA;AAEjC;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAElD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;IAChB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAA;IACrB;;OAEG;IACH,mBAAmB,EAAE,MAAM,CAAA;IAC3B;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;IAChB;;OAEG;IACH,kBAAkB,EAAE,MAAM,CAAA;IAC1B;;OAEG;IACH,cAAc,EAAE,MAAM,CAAA;IACtB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAA;CAClB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,aAAa,EAAE,kBAS3B,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB,UAWnC,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,UAA0E,CAAA;AAEnH;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,UA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ACH,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAA;IAChC;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC9B;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;IACzB;;OAEG;IACH,SAAS,CAAC,EAAE,YAAY,CAAA;CACxB;AAED;;GAEG;AACH,eAAO,MAAM,qBAAqB,UAUjC,CAAA;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,GAAE,mBAAwB,GAAG,YAAY,CA8XlF;AAED,eAAe,kBAAkB,CAAA"}
|
package/out/index.js
CHANGED
|
@@ -6,7 +6,64 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { createRuntimeOverrides } from "./restrictions.js";
|
|
8
8
|
export * from "./restrictions.js";
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* Calibrated against the mailwoman corpus (1,048 non-test source files). Each value sits just past the knee in that
|
|
11
|
+
* repo's distribution, so considered human code stays silent and runaway generation does not. See the design spec for
|
|
12
|
+
* the full sweep.
|
|
13
|
+
*
|
|
14
|
+
* The four SIZE ceilings are deliberately looser than the knee. Adopting v10 surfaced 172 pre-existing violations, and
|
|
15
|
+
* splitting that many functions across a parser — with no accuracy gate available to verify the result — is a larger
|
|
16
|
+
* risk than the legibility it buys. They are set at the p90 of the measured overage instead, so the worst decile had to
|
|
17
|
+
* be fixed at adoption while the body was grandfathered:
|
|
18
|
+
*
|
|
19
|
+
* max-statements n=88 median= 73 p90= 115 max= 272
|
|
20
|
+
* complexity n=32 median= 49 p90= 84 max= 173
|
|
21
|
+
* max-lines-per-function n=26 median=283 p90= 829 max=1329
|
|
22
|
+
* max-params n=15 median= 7 p90= 8 max= 10
|
|
23
|
+
*
|
|
24
|
+
* RATCHET THESE DOWN as the grandfathered functions are split. They exist to stop new code drifting, and every step
|
|
25
|
+
* toward the knee makes them do more of that job.
|
|
26
|
+
*/
|
|
27
|
+
export const DefaultLimits = {
|
|
28
|
+
maxDepth: 5,
|
|
29
|
+
maxParams: 8,
|
|
30
|
+
maxStatements: 115,
|
|
31
|
+
maxLinesPerFunction: 830,
|
|
32
|
+
maxLines: 750,
|
|
33
|
+
maxNestedCallbacks: 4,
|
|
34
|
+
maxNestedCalls: 4,
|
|
35
|
+
complexity: 85,
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Globs treated as test files, where the size and named-constant rules are switched off.
|
|
39
|
+
*/
|
|
40
|
+
export const DefaultTestFilePatterns = [
|
|
41
|
+
"**/*.test.ts",
|
|
42
|
+
"**/*.test.tsx",
|
|
43
|
+
"**/test/**",
|
|
44
|
+
"**/fixtures/**",
|
|
45
|
+
"**/*.bench.ts",
|
|
46
|
+
// Storybook stories are fixtures in the same sense: each export is a rendered case, and its NAME is
|
|
47
|
+
// the label shown in the sidebar. A JSDoc block on `export const Default: Story = {}` says nothing
|
|
48
|
+
// the name does not.
|
|
49
|
+
"**/*.stories.ts",
|
|
50
|
+
"**/*.stories.tsx",
|
|
51
|
+
];
|
|
52
|
+
/**
|
|
53
|
+
* Globs whose contents are emitted by a generator, not written by hand. The size ceilings are meaningless there — the
|
|
54
|
+
* file is as long as its input is wide, and no reviewer reads it top to bottom — but every correctness rule still
|
|
55
|
+
* applies, because generated code ships.
|
|
56
|
+
*/
|
|
57
|
+
export const DefaultGeneratedFilePatterns = ["**/*.gen.ts", "**/*.gen.tsx", "**/*.generated.ts", "**/generated/**"];
|
|
58
|
+
/**
|
|
59
|
+
* Globs for files JavaScript checks at runtime rather than TypeScript checking ahead of it. A JSDoc block there often
|
|
60
|
+
* IS the type annotation, and a one-line `@type` cast is the idiomatic form — so the multi-line requirement, which
|
|
61
|
+
* exists to make prose read as documentation, does not apply.
|
|
62
|
+
*/
|
|
63
|
+
export const DefaultUntypedFilePatterns = ["**/*.js", "**/*.mjs", "**/*.cjs", "**/*.jsx"];
|
|
64
|
+
/**
|
|
65
|
+
* Default ignore patterns for generated/build output and vendored tooling.
|
|
66
|
+
*/
|
|
10
67
|
export const DefaultIgnorePatterns = [
|
|
11
68
|
"**/out",
|
|
12
69
|
"**/dist",
|
|
@@ -14,6 +71,9 @@ export const DefaultIgnorePatterns = [
|
|
|
14
71
|
"**/node_modules",
|
|
15
72
|
"**/coverage",
|
|
16
73
|
"**/storybook-static",
|
|
74
|
+
// Yarn 4 vendors its own release bundle and plugin code here. It is third-party, minified, and
|
|
75
|
+
// not ours to lint — Tier 2's `no-abusive-eslint-disable` fires on it otherwise.
|
|
76
|
+
"**/.yarn/**",
|
|
17
77
|
];
|
|
18
78
|
/**
|
|
19
79
|
* Builds the complete oxlint configuration for a Sister Software package.
|
|
@@ -30,14 +90,14 @@ export const DefaultIgnorePatterns = [
|
|
|
30
90
|
* @returns A complete oxlint config object (no `extends` required).
|
|
31
91
|
*/
|
|
32
92
|
export function createOxlintConfig(options = {}) {
|
|
33
|
-
const { packageNamespace = "@sister.software", copyrightHolder = "Sister Software", spdxLicenseIdentifier = "UNLICENSED", author = "Teffen Ellis, et al.", react = false, headers = true, padding = true, braces = true, restrictProcessGlobals = false, ignorePatterns = DefaultIgnorePatterns, overrides = {}, } = options;
|
|
34
|
-
const
|
|
93
|
+
const { packageNamespace = "@sister.software", copyrightHolder = "Sister Software", spdxLicenseIdentifier = "UNLICENSED", author = "Teffen Ellis, et al.", react = false, headers = true, padding = true, consolePadding = true, multilineStatementPadding = true, braces = true, restrictProcessGlobals = false, unnamedThresholds = false, constantDocs = false, lengthTruthiness = true, multilineJSDoc = true, sectionMarkers = true, limits: limitOverrides = {}, testFilePatterns = DefaultTestFilePatterns, generatedFilePatterns = DefaultGeneratedFilePatterns, untypedFilePatterns = DefaultUntypedFilePatterns, ignorePatterns = DefaultIgnorePatterns, overrides = {}, } = options;
|
|
94
|
+
const limits = { ...DefaultLimits, ...limitOverrides };
|
|
95
|
+
const plugins = ["typescript", "unicorn", "oxc", "import", "promise", "vitest", ...(react ? ["react"] : [])];
|
|
35
96
|
const rules = {
|
|
36
97
|
// JavaScript
|
|
37
98
|
eqeqeq: ["error", "always", { null: "ignore" }],
|
|
38
99
|
"prefer-const": "warn",
|
|
39
100
|
"object-shorthand": ["warn", "always"],
|
|
40
|
-
"no-shadow": "off",
|
|
41
101
|
"no-undef": "off",
|
|
42
102
|
"no-unused-vars": [
|
|
43
103
|
"warn",
|
|
@@ -62,7 +122,186 @@ export function createOxlintConfig(options = {}) {
|
|
|
62
122
|
"typescript/no-non-null-assertion": "off",
|
|
63
123
|
"typescript/no-var-requires": "off",
|
|
64
124
|
"typescript/no-require-imports": "off",
|
|
125
|
+
// Tier 1 — legibility guardrails. Thresholds are ceilings past the knee of the calibration
|
|
126
|
+
// corpus's distribution: they stay silent on considered code and fire on runaway generation.
|
|
127
|
+
"max-depth": ["error", { max: limits.maxDepth }],
|
|
128
|
+
"max-params": ["error", { max: limits.maxParams }],
|
|
129
|
+
"max-statements": ["error", { max: limits.maxStatements }],
|
|
130
|
+
"max-lines-per-function": ["error", { max: limits.maxLinesPerFunction, skipBlankLines: true, skipComments: true }],
|
|
131
|
+
"max-lines": ["error", { max: limits.maxLines, skipBlankLines: true, skipComments: true }],
|
|
132
|
+
"max-nested-callbacks": ["error", { max: limits.maxNestedCallbacks }],
|
|
133
|
+
"unicorn/max-nested-calls": ["error", { max: limits.maxNestedCalls }],
|
|
134
|
+
complexity: ["error", limits.complexity],
|
|
135
|
+
"unicorn/no-array-reduce": "error",
|
|
136
|
+
"unicorn/no-unreadable-array-destructuring": "error",
|
|
137
|
+
// Tier 2 — defect classes that `correctness` does not cover. Every rule here corresponds to a
|
|
138
|
+
// way working-looking code is wrong at runtime.
|
|
139
|
+
"no-shadow": "error",
|
|
140
|
+
"no-promise-executor-return": "error",
|
|
141
|
+
"no-useless-assignment": "error",
|
|
142
|
+
"no-unreachable-loop": "error",
|
|
143
|
+
"no-unmodified-loop-condition": "error",
|
|
144
|
+
"no-loop-func": "error",
|
|
145
|
+
// `.sort()` and `.reverse()` mutate in place; on a shared or cached array that is a bug at a
|
|
146
|
+
// distance. The fixes are `toSorted()` / `toReversed()`.
|
|
147
|
+
"unicorn/no-array-sort": "error",
|
|
148
|
+
"unicorn/no-array-reverse": "error",
|
|
149
|
+
"unicorn/no-immediate-mutation": "error",
|
|
150
|
+
"unicorn/no-array-method-this-argument": "error",
|
|
151
|
+
"unicorn/no-typeof-undefined": "error",
|
|
152
|
+
"unicorn/no-useless-promise-resolve-reject": "error",
|
|
153
|
+
"unicorn/prefer-type-error": "error",
|
|
154
|
+
// Global `isNaN` coerces its argument; `Number.isNaN` does not.
|
|
155
|
+
"unicorn/prefer-number-properties": "error",
|
|
156
|
+
"unicorn/no-abusive-eslint-disable": "error",
|
|
157
|
+
// Off despite the name: it fires on `.map(x => ({ ...x, field }))`, which is O(n·k) overall and the
|
|
158
|
+
// ordinary way to add a field. The quadratic accumulation worth catching is `acc = { ...acc, x }`
|
|
159
|
+
// inside a reduce, which this does not distinguish. 14 sites, 14 false positives.
|
|
160
|
+
"oxc/no-map-spread": "off",
|
|
161
|
+
"oxc/bad-bitwise-operator": "error",
|
|
162
|
+
"oxc/branches-sharing-code": "error",
|
|
163
|
+
"typescript/no-dynamic-delete": "error",
|
|
164
|
+
"typescript/prefer-ts-expect-error": "error",
|
|
165
|
+
// A cycle here is not a style issue: it leaves bindings unevaluated at import time, which
|
|
166
|
+
// surfaces as a base class that is `undefined` at class-definition time.
|
|
167
|
+
"import/no-cycle": "error",
|
|
168
|
+
// `ignoreLastCallback` keeps the rule pointed at CHAINS, where a missing return silently feeds
|
|
169
|
+
// undefined to the next link. A terminal `.then(…)` doing side effects has nothing downstream
|
|
170
|
+
// to starve, and rewriting those adds a return whose value no one reads.
|
|
171
|
+
"promise/always-return": ["error", { ignoreLastCallback: true }],
|
|
172
|
+
// Off: it cannot see that a ternary settles exactly once. `cb((err) => (err ? reject(err) : resolve()))`
|
|
173
|
+
// is the standard way to bridge a node-style callback to a promise, and the rule flagged every
|
|
174
|
+
// instance of it on the calibration corpus — 6 sites, 6 false positives, no real double-settle.
|
|
175
|
+
"promise/no-multiple-resolved": "off",
|
|
176
|
+
// Tier 3 — test discipline. `expect-expect` is the one that matters most: it catches a test
|
|
177
|
+
// that runs, passes, and asserts nothing.
|
|
178
|
+
"vitest/expect-expect": "error",
|
|
179
|
+
// vitest's `expect(value, message)` takes an optional assertion message as a second argument —
|
|
180
|
+
// the rule's default of one would flag the API's own signature.
|
|
181
|
+
"vitest/valid-expect": ["error", { maxArgs: 2 }],
|
|
182
|
+
"vitest/valid-title": "error",
|
|
183
|
+
"vitest/valid-describe-callback": "error",
|
|
184
|
+
// Off: the dominant shape it flags is a parameterized assertion helper, where the conditional IS
|
|
185
|
+
// the contract — `expectProposal(out, { kind, body, minConfidence? })` asserts only what the
|
|
186
|
+
// caller specified. 33 sites on the calibration corpus, none a hidden never-running assertion.
|
|
187
|
+
"vitest/no-conditional-expect": "off",
|
|
188
|
+
"vitest/no-conditional-tests": "error",
|
|
189
|
+
"vitest/no-disabled-tests": "error",
|
|
190
|
+
"vitest/no-commented-out-tests": "error",
|
|
191
|
+
"vitest/no-alias-methods": "error",
|
|
192
|
+
"vitest/prefer-to-be": "error",
|
|
193
|
+
"vitest/prefer-to-have-length": "error",
|
|
194
|
+
"vitest/prefer-to-contain": "error",
|
|
195
|
+
"vitest/require-to-throw-message": "error",
|
|
196
|
+
// Playwright names its e2e specs `*.spec.ts`; vitest unit tests are `*.test.ts`. A repo running
|
|
197
|
+
// both has two legitimate conventions, so the rule is scoped to the vitest ones.
|
|
198
|
+
"vitest/consistent-test-filename": ["error", { allTestPattern: String.raw `.*\.test\.[tj]sx?$` }],
|
|
199
|
+
// Enabling a plugin also activates its `correctness`-category rules, so a rule this tier turned
|
|
200
|
+
// down must be switched off explicitly rather than merely left out of the list above.
|
|
201
|
+
"vitest/require-mock-type-parameters": "off",
|
|
202
|
+
"vitest/no-conditional-in-test": "off",
|
|
203
|
+
// Tier 4 — mechanical hygiene. All autofixable, none requiring judgment.
|
|
204
|
+
// Literal form.
|
|
205
|
+
"unicorn/numeric-separators-style": "error",
|
|
206
|
+
"unicorn/no-zero-fractions": "error",
|
|
207
|
+
"unicorn/text-encoding-identifier-case": "error",
|
|
208
|
+
"unicorn/escape-case": "error",
|
|
209
|
+
"unicorn/no-hex-escape": "error",
|
|
210
|
+
// Import discipline.
|
|
211
|
+
// `disallowTypeAnnotations: false` keeps the valuable half — a type-only import must be written
|
|
212
|
+
// `import type` — while allowing `typeof import("…")` in an annotation. That form is how a
|
|
213
|
+
// guarded dynamic import is typed: the module is optional and loaded at runtime, and the inline
|
|
214
|
+
// annotation is what says so. `import type` would erase to nothing and read as a hard dep.
|
|
215
|
+
"typescript/consistent-type-imports": ["error", { disallowTypeAnnotations: false }],
|
|
216
|
+
"typescript/no-import-type-side-effects": "error",
|
|
217
|
+
"unicorn/prefer-export-from": "error",
|
|
218
|
+
"import/no-duplicates": "error",
|
|
219
|
+
"import/first": "error",
|
|
220
|
+
"import/newline-after-import": "error",
|
|
221
|
+
// Modern API preference.
|
|
222
|
+
"unicorn/prefer-string-replace-all": "error",
|
|
223
|
+
// `caught` is permitted alongside `error`: when a catch sits inside a scope that already binds
|
|
224
|
+
// `error` (a React component's error state, say), no-shadow requires a different name and this
|
|
225
|
+
// rule would otherwise demand the shadowing one. The two rules are in direct conflict without it.
|
|
226
|
+
"unicorn/catch-error-name": ["error", { ignore: ["caught"] }],
|
|
227
|
+
"unicorn/prefer-at": "error",
|
|
228
|
+
"unicorn/prefer-global-this": "error",
|
|
229
|
+
"unicorn/consistent-existence-index-check": "error",
|
|
230
|
+
"unicorn/new-for-builtins": "error",
|
|
231
|
+
"unicorn/prefer-array-find": "error",
|
|
232
|
+
"unicorn/prefer-structured-clone": "error",
|
|
233
|
+
"unicorn/prefer-negative-index": "error",
|
|
234
|
+
"unicorn/prefer-math-min-max": "error",
|
|
235
|
+
"unicorn/no-useless-collection-argument": "error",
|
|
236
|
+
"unicorn/throw-new-error": "error",
|
|
237
|
+
// Two rules that look mechanical but are not type-safe, so they stay off:
|
|
238
|
+
//
|
|
239
|
+
// `unicorn/prefer-code-point` rewrites `charCodeAt` to `codePointAt`, which returns
|
|
240
|
+
// `number | undefined`. It exists for surrogate-pair correctness, but on the ASCII arithmetic
|
|
241
|
+
// where it usually fires it buys nothing and forces an undefined branch at every site.
|
|
242
|
+
//
|
|
243
|
+
// `unicorn/no-useless-undefined` drops an explicitly-passed `undefined` argument. oxlint has no
|
|
244
|
+
// type information, so it cannot tell an optional parameter from a required one and will
|
|
245
|
+
// silently turn `f(a, undefined)` into a call that no longer type-checks.
|
|
246
|
+
//
|
|
247
|
+
// `unicorn/prefer-string-raw` rewrites a string literal to a String.raw template. That is
|
|
248
|
+
// runtime-identical but not type-identical: the literal type is lost, so any template-literal
|
|
249
|
+
// type built from the value collapses. It widens types silently, which is worse than the
|
|
250
|
+
// escaped backslashes it removes.
|
|
251
|
+
"unicorn/prefer-code-point": "off",
|
|
252
|
+
"unicorn/no-useless-undefined": "off",
|
|
253
|
+
"unicorn/prefer-string-raw": "off",
|
|
254
|
+
//
|
|
255
|
+
// `unicorn/prefer-math-trunc` is the one that is not merely type-unsafe but semantically wrong.
|
|
256
|
+
// `x | 0` and `x >>> 0` are int32/uint32 coercion, and the wrapping is the point — every site on
|
|
257
|
+
// the calibration corpus was a hash function, a PRNG, or a seeded evaluation harness.
|
|
258
|
+
// `Math.trunc` does not wrap, so taking its suggestion silently changes what those produce.
|
|
259
|
+
"unicorn/prefer-math-trunc": "off",
|
|
260
|
+
//
|
|
261
|
+
// `unicorn/prefer-number-coercion` rewrites `Number.parseInt(x, 10)` to
|
|
262
|
+
// `Math.trunc(Number(x))`. parseInt parses a numeric PREFIX; Number is strict, so
|
|
263
|
+
// `parseInt("12px", 10)` is 12 where `Number("12px")` is NaN. On the calibration corpus the
|
|
264
|
+
// inputs included CLI options and an HTTP status of uncertain type — exactly where the
|
|
265
|
+
// difference bites. It also reintroduces Math.trunc, disabled just above.
|
|
266
|
+
"unicorn/prefer-number-coercion": "off",
|
|
267
|
+
//
|
|
268
|
+
// These two are not unsafe — they are unsatisfiable. oxfmt reverts both fixes on its next run:
|
|
269
|
+
// it lowercases hex digits, and it strips the parentheses unicorn/no-nested-ternary adds. Lint
|
|
270
|
+
// and format are both CI gates, so a rule the formatter undoes can never go green. Neither
|
|
271
|
+
// behaviour is configurable in oxfmt today.
|
|
272
|
+
"unicorn/number-literal-case": "off",
|
|
273
|
+
"unicorn/no-nested-ternary": "off",
|
|
274
|
+
//
|
|
275
|
+
// `unicorn/explicit-length-check` enforces `x.length > 0`, the opposite of the house
|
|
276
|
+
// convention. `sister-software/prefer-length-truthiness` enforces ours.
|
|
277
|
+
"unicorn/explicit-length-check": "off",
|
|
278
|
+
//
|
|
279
|
+
// Core `no-duplicate-imports` is not TypeScript-aware: it counts a value import and an
|
|
280
|
+
// `import type` from the same module as a duplicate, which is the split
|
|
281
|
+
// `typescript/consistent-type-imports` exists to create. On the calibration corpus it reported
|
|
282
|
+
// 71 sites where the TS-aware `import/no-duplicates` reported 1, and that 1 was real.
|
|
283
|
+
"no-duplicate-imports": "off",
|
|
284
|
+
// TS style.
|
|
285
|
+
"typescript/consistent-type-definitions": "error",
|
|
286
|
+
"typescript/consistent-indexed-object-style": "error",
|
|
287
|
+
"typescript/prefer-for-of": "error",
|
|
288
|
+
"typescript/no-inferrable-types": "error",
|
|
289
|
+
// Small structural.
|
|
290
|
+
"unicorn/prefer-ternary": "error",
|
|
291
|
+
"unicorn/prefer-logical-operator-over-ternary": "error",
|
|
292
|
+
"unicorn/no-lonely-if": "error",
|
|
293
|
+
"unicorn/no-console-spaces": "error",
|
|
294
|
+
"unicorn/no-static-only-class": "error",
|
|
295
|
+
"no-useless-return": "error",
|
|
65
296
|
};
|
|
297
|
+
if (react) {
|
|
298
|
+
rules["react-hooks/rules-of-hooks"] = "error";
|
|
299
|
+
rules["react/no-unstable-nested-components"] = "error";
|
|
300
|
+
rules["react/no-object-type-as-default-prop"] = "error";
|
|
301
|
+
rules["react/jsx-no-constructed-context-values"] = "error";
|
|
302
|
+
// The automatic JSX runtime made this obsolete; the rule predates it.
|
|
303
|
+
rules["react/react-in-jsx-scope"] = "off";
|
|
304
|
+
}
|
|
66
305
|
if (headers) {
|
|
67
306
|
// Error severity: missing headers should fail `oxlint` (a real CI gate) and surface as an
|
|
68
307
|
// editor error. The rule is auto-fixable, so `oxlint --fix` keeps the friction low.
|
|
@@ -80,15 +319,102 @@ export function createOxlintConfig(options = {}) {
|
|
|
80
319
|
// Error severity: a governance gate — direct env/argv access should fail the lint.
|
|
81
320
|
rules["sister-software/no-process-globals"] = "error";
|
|
82
321
|
}
|
|
322
|
+
if (unnamedThresholds) {
|
|
323
|
+
// Error severity: an unnamed threshold is a legibility defect, not a style preference.
|
|
324
|
+
rules["sister-software/no-unnamed-threshold"] = [
|
|
325
|
+
"error",
|
|
326
|
+
typeof unnamedThresholds === "object" ? unnamedThresholds : {},
|
|
327
|
+
];
|
|
328
|
+
}
|
|
329
|
+
if (constantDocs) {
|
|
330
|
+
// Error severity: an undocumented public constant or tuning knob is a legibility defect.
|
|
331
|
+
rules["sister-software/require-constant-doc"] = ["error", typeof constantDocs === "object" ? constantDocs : {}];
|
|
332
|
+
}
|
|
333
|
+
if (lengthTruthiness) {
|
|
334
|
+
rules["sister-software/prefer-length-truthiness"] = "error";
|
|
335
|
+
}
|
|
336
|
+
if (consolePadding) {
|
|
337
|
+
rules["sister-software/console-padding"] = "warn";
|
|
338
|
+
}
|
|
339
|
+
if (multilineStatementPadding) {
|
|
340
|
+
rules["sister-software/multiline-statement-padding"] = "warn";
|
|
341
|
+
}
|
|
342
|
+
if (multilineJSDoc) {
|
|
343
|
+
rules["sister-software/multiline-jsdoc"] = "error";
|
|
344
|
+
}
|
|
345
|
+
if (sectionMarkers) {
|
|
346
|
+
const markerOptions = typeof sectionMarkers === "object" ? sectionMarkers : {};
|
|
347
|
+
// The two mechanical rungs are errors: a banner has exactly one correct rewrite, and a label
|
|
348
|
+
// length is measurable. The two judgment rungs warn — where a section ends, and whether it
|
|
349
|
+
// should become its own file, are not decisions a linter gets to make.
|
|
350
|
+
rules["sister-software/prefer-mark-comment"] = "error";
|
|
351
|
+
rules["sister-software/concise-section-marker"] = [
|
|
352
|
+
"error",
|
|
353
|
+
markerOptions.maxBodyLength === undefined ? {} : { maxBodyLength: markerOptions.maxBodyLength },
|
|
354
|
+
];
|
|
355
|
+
rules["sister-software/prefer-region-over-marks"] = "warn";
|
|
356
|
+
rules["sister-software/max-regions"] = [
|
|
357
|
+
"warn",
|
|
358
|
+
markerOptions.maxRegions === undefined ? {} : { max: markerOptions.maxRegions },
|
|
359
|
+
];
|
|
360
|
+
}
|
|
361
|
+
// Rules switched off inside test files. Table-driven test bodies are legitimately long, and
|
|
362
|
+
// expected values are legitimately unnamed numbers. oxlint validates override entries against the
|
|
363
|
+
// registered rule set, so an entry may only name a rule this config actually turned on.
|
|
364
|
+
const testFileRules = {
|
|
365
|
+
"max-lines-per-function": "off",
|
|
366
|
+
"max-statements": "off",
|
|
367
|
+
"max-lines": "off",
|
|
368
|
+
};
|
|
369
|
+
if (react) {
|
|
370
|
+
// A Storybook `render` IS a component — React calls it as one — but it is not NAMED like one, so
|
|
371
|
+
// the hook rules read it as a plain function. Test files that render hooks go through a
|
|
372
|
+
// testing-library wrapper for the same reason.
|
|
373
|
+
testFileRules["react-hooks/rules-of-hooks"] = "off";
|
|
374
|
+
}
|
|
375
|
+
if (unnamedThresholds) {
|
|
376
|
+
testFileRules["sister-software/no-unnamed-threshold"] = "off";
|
|
377
|
+
}
|
|
378
|
+
if (constantDocs) {
|
|
379
|
+
testFileRules["sister-software/require-constant-doc"] = "off";
|
|
380
|
+
}
|
|
381
|
+
if (sectionMarkers) {
|
|
382
|
+
// A test file's sections track the suite's shape, which the code under test dictates — a big
|
|
383
|
+
// table of cases legitimately wants many markers, and splitting it would scatter the suite.
|
|
384
|
+
testFileRules["sister-software/prefer-region-over-marks"] = "off";
|
|
385
|
+
testFileRules["sister-software/max-regions"] = "off";
|
|
386
|
+
}
|
|
387
|
+
/**
|
|
388
|
+
* Generated files: size ceilings only. Everything else still applies — generated code ships.
|
|
389
|
+
*/
|
|
390
|
+
const generatedFileRules = {
|
|
391
|
+
"max-lines": "off",
|
|
392
|
+
"max-lines-per-function": "off",
|
|
393
|
+
"max-statements": "off",
|
|
394
|
+
complexity: "off",
|
|
395
|
+
};
|
|
83
396
|
return {
|
|
84
397
|
plugins,
|
|
85
|
-
...(headers ||
|
|
398
|
+
...(headers ||
|
|
399
|
+
padding ||
|
|
400
|
+
braces ||
|
|
401
|
+
restrictProcessGlobals ||
|
|
402
|
+
unnamedThresholds ||
|
|
403
|
+
constantDocs ||
|
|
404
|
+
lengthTruthiness ||
|
|
405
|
+
multilineJSDoc ||
|
|
406
|
+
sectionMarkers
|
|
86
407
|
? { jsPlugins: ["@sister.software/oxlint-config/plugin"] }
|
|
87
408
|
: {}),
|
|
88
409
|
categories: { correctness: "error" },
|
|
89
410
|
ignorePatterns,
|
|
90
411
|
rules,
|
|
91
|
-
overrides:
|
|
412
|
+
overrides: [
|
|
413
|
+
...createRuntimeOverrides(packageNamespace),
|
|
414
|
+
{ files: testFilePatterns, rules: testFileRules },
|
|
415
|
+
{ files: generatedFilePatterns, rules: generatedFileRules },
|
|
416
|
+
...(multilineJSDoc ? [{ files: untypedFilePatterns, rules: { "sister-software/multiline-jsdoc": "off" } }] : []),
|
|
417
|
+
],
|
|
92
418
|
...overrides,
|
|
93
419
|
};
|
|
94
420
|
}
|
package/out/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAE1D,cAAc,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;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jsdoc` rule: a JSDoc block always spans multiple lines, even
|
|
6
|
+
* when its content would fit on one. A one-line block reads as an aside; the multi-line form reads
|
|
7
|
+
* as documentation, and it leaves somewhere to put the second sentence when one is needed.
|
|
8
|
+
*
|
|
9
|
+
* Two shapes are left alone. A JSDoc that shares its line with code is a type cast or an inline
|
|
10
|
+
* annotation, and expanding those changes what the line means. A JSDoc on a union or intersection
|
|
11
|
+
* member labels one alternative in what reads as a list — three lines per entry turns a list you
|
|
12
|
+
* can scan into a page you have to read.
|
|
13
|
+
*/
|
|
14
|
+
import type { Rule } from "./plugin-types.js";
|
|
15
|
+
export declare const multilineJSDocRule: Rule;
|
|
16
|
+
//# sourceMappingURL=jsdoc-plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsdoc-plugin.d.ts","sourceRoot":"","sources":["../src/jsdoc-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAa7C,eAAO,MAAM,kBAAkB,EAAE,IA+ChC,CAAA"}
|