Skip to content

chore: lint with rslint and format with rs fmt - #207

Merged
zatteo merged 4 commits into
mainfrom
chore/rslint
Oct 28, 2026
Merged

zatteo merged 4 commits into
mainfrom
chore/rslint

Conversation

@zatteo

@zatteo zatteo commented Oct 28, 2026

Copy link
Copy Markdown
Member

Summary

twake-icons and twake-mui are now linted with Rslint (rs lint), and the repository is formatted with rs fmt, through rslint-config-cozy-app 0.2.0. eslint-config-cozy-app is removed, with the eslint.config.mjs of both packages.

  • A single rstack.config.mjs at the root. npm run lint runs rs lint on the src folders of twake-icons and twake-mui, with the same ignores as before. npm run fmt formats the code, and a new CI step runs npm run lint:fmt. The generated icons and the changelogs written by semantic-release are left out.
  • npm run lint takes 2s instead of 15 to 17s (4 CPUs, no cache). The format check takes 1s.
  • Same rules as before, except three that Rslint does not implement: prettier/prettier (replaced by rs fmt --check), spaced-comment and import/no-extraneous-dependencies. The React Compiler rules of eslint-plugin-react-hooks are no longer checked either.
  • The storybook rules still run, as a JS plugin of Rslint. Rslint does not read the @(ts|tsx) globs of the storybook configs, so the config rewrites them as {ts,tsx}.
  • One type assertion that TypeScript does not need is removed from makeTypography.
  • rs fmt and the import order each get their own commit. rs fmt also formats the SCSS of twake-css: in dist/vars.css, the shadows now span several lines, which browsers read the same. In the JS of dist, only the order of imports changes.
  • The lockfile resolves @rslib/core, a dependency of rstack, to 1.0.3: 1.0.4 would install another copy of rsbuild and Rspack.

@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 665874a6-fb19-48fc-aae4-e21410f36ec6
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@JF-Cozy JF-Cozy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

oh yeah 😎

Comment thread rstack.config.mjs
]
},
...react(lint),
// Rslint does not read the @(ts|tsx) globs of the storybook configs

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

maybe it should? 🤔

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

For the moment it can't, if we want it we should open an issue in rslint

@@ -1,5 +1,5 @@
.u-debug {
background: rgba(0, 0, 0, .075);
background: rgba(0, 0, 0, 0.075);

@JF-Cozy JF-Cozy Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

still ; at the end. If it's not necessary, I suppose there is no rules in rslint for scss files, maybe we should add one?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

rslint does not lint scss unfortunately. If we want scss linting we need to add stylelint alongside

@zatteo
zatteo marked this pull request as ready for review October 28, 2026 10:53
@zatteo
zatteo requested a review from Eriikah as a code owner October 28, 2026 10:53
makeTypography already returns TypographyVariantsOptions, and the object
checks against it without the assertion.

Assisted-by: LLM
A single rstack.config.mjs at the root replaces the ESLint configs of
twake-icons and twake-mui: npm run lint runs rs lint on their src
folders, with the same ignores, and a new CI step runs rs fmt --check.
rs fmt leaves out the generated icons and the changelogs, which
semantic-release writes. tsconfig.eslint.json of twake-icons only served
ESLint.

Rslint does not implement these rules, which are no longer checked:
prettier/prettier (replaced by rs fmt --check), spaced-comment and
import/no-extraneous-dependencies. rslint-config-cozy-app does not
enable the React Compiler rules of eslint-plugin-react-hooks either.

The storybook rules still run, as a JS plugin of Rslint, which installs
eslint as its peer dependency. Rslint does not read the @(ts|tsx) globs
of the storybook configs, so the config rewrites them as {ts,tsx}:
otherwise react-hooks/rules-of-hooks would report the hooks of story
render functions.

The lockfile resolves @rslib/core, a dependency of rstack, to 1.0.3:
1.0.4 depends on @rsbuild/core ~2.3.0-beta.0, which would install
another copy of rsbuild and Rspack.

Assisted-by: LLM
Assisted-by: LLM
@zatteo
zatteo merged commit ef564c4 into main Oct 28, 2026
6 checks passed
@zatteo
zatteo deleted the chore/rslint branch October 28, 2026 15:34
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