Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ jobs:

# Generate schema/*.schema.json fresh (it's already committed, but regenerating here keeps the release build honest — see the CI drift guard in the typecheck job above) then stamp $id to this tag's own version-pinned release URL. This is deliberately distinct from install.sh's unpinned releases/latest/download/... URL: a schema an editor references long-term must stay put at whatever version it was written against.
- run: pnpm schema
- run: node scripts/stamp-schema-ids.mjs "${{ needs.semantic-release.outputs.tag }}"
- run: node scripts/stamp-schema-ids.mts "${{ needs.semantic-release.outputs.tag }}"

- uses: actions/download-artifact@v8
with:
Expand Down
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
save-exact=true
minimum-release-age-exclude[]=@exadev/eslint-config
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ scripts/
build.mts # esbuild bundle -> node --build-sea=<config> (see Build (Node SEA) below); --bundle-only stops after the bundle, for npm publishing
gen-schema.mts # z.toJSONSchema() per exported schema -> schema/*.schema.json
gen-schema-core.ts # shared schema-generation logic used by gen-schema.mts
stamp-schema-ids.mjs # rewrites $id to the real version-pinned release URL at publish time
stamp-schema-ids.mts # rewrites $id to the real version-pinned release URL at publish time
.github/workflows/
ci.yml # one workflow: check (every push/PR) plus the whole release pipeline, gated to
# tag pushes only — five platform builds, npm publish, GitHub Release, and the
Expand Down
67 changes: 0 additions & 67 deletions eslint-rules/no-pointless-reassignment.ts

This file was deleted.

41 changes: 8 additions & 33 deletions eslint.config.ts
Original file line number Diff line number Diff line change
@@ -1,46 +1,21 @@
import js from "@eslint/js";
import { defineConfig } from "eslint/config";
import globals from "globals";
import tseslint from "typescript-eslint";
import exadev from "@exadev/eslint-config";

import { noPointlessReassignmentRule } from "./eslint-rules/no-pointless-reassignment";

// Bans re-export syntax (`export * from "..."`, `export { x } from "..."`) everywhere, no exceptions -- every consumer imports directly from the real source rather than through an intermediate re-export or barrel file.
const EXPORT_ALL_SELECTOR = "ExportAllDeclaration";
const EXPORT_NAMED_SELECTOR = "ExportNamedDeclaration[source]";
const RE_EXPORT_ALL_MESSAGE = "Re-exporting all exports is not allowed - import directly from the source.";
const RE_EXPORT_NAMED_MESSAGE = "Re-exporting is not allowed - import directly from the source.";

export default tseslint.config(
export default defineConfig([
{ ignores: ["dist", "coverage", "node_modules"] },
{
languageOptions: {
// stamp-schema-ids.mjs is a plain utility script, never part of the type-checked TS project -- fall back to non-type-aware parsing for it instead of pulling it into tsconfig's include just to satisfy the type-aware project service.
parserOptions: { projectService: { allowDefaultProject: ["scripts/stamp-schema-ids.mjs"] }, tsconfigRootDir: import.meta.dirname },
// Every file this project lints (src/, scripts/, the various *.config.ts files) is already listed in tsconfig.json's own include -- no allowDefaultProject fallback list needed now that stamp-schema-ids has been converted from .mjs to .mts, closing the one gap that used to require it.
parserOptions: { projectService: true, tsconfigRootDir: import.meta.dirname },
globals: { ...globals.node },
},
},
js.configs.recommended,
...tseslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
...tseslint.configs.stylisticTypeChecked,
{
// stamp-schema-ids.mjs has no real tsconfig-backed type information (see the allowDefaultProject note above) -- type-aware rules against it just fire noise (every Node built-in call reads as "unsafe" with no real type behind it), so drop the type-checked rule sets for it specifically rather than fighting that.
files: ["**/*.mjs"],
...tseslint.configs.disableTypeChecked,
},
{ linterOptions: { noInlineConfig: true } },
...exadev,
{
plugins: { local: { rules: { "no-pointless-reassignment": noPointlessReassignmentRule } } },
rules: {
"@typescript-eslint/ban-ts-comment": "error",
"@typescript-eslint/consistent-type-assertions": ["error", { assertionStyle: "never" }],
// exadev's own consistent-type-imports leaves fixStyle at the rule's default (separate-type-imports); this repo prefers the type keyword inline on the same import statement instead.
"@typescript-eslint/consistent-type-imports": ["error", { fixStyle: "inline-type-imports" }],
"local/no-pointless-reassignment": "error",
"no-restricted-syntax": [
"error",
{ selector: EXPORT_ALL_SELECTOR, message: RE_EXPORT_ALL_MESSAGE },
{ selector: EXPORT_NAMED_SELECTOR, message: RE_EXPORT_NAMED_MESSAGE },
],
},
},
);
]);
2 changes: 1 addition & 1 deletion knip.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { KnipConfig } from "knip";

const config: KnipConfig = {
entry: ["src/cli.ts"],
project: ["src/**/*.ts", "eslint-rules/**/*.ts"],
project: ["src/**/*.ts"],
ignoreDependencies: [
// Referenced by preset/plugin name in release.config.ts, not by import -- knip can't trace this.
"@semantic-release/npm",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"claude",
"cli"
],
"packageManager": "pnpm@11.6.0",
"packageManager": "pnpm@12.4.1+sha512.2e81e399d73fe8390dab25e06aa788ab7a5908248d2f5a370f82b481147a6a7a367bf8048f9a6fdb6460f21a66f0542dedb8b94ca2c8723596741920b1656d4c",
"type": "module",
"engines": {
"node": ">=22.12.0"
Expand Down Expand Up @@ -54,7 +54,7 @@
"devDependencies": {
"@commitlint/cli": "^21.2.2",
"@commitlint/config-conventional": "^21.2.2",
"@eslint/js": "^10.0.1",
"@exadev/eslint-config": "2.12.1",
"@semantic-release/changelog": "^7.0.0",
"@semantic-release/git": "^11.0.1",
"@semantic-release/npm": "^13.1.5",
Expand Down
Loading
Loading