@antelopejs/tooling-configs 0.0.1 → 0.0.3
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 +2 -11
- package/dist/eslint.mjs +1 -0
- package/dist/knip.mjs +13 -4
- package/dist/oxc/lint.d.mts +15 -1
- package/dist/oxc/lint.mjs +18 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -15,10 +15,8 @@ executing TypeScript, which earlier runtimes cannot do.
|
|
|
15
15
|
|
|
16
16
|
## Install
|
|
17
17
|
|
|
18
|
-
The package is not on npm yet. Until it is, consume it straight from this repository:
|
|
19
|
-
|
|
20
18
|
```bash
|
|
21
|
-
pnpm add -D oxlint@1.81.0 oxfmt
|
|
19
|
+
pnpm add -D oxlint@1.81.0 oxfmt @antelopejs/tooling-configs
|
|
22
20
|
```
|
|
23
21
|
|
|
24
22
|
Add `eslint-plugin-perfectionist` too unless you turn import sorting off — it is an
|
|
@@ -28,16 +26,9 @@ optional peer dependency because it pulls ESLint and typescript-eslint along wit
|
|
|
28
26
|
pnpm add -D eslint-plugin-perfectionist
|
|
29
27
|
```
|
|
30
28
|
|
|
31
|
-
`dist/` is committed for exactly as long as that install path lasts: pnpm 11 refuses to
|
|
32
|
-
run a git dependency's build unless every consumer allowlists it by commit hash, which
|
|
33
|
-
would break on every push here. CI fails if the committed build is stale. When the
|
|
34
|
-
package reaches npm, delete `dist/` from git, restore the `prepare` script, and change
|
|
35
|
-
consumers from `github:AntelopeJS/tooling-configs` to a version range — the import
|
|
36
|
-
specifiers never change.
|
|
37
|
-
|
|
38
29
|
Pin `oxlint` to the exact version this package depends on for `@oxlint/plugins`
|
|
39
30
|
(currently **1.81.0**). The JS plugin API is still alpha and the two packages must move
|
|
40
|
-
together.
|
|
31
|
+
together.
|
|
41
32
|
|
|
42
33
|
## oxlint
|
|
43
34
|
|
package/dist/eslint.mjs
CHANGED
|
@@ -16,6 +16,7 @@ const ANTELOPE_NUXT_RULES = {
|
|
|
16
16
|
"vue/require-default-prop": "off",
|
|
17
17
|
"@typescript-eslint/no-explicit-any": "off",
|
|
18
18
|
"@typescript-eslint/no-empty-object-type": "off",
|
|
19
|
+
"@typescript-eslint/unified-signatures": "off",
|
|
19
20
|
"@typescript-eslint/no-unused-vars": ["error", {
|
|
20
21
|
argsIgnorePattern: "^_",
|
|
21
22
|
varsIgnorePattern: "^_",
|
package/dist/knip.mjs
CHANGED
|
@@ -12,17 +12,26 @@ const DEFAULT_IGNORE = [
|
|
|
12
12
|
".antelope/**"
|
|
13
13
|
];
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
15
|
+
* `typecheck` is a script in the Nuxt layer's own manifest, outside the analysed
|
|
16
|
+
* project, and every layer's CI runs it.
|
|
17
|
+
*
|
|
18
|
+
* The AntelopeJS CLIs are deliberately absent: a repository that invokes `ajs`
|
|
19
|
+
* or `acms` declares the package providing it, so Knip resolves them and an
|
|
20
|
+
* ignore would only hide a missing dependency.
|
|
18
21
|
*/
|
|
19
22
|
const DEFAULT_IGNORE_BINARIES = ["typecheck"];
|
|
23
|
+
/**
|
|
24
|
+
* The AntelopeJS runtime loads modules by name, from the antelope config rather
|
|
25
|
+
* than through an import, so nothing in the source points at them and Knip reads
|
|
26
|
+
* every one as dead weight.
|
|
27
|
+
*/
|
|
28
|
+
const DEFAULT_IGNORE_DEPENDENCIES = ["@antelopejs/.*"];
|
|
20
29
|
function antelopeKnipConfig(options = {}) {
|
|
21
30
|
return {
|
|
22
31
|
entry: [...DEFAULT_ENTRY, ...options.entry ?? []],
|
|
23
32
|
project: [...DEFAULT_PROJECT, ...options.project ?? []],
|
|
24
33
|
ignore: [...DEFAULT_IGNORE, ...options.ignore ?? []],
|
|
25
|
-
ignoreDependencies: options.ignoreDependencies ?? [],
|
|
34
|
+
ignoreDependencies: [...DEFAULT_IGNORE_DEPENDENCIES, ...options.ignoreDependencies ?? []],
|
|
26
35
|
ignoreBinaries: [...DEFAULT_IGNORE_BINARIES, ...options.ignoreBinaries ?? []]
|
|
27
36
|
};
|
|
28
37
|
}
|
package/dist/oxc/lint.d.mts
CHANGED
|
@@ -81,6 +81,14 @@ interface AntelopePresetOptions {
|
|
|
81
81
|
*/
|
|
82
82
|
typeAware?: boolean;
|
|
83
83
|
}
|
|
84
|
+
/** Every generic anti-slop rule, exported so this package can lint itself. */
|
|
85
|
+
declare const ANTI_SLOP_RULES: readonly ["no-chained-type-assertions", "no-conditional-empty-object-spread", "no-known-value-widening", "no-module-mocking", "no-object-parameters", "no-reflect-apply", "no-reflect-get", "no-runtime-typeof", "no-shape-in-symbol-names", "no-unknown-parameters", "no-unknown-returns", "no-unknown-type-aliases", "no-unsafe-dictionary-type", "no-widen-then-assert", "require-safety-comment-for-type-assertion"];
|
|
86
|
+
/**
|
|
87
|
+
* The anti-slop rules at one severity. Exported for this repository's own config:
|
|
88
|
+
* it registers the plugin from source rather than through the package exports,
|
|
89
|
+
* so linting never waits on a build.
|
|
90
|
+
*/
|
|
91
|
+
declare function antiSlopRules(severity: Severity): Record<string, Severity>;
|
|
84
92
|
/**
|
|
85
93
|
* The shared AntelopeJS oxlint preset: oxc's own defaults (the `correctness`
|
|
86
94
|
* category), plus import hygiene, complexity ceilings, import sorting, and the
|
|
@@ -111,6 +119,11 @@ declare function antelopePreset(options?: AntelopePresetOptions): {
|
|
|
111
119
|
varsIgnorePattern: "^_";
|
|
112
120
|
caughtErrorsIgnorePattern: "^_";
|
|
113
121
|
}];
|
|
122
|
+
"eslint/eqeqeq": ["error", "always", {
|
|
123
|
+
null: "ignore";
|
|
124
|
+
}];
|
|
125
|
+
"eslint/radix": "error";
|
|
126
|
+
"eslint/prefer-regex-literals": "error";
|
|
114
127
|
"import/no-cycle": Severity;
|
|
115
128
|
"import/no-self-import": "error";
|
|
116
129
|
"import/no-duplicates": "error";
|
|
@@ -122,6 +135,7 @@ declare function antelopePreset(options?: AntelopePresetOptions): {
|
|
|
122
135
|
"typescript/unbound-method": "warn";
|
|
123
136
|
"typescript/no-meaningless-void-operator": "warn";
|
|
124
137
|
"typescript/no-misused-spread": "warn";
|
|
138
|
+
"typescript/no-base-to-string": "warn";
|
|
125
139
|
"typescript/no-redundant-type-constituents": "warn";
|
|
126
140
|
"typescript/restrict-template-expressions": "warn";
|
|
127
141
|
"typescript/require-array-sort-compare": "warn";
|
|
@@ -172,4 +186,4 @@ declare function antelopePreset(options?: AntelopePresetOptions): {
|
|
|
172
186
|
};
|
|
173
187
|
};
|
|
174
188
|
//#endregion
|
|
175
|
-
export { ANTELOPE_IGNORE_PATTERNS, AntelopePresetOptions, ComplexityThresholds, DEFAULT_COMPLEXITY_THRESHOLDS, antelopePreset };
|
|
189
|
+
export { ANTELOPE_IGNORE_PATTERNS, ANTI_SLOP_RULES, AntelopePresetOptions, ComplexityThresholds, DEFAULT_COMPLEXITY_THRESHOLDS, antelopePreset, antiSlopRules };
|
package/dist/oxc/lint.mjs
CHANGED
|
@@ -22,6 +22,7 @@ const DEFAULT_COMPLEXITY_THRESHOLDS = {
|
|
|
22
22
|
maxDepth: 4,
|
|
23
23
|
complexity: 20
|
|
24
24
|
};
|
|
25
|
+
/** Every generic anti-slop rule, exported so this package can lint itself. */
|
|
25
26
|
const ANTI_SLOP_RULES = [
|
|
26
27
|
"no-chained-type-assertions",
|
|
27
28
|
"no-conditional-empty-object-spread",
|
|
@@ -64,12 +65,27 @@ function basePreset(cycleSeverity) {
|
|
|
64
65
|
varsIgnorePattern: "^_",
|
|
65
66
|
caughtErrorsIgnorePattern: "^_"
|
|
66
67
|
}],
|
|
68
|
+
"eslint/eqeqeq": [
|
|
69
|
+
"error",
|
|
70
|
+
"always",
|
|
71
|
+
{ null: "ignore" }
|
|
72
|
+
],
|
|
73
|
+
"eslint/radix": "error",
|
|
74
|
+
"eslint/prefer-regex-literals": "error",
|
|
67
75
|
"import/no-cycle": cycleSeverity,
|
|
68
76
|
"import/no-self-import": "error",
|
|
69
77
|
"import/no-duplicates": "error"
|
|
70
78
|
}
|
|
71
79
|
});
|
|
72
80
|
}
|
|
81
|
+
/**
|
|
82
|
+
* The anti-slop rules at one severity. Exported for this repository's own config:
|
|
83
|
+
* it registers the plugin from source rather than through the package exports,
|
|
84
|
+
* so linting never waits on a build.
|
|
85
|
+
*/
|
|
86
|
+
function antiSlopRules(severity) {
|
|
87
|
+
return Object.fromEntries(ANTI_SLOP_RULES.map((rule) => [`anti-slop/${rule}`, severity]));
|
|
88
|
+
}
|
|
73
89
|
function antiSlopPreset(severity) {
|
|
74
90
|
return defineConfig({
|
|
75
91
|
jsPlugins: [{
|
|
@@ -109,6 +125,7 @@ function typeAwarePreset() {
|
|
|
109
125
|
"typescript/unbound-method": "warn",
|
|
110
126
|
"typescript/no-meaningless-void-operator": "warn",
|
|
111
127
|
"typescript/no-misused-spread": "warn",
|
|
128
|
+
"typescript/no-base-to-string": "warn",
|
|
112
129
|
"typescript/no-redundant-type-constituents": "warn",
|
|
113
130
|
"typescript/restrict-template-expressions": "warn",
|
|
114
131
|
"typescript/require-array-sort-compare": "warn"
|
|
@@ -176,4 +193,4 @@ function antelopePreset(options = {}) {
|
|
|
176
193
|
});
|
|
177
194
|
}
|
|
178
195
|
//#endregion
|
|
179
|
-
export { ANTELOPE_IGNORE_PATTERNS, DEFAULT_COMPLEXITY_THRESHOLDS, antelopePreset };
|
|
196
|
+
export { ANTELOPE_IGNORE_PATTERNS, ANTI_SLOP_RULES, DEFAULT_COMPLEXITY_THRESHOLDS, antelopePreset, antiSlopRules };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antelopejs/tooling-configs",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Shared tooling presets for AntelopeJS projects: oxlint (incl. vendored anti-slop) and Knip",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"antelopejs",
|
|
@@ -26,7 +26,8 @@
|
|
|
26
26
|
"./eslint": "./dist/eslint.mjs"
|
|
27
27
|
},
|
|
28
28
|
"publishConfig": {
|
|
29
|
-
"access": "public"
|
|
29
|
+
"access": "public",
|
|
30
|
+
"provenance": true
|
|
30
31
|
},
|
|
31
32
|
"scripts": {
|
|
32
33
|
"build": "tsdown",
|
|
@@ -38,7 +39,6 @@
|
|
|
38
39
|
"typecheck": "tsc --noEmit",
|
|
39
40
|
"test": "node --test \"src/oxc/anti-slop/rules/*.test.ts\"",
|
|
40
41
|
"checks": "pnpm run typecheck && pnpm run lint && pnpm run format:check && pnpm run test",
|
|
41
|
-
"check:dist": "pnpm run build && git diff --exit-code dist",
|
|
42
42
|
"format:check": "oxfmt --check ."
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|