@antelopejs/tooling-configs 0.0.1 → 0.0.2

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 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 "github:AntelopeJS/tooling-configs"
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. Once the package is published, this becomes a normal version range.
31
+ together.
41
32
 
42
33
  ## oxlint
43
34
 
@@ -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
@@ -172,4 +180,4 @@ declare function antelopePreset(options?: AntelopePresetOptions): {
172
180
  };
173
181
  };
174
182
  //#endregion
175
- export { ANTELOPE_IGNORE_PATTERNS, AntelopePresetOptions, ComplexityThresholds, DEFAULT_COMPLEXITY_THRESHOLDS, antelopePreset };
183
+ 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",
@@ -70,6 +71,14 @@ function basePreset(cycleSeverity) {
70
71
  }
71
72
  });
72
73
  }
74
+ /**
75
+ * The anti-slop rules at one severity. Exported for this repository's own config:
76
+ * it registers the plugin from source rather than through the package exports,
77
+ * so linting never waits on a build.
78
+ */
79
+ function antiSlopRules(severity) {
80
+ return Object.fromEntries(ANTI_SLOP_RULES.map((rule) => [`anti-slop/${rule}`, severity]));
81
+ }
73
82
  function antiSlopPreset(severity) {
74
83
  return defineConfig({
75
84
  jsPlugins: [{
@@ -176,4 +185,4 @@ function antelopePreset(options = {}) {
176
185
  });
177
186
  }
178
187
  //#endregion
179
- export { ANTELOPE_IGNORE_PATTERNS, DEFAULT_COMPLEXITY_THRESHOLDS, antelopePreset };
188
+ 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.1",
3
+ "version": "0.0.2",
4
4
  "description": "Shared tooling presets for AntelopeJS projects: oxlint (incl. vendored anti-slop) and Knip",
5
5
  "keywords": [
6
6
  "antelopejs",
@@ -38,7 +38,6 @@
38
38
  "typecheck": "tsc --noEmit",
39
39
  "test": "node --test \"src/oxc/anti-slop/rules/*.test.ts\"",
40
40
  "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
41
  "format:check": "oxfmt --check ."
43
42
  },
44
43
  "dependencies": {