Skip to content

chore: add Rslint linting#72

Merged
chenjiahan merged 1 commit intomainfrom
chenjiahan/feat-rslint-lint
May 7, 2026
Merged

chore: add Rslint linting#72
chenjiahan merged 1 commit intomainfrom
chenjiahan/feat-rslint-lint

Conversation

@chenjiahan
Copy link
Copy Markdown
Member

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.

Copilot AI review requested due to automatic review settings May 7, 2026 10:58
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/core with rslint.config.ts, plus lint / lint:write scripts.
  • Add a CI lint step and VS Code extension recommendation.
  • Refactor a few TS/code-style issues (typed package.json field access, non-empty catch blocks, clearer @ts-expect-error note).

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.

Comment thread rslint.config.ts Outdated
Comment thread package.json
@chenjiahan chenjiahan force-pushed the chenjiahan/feat-rslint-lint branch from 058bb9d to 7d9fdbe Compare May 7, 2026 11:03
@chenjiahan chenjiahan force-pushed the chenjiahan/feat-rslint-lint branch from 7d9fdbe to 147dc50 Compare May 7, 2026 11:06
@chenjiahan chenjiahan merged commit ac967a1 into main May 7, 2026
6 checks passed
@chenjiahan chenjiahan deleted the chenjiahan/feat-rslint-lint branch May 7, 2026 11:07
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread rslint.config.ts
@@ -0,0 +1,9 @@
import { defineConfig, js, ts } from '@rslint/core';
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants