jsr icon indicating copy to clipboard operation
jsr copied to clipboard

Add `jsr lint` or `jsr publish lint`

Open Swimburger opened this issue 1 year ago • 2 comments

When publishing using jsr publish, jsr does some linting. I suggest adding jsr lint or jsr publish lint so that we can include this linting as part of other linting tasks.

I have the following in my package.json which I run before creating PRs and publishing to package hosts:

  "scripts": {
    "lint": "pnpm lint:eslint && pnpm lint:publint && pnpm lint:tsc && pnpm lint:script && pnpm lint:format",
    "lint:eslint": "eslint -c .eslintrc.json '{src,tests}/**/*.{js,ts}'",
    "lint:publint": "publint",
    "lint:tsc": "tsc --noEmit -p tsconfig.json",
    "lint:script": "tsx ./scripts/lint.ts",
    "lint:format": "prettier  --check --no-error-on-unmatched-pattern {*,**/*}",

I would add another entry for jsr, so I'd like to have a linting option decoupled from the publishing.

Swimburger avatar May 22 '24 23:05 Swimburger

You can run jsr publish --dry-run.

lucacasonato avatar May 23 '24 12:05 lucacasonato

Thanks, that works!

Still may be helpful to have a separate command that doesn't include the actual dry-run aspect.

Swimburger avatar May 23 '24 16:05 Swimburger

-1 for listing code. maybe have something like jsr --validate a tool that validate jsr.json and rest

AugustinMauroy avatar Feb 11 '25 09:02 AugustinMauroy

Closing as using jsr publish --dry-run is the preferred approach

crowlKats avatar May 29 '25 16:05 crowlKats