@sister.software/oxlint-config 12.1.3 → 13.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 +41 -0
- package/out/console-padding-plugin.d.ts.map +1 -1
- package/out/console-padding-plugin.js +0 -2
- package/out/console-padding-plugin.js.map +1 -1
- package/out/index.d.ts +10 -18
- package/out/index.d.ts.map +1 -1
- package/out/index.js +9 -5
- package/out/index.js.map +1 -1
- package/out/plugin-types.d.ts +40 -2
- package/out/plugin-types.d.ts.map +1 -1
- package/out/plugin-types.js +9 -2
- package/out/plugin-types.js.map +1 -1
- package/out/section-marker-plugin.d.ts +14 -0
- package/out/section-marker-plugin.d.ts.map +1 -1
- package/out/section-marker-plugin.js.map +1 -1
- package/package.json +5 -1
- package/src/console-padding-plugin.ts +0 -2
- package/src/index.ts +20 -12
- package/src/plugin-types.ts +36 -2
- package/src/section-marker-plugin.ts +15 -0
package/README.md
CHANGED
|
@@ -314,6 +314,47 @@ const hasItems = items.length > 0 // untouched — this is a boolean, not
|
|
|
314
314
|
if (items.length === 2) { … } // untouched — not an emptiness check
|
|
315
315
|
```
|
|
316
316
|
|
|
317
|
+
### Unused imports
|
|
318
|
+
|
|
319
|
+
`no-unused-vars` reports an unused import, and oxc can remove it. The removal is a **suggestion**
|
|
320
|
+
rather than a safe fix, so `oxlint --fix` leaves it in place — a fix script has to ask for
|
|
321
|
+
suggestions, and has to run to a fixpoint because removing one binding can strand the next:
|
|
322
|
+
|
|
323
|
+
```jsonc
|
|
324
|
+
{
|
|
325
|
+
"scripts": {
|
|
326
|
+
// Removing one dead binding can expose another; this tree requires two passes.
|
|
327
|
+
"fix:oxlint": "oxlint --fix --fix-suggestions && oxlint --fix --fix-suggestions"
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
For removal on save, the editor needs the same permission:
|
|
333
|
+
|
|
334
|
+
```jsonc
|
|
335
|
+
{
|
|
336
|
+
"oxc.fixKind": "safe_fix_or_suggestion",
|
|
337
|
+
"editor.codeActionsOnSave": { "source.fixAll.oxc": "explicit" }
|
|
338
|
+
}
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
`varsIgnorePattern` is `^_`, so `_`-prefixed bindings are the opt-out. It cannot separate imports
|
|
342
|
+
from locals, so an unused local is reported too — with no fixer, since deleting a local can delete
|
|
343
|
+
work. A bare `import "./side-effect.ts"` binds nothing and is never touched.
|
|
344
|
+
|
|
345
|
+
### Writing your own rules
|
|
346
|
+
|
|
347
|
+
The plugin types the bundled rules use ship as a subpath, so a repo-local plugin does not mirror them:
|
|
348
|
+
|
|
349
|
+
```ts
|
|
350
|
+
import type { AstNode, Plugin, Rule, RuleContext } from "@sister.software/oxlint-config/plugin-types"
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
They are declared here rather than taken from oxlint, whose plugin type surface is alpha and outside
|
|
354
|
+
its semver promise. The node shape is loose by design — a field is declared when a rule reads it. If
|
|
355
|
+
your rule needs a field that is missing, add it here rather than to a private copy: a copy silently
|
|
356
|
+
lacks the field the next rule needs.
|
|
357
|
+
|
|
317
358
|
### Escape hatch
|
|
318
359
|
|
|
319
360
|
Both rules, and every tier rule, take a scoped disable with a stated reason:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"console-padding-plugin.d.ts","sourceRoot":"","sources":["../src/console-padding-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,KAAK,EAAW,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAsBtD,eAAO,MAAM,kBAAkB,EAAE,
|
|
1
|
+
{"version":3,"file":"console-padding-plugin.d.ts","sourceRoot":"","sources":["../src/console-padding-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,KAAK,EAAW,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAsBtD,eAAO,MAAM,kBAAkB,EAAE,IAoChC,CAAA"}
|
|
@@ -36,8 +36,6 @@ export const consolePaddingRule = {
|
|
|
36
36
|
schema: [{ type: "object", additionalProperties: true }],
|
|
37
37
|
},
|
|
38
38
|
create(context) {
|
|
39
|
-
const sourceCode = context.sourceCode ?? context.getSourceCode();
|
|
40
|
-
const text = sourceCode.getText();
|
|
41
39
|
const { requirePadding } = createPaddingHelpers(context);
|
|
42
40
|
return {
|
|
43
41
|
ExpressionStatement(node) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"console-padding-plugin.js","sourceRoot":"","sources":["../src/console-padding-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AAGzD;;GAEG;AACH,MAAM,cAAc,GAAG,SAAS,CAAA;AAEhC;;GAEG;AACH,SAAS,kBAAkB,CAAC,IAAyB;IACpD,IAAI,IAAI,EAAE,IAAI,KAAK,qBAAqB;QAAE,OAAO,KAAK,CAAA;IACtD,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAA;IAE5B,IAAI,IAAI,EAAE,IAAI,KAAK,gBAAgB;QAAE,OAAO,KAAK,CAAA;IACjD,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;IAE1B,OAAO,CACN,MAAM,EAAE,IAAI,KAAK,kBAAkB,IAAI,MAAM,CAAC,MAAM,EAAE,IAAI,KAAK,YAAY,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,cAAc,CACpH,CAAA;AACF,CAAC;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAS;IACvC,IAAI,EAAE;QACL,IAAI,EAAE,iBAAiB;QACvB,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,YAAY;QACrB,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;KACxD;IACD,MAAM,CAAC,OAAO;QACb,MAAM,
|
|
1
|
+
{"version":3,"file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AI,GAAG,MAAM,CAAC,IAAI,CAAA;gBACxB,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;gBAEhC,IAAI,KAAK,KAAK,CAAC,CAAC;oBAAE,OAAM;gBACxB,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAA;gBAChC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAA;gBAE5B,oFAAoF;gBACpF,IAAI,QAAQ,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,EAAE,CAAC;oBAC/C,cAAc,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,iDAAiD,CAAC,CAAA;gBACxF,CAAC;gBAED,+EAA+E;gBAC/E,IAAI,IAAI,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,EAAE,CAAC;oBACvC,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,gDAAgD,CAAC,CAAA;gBACnF,CAAC;YACF,CAAC;SACD,CAAA;IACF,CAAC;CACD,CAAA"}
|
package/out/index.d.ts
CHANGED
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
* @file oxlint configuration factory for Sister Software projects.
|
|
6
6
|
*/
|
|
7
|
+
import type { AcronymCaseOptions } from "./acronym-case-plugin.js";
|
|
8
|
+
import type { ConstantDocOptions } from "./constant-doc-plugin.js";
|
|
9
|
+
import type { SectionMarkerOptions } from "./section-marker-plugin.js";
|
|
10
|
+
import type { ThresholdOptions } from "./threshold-plugin.js";
|
|
7
11
|
export * from "./restrictions.js";
|
|
8
12
|
/**
|
|
9
13
|
* An oxlint configuration object, as consumed by `oxlint.config.ts` / `.oxlintrc.json`.
|
|
@@ -134,29 +138,20 @@ export interface OxlintConfigOptions {
|
|
|
134
138
|
* Flag numeric literals used as comparison thresholds (off by default). Pass an object to change the ignore list or
|
|
135
139
|
* to stop exempting radix-prefixed literals.
|
|
136
140
|
*/
|
|
137
|
-
unnamedThresholds?: boolean |
|
|
138
|
-
ignore?: number[];
|
|
139
|
-
allowHex?: boolean;
|
|
140
|
-
};
|
|
141
|
+
unnamedThresholds?: boolean | ThresholdOptions;
|
|
141
142
|
/**
|
|
142
143
|
* 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
|
+
* `"screaming"`, or the default `"exported-or-screaming"`; `ignoreNames` exempts constants whose value IS the
|
|
145
|
+
* documentation — a framework's `description` string, a CLI's `--help` text.
|
|
144
146
|
*/
|
|
145
|
-
constantDocs?: boolean |
|
|
146
|
-
scope?: "exported" | "screaming" | "exported-or-screaming";
|
|
147
|
-
};
|
|
147
|
+
constantDocs?: boolean | ConstantDocOptions;
|
|
148
148
|
/**
|
|
149
149
|
* Flag an acronym title-cased inside an identifier — `parseJson` where the house form is `parseJSON` (off by
|
|
150
150
|
* default). `acronyms` replaces the shipped list, `extraAcronyms` layers a project's own vocabulary on top of it,
|
|
151
151
|
* `ignoreNames` exempts identifiers whose casing is not ours to choose, and `scope` widens the rule past exported
|
|
152
152
|
* declarations.
|
|
153
153
|
*/
|
|
154
|
-
acronymCasing?: boolean |
|
|
155
|
-
acronyms?: string[];
|
|
156
|
-
extraAcronyms?: string[];
|
|
157
|
-
ignoreNames?: string[];
|
|
158
|
-
scope?: "exported" | "all";
|
|
159
|
-
};
|
|
154
|
+
acronymCasing?: boolean | AcronymCaseOptions;
|
|
160
155
|
/**
|
|
161
156
|
* Rewrite explicit length comparisons to truthiness in boolean positions (on by default).
|
|
162
157
|
*/
|
|
@@ -169,10 +164,7 @@ export interface OxlintConfigOptions {
|
|
|
169
164
|
* Enforce the section-marker ladder — `----` banners become `// MARK:`, long labels are flagged, and a file with many
|
|
170
165
|
* markers is nudged toward regions and then toward being several files (on by default).
|
|
171
166
|
*/
|
|
172
|
-
sectionMarkers?: boolean |
|
|
173
|
-
maxBodyLength?: number;
|
|
174
|
-
maxRegions?: number;
|
|
175
|
-
};
|
|
167
|
+
sectionMarkers?: boolean | SectionMarkerOptions;
|
|
176
168
|
/**
|
|
177
169
|
* Override individual legibility ceilings. Unspecified keys keep their calibrated default.
|
|
178
170
|
*/
|
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;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAClE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAGlE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AACtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAE7D,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;;GAE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;IACH,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,CA0YlF;eAEc,kBAAkB"}
|
package/out/index.js
CHANGED
|
@@ -107,13 +107,14 @@ export function createOxlintConfig(options = {}) {
|
|
|
107
107
|
caughtErrors: "all",
|
|
108
108
|
caughtErrorsIgnorePattern: "^_",
|
|
109
109
|
destructuredArrayIgnorePattern: "^_",
|
|
110
|
-
//
|
|
111
|
-
//
|
|
112
|
-
|
|
110
|
+
// Only `_`-prefixed bindings are exempt. A broader pattern suppresses unused-import
|
|
111
|
+
// diagnostics; oxfmt does not detect them, and `noUnusedLocals` is controlled independently
|
|
112
|
+
// by each consumer. Removal is a suggestion, so fix scripts must opt into suggestions.
|
|
113
|
+
varsIgnorePattern: "^_",
|
|
113
114
|
ignoreRestSiblings: true,
|
|
114
115
|
},
|
|
115
116
|
],
|
|
116
|
-
// TypeScript
|
|
117
|
+
// TypeScript rules stay permissive here; consumers carry their own compiler and type-aware policy.
|
|
117
118
|
"typescript/ban-ts-comment": ["warn", { "ts-ignore": "allow-with-description" }],
|
|
118
119
|
"typescript/ban-types": "off",
|
|
119
120
|
"typescript/no-empty-interface": "off",
|
|
@@ -305,7 +306,10 @@ export function createOxlintConfig(options = {}) {
|
|
|
305
306
|
if (headers) {
|
|
306
307
|
// Error severity: missing headers should fail `oxlint` (a real CI gate) and surface as an
|
|
307
308
|
// editor error. The rule is auto-fixable, so `oxlint --fix` keeps the friction low.
|
|
308
|
-
rules["sister-software/require-file-header"] = [
|
|
309
|
+
rules["sister-software/require-file-header"] = [
|
|
310
|
+
"error",
|
|
311
|
+
{ copyrightHolder, spdxLicenseIdentifier, author },
|
|
312
|
+
];
|
|
309
313
|
}
|
|
310
314
|
if (padding) {
|
|
311
315
|
// Warning severity: a stylistic nudge (auto-fixable), not a hard CI gate.
|
package/out/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAI1D,cAAc,mBAAmB,CAAA;AA6CjC;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,aAAa,GAAuB;IAChD,QAAQ,EAAE,CAAC;IACX,SAAS,EAAE,CAAC;IACZ,aAAa,EAAE,GAAG;IAClB,mBAAmB,EAAE,GAAG;IACxB,QAAQ,EAAE,GAAG;IACb,kBAAkB,EAAE,CAAC;IACrB,cAAc,EAAE,CAAC;IACjB,UAAU,EAAE,EAAE;CACd,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACtC,cAAc;IACd,eAAe;IACf,YAAY;IACZ,gBAAgB;IAChB,eAAe;IACf,oGAAoG;IACpG,mGAAmG;IACnG,qBAAqB;IACrB,iBAAiB;IACjB,kBAAkB;CAClB,CAAA;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,aAAa,EAAE,cAAc,EAAE,mBAAmB,EAAE,iBAAiB,CAAC,CAAA;AAEnH;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAA;AA4GzF;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,G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,EAAE,CAAC;QACN,UAAU,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE;QACpC,cAAc;QACd,KAAK;QACL,SAAS,EAAE;YACV,GAAG,sBAAsB,CAAC,gBAAgB,CAAC;YAC3C,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,aAAa,EAAE;YACjD,EAAE,KAAK,EAAE,qBAAqB,EAAE,KAAK,EAAE,kBAAkB,EAAE;YAC3D,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,mBAAmB,EAAE,KAAK,EAAE,EAAE,iCAAiC,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;SAChH;QACD,GAAG,SAAS;KACZ,CAAA;AACF,CAAC;AAED,eAAe,kBAAkB,CAAA"}
|
package/out/plugin-types.d.ts
CHANGED
|
@@ -2,8 +2,15 @@
|
|
|
2
2
|
* @copyright Sister Software
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
|
-
* @file Minimal ESLint-compatible plugin types shared by the bundled oxlint JS plugins
|
|
6
|
-
*
|
|
5
|
+
* @file Minimal ESLint-compatible plugin types, shared by the bundled oxlint JS plugins and published
|
|
6
|
+
* as `@sister.software/oxlint-config/plugin-types` for a repo writing its own. They are declared
|
|
7
|
+
* here rather than imported from oxlint because oxlint's plugin type surface is alpha and outside
|
|
8
|
+
* its semver promise.
|
|
9
|
+
*
|
|
10
|
+
* The node shape is loose on purpose: a field is declared when a rule reads it, and every field a
|
|
11
|
+
* rule reads belongs here rather than in a consumer's private mirror — a mirror silently lacks the
|
|
12
|
+
* field the next rule needs, and the failure reads as a type error in the rule rather than a gap in
|
|
13
|
+
* the shared type.
|
|
7
14
|
*/
|
|
8
15
|
export interface Comment {
|
|
9
16
|
type: string;
|
|
@@ -105,6 +112,37 @@ export interface AstNode {
|
|
|
105
112
|
* A TypeScript class member's `public` / `protected` / `private` modifier.
|
|
106
113
|
*/
|
|
107
114
|
accessibility?: string;
|
|
115
|
+
/**
|
|
116
|
+
* A call or `new` expression's argument list.
|
|
117
|
+
*/
|
|
118
|
+
arguments?: AstNode[];
|
|
119
|
+
/**
|
|
120
|
+
* The type side of an annotated node — a `TSAsExpression`'s target, a parameter's declared type.
|
|
121
|
+
*/
|
|
122
|
+
typeAnnotation?: AstNode;
|
|
123
|
+
/**
|
|
124
|
+
* A `TSTypeReference`'s name. An `Identifier` for a plain reference, a `TSQualifiedName` for a dotted one, so a rule
|
|
125
|
+
* reading `.name` must check `.type` first.
|
|
126
|
+
*/
|
|
127
|
+
typeName?: AstNode;
|
|
128
|
+
/**
|
|
129
|
+
* Explicit type arguments — `new Kysely<Schema>()`. The list is on `.params`, and the whole node is absent rather
|
|
130
|
+
* than empty when a call passes none.
|
|
131
|
+
*/
|
|
132
|
+
typeArguments?: AstNode;
|
|
133
|
+
/**
|
|
134
|
+
* A template literal's static chunks. `cooked` is null for an invalid escape sequence, which is why it is optional
|
|
135
|
+
* rather than a plain string.
|
|
136
|
+
*/
|
|
137
|
+
quasis?: {
|
|
138
|
+
value?: {
|
|
139
|
+
cooked?: string;
|
|
140
|
+
};
|
|
141
|
+
}[];
|
|
142
|
+
/**
|
|
143
|
+
* A template literal's interpolated expressions, or a sequence expression's operands.
|
|
144
|
+
*/
|
|
145
|
+
expressions?: AstNode[];
|
|
108
146
|
}
|
|
109
147
|
export interface SourceCode {
|
|
110
148
|
getText(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-types.d.ts","sourceRoot":"","sources":["../src/plugin-types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"plugin-types.d.ts","sourceRoot":"","sources":["../src/plugin-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,MAAM,WAAW,OAAO;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,CA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AAE,IAAI,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAA;KAAE,GAAG,IAAI,CAAA;CACzF;AAED,MAAM,WAAW,IAAI;IACpB,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC;QAAC,MAAM,EAAE,OAAO,EAAE,CAAA;KAAE,CAAA;IACxF,MAAM,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC,CAAA;CACrE;AAED,MAAM,WAAW,MAAM;IACtB,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;IACtB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;CAC3B"}
|
package/out/plugin-types.js
CHANGED
|
@@ -2,8 +2,15 @@
|
|
|
2
2
|
* @copyright Sister Software
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
|
-
* @file Minimal ESLint-compatible plugin types shared by the bundled oxlint JS plugins
|
|
6
|
-
*
|
|
5
|
+
* @file Minimal ESLint-compatible plugin types, shared by the bundled oxlint JS plugins and published
|
|
6
|
+
* as `@sister.software/oxlint-config/plugin-types` for a repo writing its own. They are declared
|
|
7
|
+
* here rather than imported from oxlint because oxlint's plugin type surface is alpha and outside
|
|
8
|
+
* its semver promise.
|
|
9
|
+
*
|
|
10
|
+
* The node shape is loose on purpose: a field is declared when a rule reads it, and every field a
|
|
11
|
+
* rule reads belongs here rather than in a consumer's private mirror — a mirror silently lacks the
|
|
12
|
+
* field the next rule needs, and the failure reads as a type error in the rule rather than a gap in
|
|
13
|
+
* the shared type.
|
|
7
14
|
*/
|
|
8
15
|
export {};
|
|
9
16
|
//# sourceMappingURL=plugin-types.js.map
|
package/out/plugin-types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-types.js","sourceRoot":"","sources":["../src/plugin-types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"plugin-types.js","sourceRoot":"","sources":["../src/plugin-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG"}
|
|
@@ -18,6 +18,20 @@
|
|
|
18
18
|
* measurable limit.
|
|
19
19
|
*/
|
|
20
20
|
import type { Rule } from "./plugin-types.js";
|
|
21
|
+
/**
|
|
22
|
+
* Options for the section-marker ladder. The two advisory rungs take no options; these two set the ceilings the
|
|
23
|
+
* mechanical rungs measure against.
|
|
24
|
+
*/
|
|
25
|
+
export interface SectionMarkerOptions {
|
|
26
|
+
/**
|
|
27
|
+
* Ceiling for a marker's label, in characters.
|
|
28
|
+
*/
|
|
29
|
+
maxBodyLength?: number;
|
|
30
|
+
/**
|
|
31
|
+
* Ceiling for the number of `#region` blocks in one file.
|
|
32
|
+
*/
|
|
33
|
+
maxRegions?: number;
|
|
34
|
+
}
|
|
21
35
|
export declare const preferMarkCommentRule: Rule;
|
|
22
36
|
export declare const conciseSectionMarkerRule: Rule;
|
|
23
37
|
export declare const preferRegionOverMarksRule: Rule;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"section-marker-plugin.d.ts","sourceRoot":"","sources":["../src/section-marker-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAW,IAAI,EAA2B,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"section-marker-plugin.d.ts","sourceRoot":"","sources":["../src/section-marker-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAW,IAAI,EAA2B,MAAM,mBAAmB,CAAA;AAE/E;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACpC;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;CACnB;AAuJD,eAAO,MAAM,qBAAqB,EAAE,IA+CnC,CAAA;AAED,eAAO,MAAM,wBAAwB,EAAE,IA+BtC,CAAA;AAED,eAAO,MAAM,yBAAyB,EAAE,IAwBvC,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,IA0B5B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"section-marker-plugin.js","sourceRoot":"","sources":["../src/section-marker-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;
|
|
1
|
+
{"version":3,"file":"section-marker-plugin.js","sourceRoot":"","sources":["../src/section-marker-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAmBH;;GAEG;AACH,MAAM,iBAAiB,GAAG,EAAE,CAAA;AAE5B;;GAEG;AACH,MAAM,uBAAuB,GAAG,EAAE,CAAA;AAElC;;;;;;GAMG;AACH,MAAM,mBAAmB,GAAG,EAAE,CAAA;AAE9B;;GAEG;AACH,MAAM,gBAAgB,GAAG,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,CAAA,oBAAoB,iBAAiB,WAAW,CAAC,CAAA;AAE/F;;GAEG;AACH,MAAM,YAAY,GAAG,2CAA2C,CAAA;AAEhE;;GAEG;AACH,MAAM,cAAc,GAAG,uCAAuC,CAAA;AAwB9D;;GAEG;AACH,SAAS,WAAW,CAAC,IAAY;IAChC,OAAO,IAAI;SACT,IAAI,EAAE;SACN,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC;SAC1B,IAAI,EAAE,CAAA;AACT,CAAC;AAED;;;;GAIG;AACH,SAAS,WAAW,CAAC,KAAe;IACnC,MAAM,OAAO,GAAa,EAAE,CAAA;IAC5B,IAAI,CAAC,GAAG,CAAC,CAAA;IAET,OAAO,CAAC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oB,EAAE,IAAI,EAAE,CAAC;KACxD;IACD,MAAM,CAAC,OAAO;QACb,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,CAAA;QAC1C,MAAM,OAAO,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,CAAqB,CAAA;QAC9D,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,IAAI,mBAAmB,CAAA;QAEhD,OAAO;YACN,OAAO;gBACN,MAAM,OAAO,GAAG,eAAe,CAAC,UAAU,EAAE,IAAI,EAAE,cAAc,CAAC,CAAA;gBAEjE,IAAI,OAAO,CAAC,MAAM,IAAI,KAAK;oBAAE,OAAM;gBAEnC,OAAO,CAAC,MAAM,CAAC;oBACd,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAE,CAAC,OAAO,CAAC,KAAK,EAAE;oBACxD,OAAO,EACN,GAAG,OAAO,CAAC,MAAM,6BAA6B,KAAK,wCAAwC;wBAC3F,2EAA2E;iBAC5E,CAAC,CAAA;YACH,CAAC;SACD,CAAA;IACF,CAAC;CACD,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sister.software/oxlint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "13.0.0",
|
|
4
4
|
"description": "Sister Software's oxlint config",
|
|
5
5
|
"license": "AGPL-3.0",
|
|
6
6
|
"author": "teffen@sister.software",
|
|
@@ -25,6 +25,10 @@
|
|
|
25
25
|
"./plugin": {
|
|
26
26
|
"import": "./out/plugin.js",
|
|
27
27
|
"types": "./out/plugin.d.ts"
|
|
28
|
+
},
|
|
29
|
+
"./plugin-types": {
|
|
30
|
+
"import": "./out/plugin-types.js",
|
|
31
|
+
"types": "./out/plugin-types.d.ts"
|
|
28
32
|
}
|
|
29
33
|
},
|
|
30
34
|
"publishConfig": {
|
|
@@ -43,8 +43,6 @@ export const consolePaddingRule: Rule = {
|
|
|
43
43
|
schema: [{ type: "object", additionalProperties: true }],
|
|
44
44
|
},
|
|
45
45
|
create(context) {
|
|
46
|
-
const sourceCode = context.sourceCode ?? context.getSourceCode!()
|
|
47
|
-
const text = sourceCode.getText()
|
|
48
46
|
const { requirePadding } = createPaddingHelpers(context)
|
|
49
47
|
|
|
50
48
|
return {
|
package/src/index.ts
CHANGED
|
@@ -5,7 +5,12 @@
|
|
|
5
5
|
* @file oxlint configuration factory for Sister Software projects.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
import type { AcronymCaseOptions } from "./acronym-case-plugin.js"
|
|
9
|
+
import type { ConstantDocOptions } from "./constant-doc-plugin.js"
|
|
10
|
+
import type { HeaderRuleOptions } from "./headers-plugin.js"
|
|
8
11
|
import { createRuntimeOverrides } from "./restrictions.js"
|
|
12
|
+
import type { SectionMarkerOptions } from "./section-marker-plugin.js"
|
|
13
|
+
import type { ThresholdOptions } from "./threshold-plugin.js"
|
|
9
14
|
|
|
10
15
|
export * from "./restrictions.js"
|
|
11
16
|
|
|
@@ -164,21 +169,20 @@ export interface OxlintConfigOptions {
|
|
|
164
169
|
* Flag numeric literals used as comparison thresholds (off by default). Pass an object to change the ignore list or
|
|
165
170
|
* to stop exempting radix-prefixed literals.
|
|
166
171
|
*/
|
|
167
|
-
unnamedThresholds?: boolean |
|
|
172
|
+
unnamedThresholds?: boolean | ThresholdOptions
|
|
168
173
|
/**
|
|
169
174
|
* Require a JSDoc block on module-level constants (off by default). `scope` selects which ones: `"exported"`,
|
|
170
|
-
* `"screaming"`, or the default `"exported-or-screaming"
|
|
175
|
+
* `"screaming"`, or the default `"exported-or-screaming"`; `ignoreNames` exempts constants whose value IS the
|
|
176
|
+
* documentation — a framework's `description` string, a CLI's `--help` text.
|
|
171
177
|
*/
|
|
172
|
-
constantDocs?: boolean |
|
|
178
|
+
constantDocs?: boolean | ConstantDocOptions
|
|
173
179
|
/**
|
|
174
180
|
* Flag an acronym title-cased inside an identifier — `parseJson` where the house form is `parseJSON` (off by
|
|
175
181
|
* default). `acronyms` replaces the shipped list, `extraAcronyms` layers a project's own vocabulary on top of it,
|
|
176
182
|
* `ignoreNames` exempts identifiers whose casing is not ours to choose, and `scope` widens the rule past exported
|
|
177
183
|
* declarations.
|
|
178
184
|
*/
|
|
179
|
-
acronymCasing?:
|
|
180
|
-
| boolean
|
|
181
|
-
| { acronyms?: string[]; extraAcronyms?: string[]; ignoreNames?: string[]; scope?: "exported" | "all" }
|
|
185
|
+
acronymCasing?: boolean | AcronymCaseOptions
|
|
182
186
|
/**
|
|
183
187
|
* Rewrite explicit length comparisons to truthiness in boolean positions (on by default).
|
|
184
188
|
*/
|
|
@@ -191,7 +195,7 @@ export interface OxlintConfigOptions {
|
|
|
191
195
|
* Enforce the section-marker ladder — `----` banners become `// MARK:`, long labels are flagged, and a file with many
|
|
192
196
|
* markers is nudged toward regions and then toward being several files (on by default).
|
|
193
197
|
*/
|
|
194
|
-
sectionMarkers?: boolean |
|
|
198
|
+
sectionMarkers?: boolean | SectionMarkerOptions
|
|
195
199
|
/**
|
|
196
200
|
* Override individual legibility ceilings. Unspecified keys keep their calibrated default.
|
|
197
201
|
*/
|
|
@@ -292,14 +296,15 @@ export function createOxlintConfig(options: OxlintConfigOptions = {}): OxlintCon
|
|
|
292
296
|
caughtErrors: "all",
|
|
293
297
|
caughtErrorsIgnorePattern: "^_",
|
|
294
298
|
destructuredArrayIgnorePattern: "^_",
|
|
295
|
-
//
|
|
296
|
-
//
|
|
297
|
-
|
|
299
|
+
// Only `_`-prefixed bindings are exempt. A broader pattern suppresses unused-import
|
|
300
|
+
// diagnostics; oxfmt does not detect them, and `noUnusedLocals` is controlled independently
|
|
301
|
+
// by each consumer. Removal is a suggestion, so fix scripts must opt into suggestions.
|
|
302
|
+
varsIgnorePattern: "^_",
|
|
298
303
|
ignoreRestSiblings: true,
|
|
299
304
|
},
|
|
300
305
|
],
|
|
301
306
|
|
|
302
|
-
// TypeScript
|
|
307
|
+
// TypeScript rules stay permissive here; consumers carry their own compiler and type-aware policy.
|
|
303
308
|
"typescript/ban-ts-comment": ["warn", { "ts-ignore": "allow-with-description" }],
|
|
304
309
|
"typescript/ban-types": "off",
|
|
305
310
|
"typescript/no-empty-interface": "off",
|
|
@@ -498,7 +503,10 @@ export function createOxlintConfig(options: OxlintConfigOptions = {}): OxlintCon
|
|
|
498
503
|
if (headers) {
|
|
499
504
|
// Error severity: missing headers should fail `oxlint` (a real CI gate) and surface as an
|
|
500
505
|
// editor error. The rule is auto-fixable, so `oxlint --fix` keeps the friction low.
|
|
501
|
-
rules["sister-software/require-file-header"] = [
|
|
506
|
+
rules["sister-software/require-file-header"] = [
|
|
507
|
+
"error",
|
|
508
|
+
{ copyrightHolder, spdxLicenseIdentifier, author } satisfies HeaderRuleOptions,
|
|
509
|
+
]
|
|
502
510
|
}
|
|
503
511
|
|
|
504
512
|
if (padding) {
|
package/src/plugin-types.ts
CHANGED
|
@@ -2,8 +2,15 @@
|
|
|
2
2
|
* @copyright Sister Software
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
|
-
* @file Minimal ESLint-compatible plugin types shared by the bundled oxlint JS plugins
|
|
6
|
-
*
|
|
5
|
+
* @file Minimal ESLint-compatible plugin types, shared by the bundled oxlint JS plugins and published
|
|
6
|
+
* as `@sister.software/oxlint-config/plugin-types` for a repo writing its own. They are declared
|
|
7
|
+
* here rather than imported from oxlint because oxlint's plugin type surface is alpha and outside
|
|
8
|
+
* its semver promise.
|
|
9
|
+
*
|
|
10
|
+
* The node shape is loose on purpose: a field is declared when a rule reads it, and every field a
|
|
11
|
+
* rule reads belongs here rather than in a consumer's private mirror — a mirror silently lacks the
|
|
12
|
+
* field the next rule needs, and the failure reads as a type error in the rule rather than a gap in
|
|
13
|
+
* the shared type.
|
|
7
14
|
*/
|
|
8
15
|
|
|
9
16
|
export interface Comment {
|
|
@@ -107,6 +114,33 @@ export interface AstNode {
|
|
|
107
114
|
* A TypeScript class member's `public` / `protected` / `private` modifier.
|
|
108
115
|
*/
|
|
109
116
|
accessibility?: string
|
|
117
|
+
/**
|
|
118
|
+
* A call or `new` expression's argument list.
|
|
119
|
+
*/
|
|
120
|
+
arguments?: AstNode[]
|
|
121
|
+
/**
|
|
122
|
+
* The type side of an annotated node — a `TSAsExpression`'s target, a parameter's declared type.
|
|
123
|
+
*/
|
|
124
|
+
typeAnnotation?: AstNode
|
|
125
|
+
/**
|
|
126
|
+
* A `TSTypeReference`'s name. An `Identifier` for a plain reference, a `TSQualifiedName` for a dotted one, so a rule
|
|
127
|
+
* reading `.name` must check `.type` first.
|
|
128
|
+
*/
|
|
129
|
+
typeName?: AstNode
|
|
130
|
+
/**
|
|
131
|
+
* Explicit type arguments — `new Kysely<Schema>()`. The list is on `.params`, and the whole node is absent rather
|
|
132
|
+
* than empty when a call passes none.
|
|
133
|
+
*/
|
|
134
|
+
typeArguments?: AstNode
|
|
135
|
+
/**
|
|
136
|
+
* A template literal's static chunks. `cooked` is null for an invalid escape sequence, which is why it is optional
|
|
137
|
+
* rather than a plain string.
|
|
138
|
+
*/
|
|
139
|
+
quasis?: { value?: { cooked?: string } }[]
|
|
140
|
+
/**
|
|
141
|
+
* A template literal's interpolated expressions, or a sequence expression's operands.
|
|
142
|
+
*/
|
|
143
|
+
expressions?: AstNode[]
|
|
110
144
|
}
|
|
111
145
|
|
|
112
146
|
export interface SourceCode {
|
|
@@ -20,6 +20,21 @@
|
|
|
20
20
|
|
|
21
21
|
import type { Comment, Rule, RuleContext, SourceCode } from "./plugin-types.js"
|
|
22
22
|
|
|
23
|
+
/**
|
|
24
|
+
* Options for the section-marker ladder. The two advisory rungs take no options; these two set the ceilings the
|
|
25
|
+
* mechanical rungs measure against.
|
|
26
|
+
*/
|
|
27
|
+
export interface SectionMarkerOptions {
|
|
28
|
+
/**
|
|
29
|
+
* Ceiling for a marker's label, in characters.
|
|
30
|
+
*/
|
|
31
|
+
maxBodyLength?: number
|
|
32
|
+
/**
|
|
33
|
+
* Ceiling for the number of `#region` blocks in one file.
|
|
34
|
+
*/
|
|
35
|
+
maxRegions?: number
|
|
36
|
+
}
|
|
37
|
+
|
|
23
38
|
/**
|
|
24
39
|
* A run of at least this many dashes reads as decoration rather than as prose.
|
|
25
40
|
*/
|