-
Notifications
You must be signed in to change notification settings - Fork 2
Style: Switch from ESLint Prettier formatting to Stylistic rules (1. part) #2153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for spirit-design-system-storybook canceled.
|
✅ Deploy Preview for spirit-design-system ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
b1143e5 to
226dd11
Compare
226dd11 to
8f757fe
Compare
8f757fe to
4a236c3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR migrates from ESLint Prettier formatting to Stylistic rules as a first step in the transition from Prettier to a more configurable code formatting solution. The change introduces a new @stylistic/eslint-plugin configuration while maintaining backward compatibility by keeping both stylistic and prettier configurations available.
Key Changes:
- Created new stylistic and prettier rule configurations in
eslint-config-spirit - Updated root ESLint configuration to use stylistic rules instead of prettier
- Individual packages still use prettier rules during this transition phase
Reviewed Changes
Copilot reviewed 38 out of 40 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
scripts/lts-schedule/lib/index.js |
Applied stylistic formatting fixes including improved variable naming and better line breaks |
Various package.json files |
Added eslint-config-spirit dependency to enable new linting configurations |
Various .eslintrc.js files |
Updated to extend prettier config from eslint-config-spirit/prettier |
configs/eslint-config-spirit/style.js |
New stylistic rules configuration file |
configs/eslint-config-spirit/prettier.js |
New prettier rules configuration file |
.eslintrc.js |
Updated root config to use stylistic rules |
.prettierignore |
Expanded to ignore additional JS/TS file types |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
4a236c3 to
8478a97
Compare
27fe2f2 to
6dd0346
Compare
e3ea77e to
8171562
Compare
e1406f6 to
a1450a2
Compare
a1450a2 to
0788a8e
Compare
f3649fc to
1a98636
Compare
67fe3ac to
ad2bb57
Compare
…ormatting * remove prettier dependencies * introduce new stylistic rules
ad2bb57 to
5d89b88
Compare
| }; | ||
| ``` | ||
|
|
||
| #### Switching Between Style Configurations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If my assumption about moving this config and README to CQT is correct, maybe we could show here the main differences between the two tools? From what I can see in this PR:
- dangling commas,
- multi-line comments starting with
/*!, - line length limit for single-line comments,
- single-/multi-character variable names.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I can mention here a few examples, but for the full list of the configuration, you must see the style.js rules. And rewriting them all will be a lot of work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No no, of course not everything. Just the major differences so the users can decide better.

Description
Migration from Prettier formatting of JS files to Stylistic rules
What has been done:
What is planned:
Why this change:
What to discuss:
style.jsandprettier.jsok, or would it be more convenient to usestylistic.jsandprettier.js; both solve only code styleAdditional context
I am still considering Prettier as a good tool for formatting, but it looks like the stylistic rules are providing a more precise type of format configuration, and they let us format the code as we wish when we are under the max length limit.
Issue reference