@zgeoff/oxlint-config 0.2.5 → 0.2.6
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 +4 -4
- package/load-zone-options.js +4 -2
- package/oxlintrc.json +5 -0
- package/package.json +2 -2
- package/plugin.js +5 -0
package/README.md
CHANGED
|
@@ -5,10 +5,10 @@ restriction-rule cherry-picks, comment-style enforcement via `@stylistic`, and a
|
|
|
5
5
|
(`zgeoff/*` rules) banning shapes no native oxlint rule can express — top-level arrows, nested
|
|
6
6
|
function declarations, bare named exports, destructured and inline-typed parameters, ternary and
|
|
7
7
|
await arguments, awaits hidden inside a control-flow condition or a `&&`/`||`/`??` chain, every
|
|
8
|
-
JSDoc block, any run of more than three line comments, and a repo config
|
|
9
|
-
rule. `zgeoff/function-verb` enforces the function-naming taxonomy from
|
|
10
|
-
`zgeoff/test-beside-module` keeps each test file beside the module it
|
|
11
|
-
`zgeoff/import-zones` fails an import that crosses a module boundary the repo declares.
|
|
8
|
+
`switch` statement, every JSDoc block, any run of more than three line comments, and a repo config
|
|
9
|
+
that loosens either comment rule. `zgeoff/function-verb` enforces the function-naming taxonomy from
|
|
10
|
+
the shared agent guidelines, `zgeoff/test-beside-module` keeps each test file beside the module it
|
|
11
|
+
tests, and `zgeoff/import-zones` fails an import that crosses a module boundary the repo declares.
|
|
12
12
|
|
|
13
13
|
## Usage
|
|
14
14
|
|
package/load-zone-options.js
CHANGED
|
@@ -26,8 +26,6 @@ function buildZoneOptions(options) {
|
|
|
26
26
|
match: makeGlobMatcher(globsByZone[name]),
|
|
27
27
|
}));
|
|
28
28
|
|
|
29
|
-
const buildEntries = (entries) => (entries ?? []).map((entry) => buildEntry(entry));
|
|
30
|
-
|
|
31
29
|
return {
|
|
32
30
|
zones,
|
|
33
31
|
extensions: options.extensions ?? defaultExtensions,
|
|
@@ -40,6 +38,10 @@ function buildZoneOptions(options) {
|
|
|
40
38
|
};
|
|
41
39
|
}
|
|
42
40
|
|
|
41
|
+
function buildEntries(entries) {
|
|
42
|
+
return (entries ?? []).map((entry) => buildEntry(entry));
|
|
43
|
+
}
|
|
44
|
+
|
|
43
45
|
function buildEntry(entry) {
|
|
44
46
|
return {
|
|
45
47
|
...entry,
|
package/oxlintrc.json
CHANGED
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"zgeoff/no-await-args": "error",
|
|
26
26
|
"zgeoff/no-await-in-condition": "error",
|
|
27
27
|
"zgeoff/no-await-in-logical": "error",
|
|
28
|
+
"zgeoff/no-switch": "error",
|
|
28
29
|
"zgeoff/no-jsdoc": "error",
|
|
29
30
|
"zgeoff/max-consecutive-line-comments": ["error", { "max": 3 }],
|
|
30
31
|
"zgeoff/no-comment-rule-override": "error",
|
|
@@ -105,6 +106,10 @@
|
|
|
105
106
|
"unicorn/number-literal-case": "off",
|
|
106
107
|
"unicorn/filename-case": "off",
|
|
107
108
|
|
|
109
|
+
// one declaration per variable; a declaration list has no order to sort
|
|
110
|
+
"one-var": ["error", "never"],
|
|
111
|
+
"sort-vars": "off",
|
|
112
|
+
|
|
108
113
|
// category-enabled rules that contradict this config's style: inline named
|
|
109
114
|
// export declarations are the convention (group-exports demands the exact
|
|
110
115
|
// form no-bare-named-exports bans), keys group by meaning not alphabet,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgeoff/oxlint-config",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"description": "Shareable oxlint config: strict categories, house-style rules, and a custom JS plugin",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -44,6 +44,6 @@
|
|
|
44
44
|
"typescript": "7.0.1-rc"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"oxlint": ">=1.
|
|
47
|
+
"oxlint": ">=1.78.0"
|
|
48
48
|
}
|
|
49
49
|
}
|
package/plugin.js
CHANGED
|
@@ -95,6 +95,11 @@ const plugin = {
|
|
|
95
95
|
'Await into a named const instead of chaining it after a && / || / ?? operator.',
|
|
96
96
|
['LogicalExpression > AwaitExpression'],
|
|
97
97
|
),
|
|
98
|
+
'no-switch': buildBanRule(
|
|
99
|
+
'problem',
|
|
100
|
+
'Branch with match(...).exhaustive() from ts-pattern, never switch.',
|
|
101
|
+
['SwitchStatement'],
|
|
102
|
+
),
|
|
98
103
|
'no-jsdoc': noJSDoc,
|
|
99
104
|
'max-consecutive-line-comments': maxConsecutiveLineComments,
|
|
100
105
|
'no-comment-rule-override': noCommentRuleOverride,
|