chore: add Rslint linting#72
Conversation
There was a problem hiding this comment.
Pull request overview
Adds Rslint-based linting to the repo (local + CI) and updates existing TypeScript code to satisfy the recommended JS/TS rules.
Changes:
- Add
@rslint/corewithrslint.config.ts, pluslint/lint:writescripts. - Add a CI lint step and VS Code extension recommendation.
- Refactor a few TS/code-style issues (typed
package.jsonfield access, non-emptycatchblocks, clearer@ts-expect-errornote).
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/prebundle.ts | Tightens typing around reading types fields from package.json and clarifies error-suppression comment; avoids empty catch. |
| src/helper.ts | Removes unused catch variables and avoids empty catch blocks per linter rules. |
| rslint.config.ts | Adds Rslint config enabling recommended JS/TS rule sets with basic ignores. |
| package.json | Adds @rslint/core and lint scripts. |
| pnpm-lock.yaml | Locks @rslint/core and its transitive dependencies. |
| .vscode/extensions.json | Recommends the Rslint VS Code extension. |
| .github/workflows/ci.yml | Runs pnpm lint before tests in CI. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
058bb9d to
7d9fdbe
Compare
7d9fdbe to
147dc50
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 147dc50c53
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @@ -0,0 +1,9 @@ | |||
| import { defineConfig, js, ts } from '@rslint/core'; | |||
There was a problem hiding this comment.
Add jiti or avoid a TypeScript lint config
Because this new config is rslint.config.ts, pnpm lint only works on Node versions with native TypeScript config loading. I checked @rslint/core's config loader: for .ts/.mts configs it uses native loading only when process.features.typescript is present (Node >=22.6) and otherwise requires the optional peer jiti; this repo has no engine pin to Node 22+ and existing tooling supports Node 20, so developers/CI variants on Node 20 will fail before linting unless jiti is added or the config is changed to .mjs.
Useful? React with 👍 / 👎.
Summary
This PR adds Rslint as the repository linter so lint issues are caught locally and in CI. It adds the Rslint JS/TS recommended config, lint scripts, the VS Code extension recommendation, and a CI lint step before tests. It also cleans up the existing source issues required by the recommended rules.