Skip to content
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

Add eslint-plugin-perfectionist and eslint-plugin-react-perf to the base and /react configs, respectively #20

Merged
merged 9 commits into from
Sep 18, 2024

Conversation

mangs
Copy link
Contributor

@mangs mangs commented Sep 14, 2024

Pull Request Checklist

  • I have read the CONTRIBUTING document
  • Readme and changelog updates were made reflecting this PR's changes
  • Increase the project version number in package.json following Semantic Versioning

Changes Included

  • Version bump to 2.1.0
  • Add eslint-plugin-perfectionist to the base configuration and all its dependent configurations
    • Provides more robust and consistent alphabetical sorting features than what ESLint provides by default
    • All rules are auto-fixable
    • Its rules replace rules import/order, sort-keys, and sort-vars
  • Add eslint-plugin-react-perf to the /react configuration and all its dependent configurations
    • Provides performance-related checks to prevent code that causes performance problems
  • Upgrade dependencies to latest versions
  • Upgrade Bun version from 1.1.17 to 1.1.27

@mangs mangs requested a review from jduthon September 14, 2024 16:30
@mangs mangs changed the title Add eslint-plugin-react-perf to the /react config and all its dependent configs Add eslint-plugin-perfectionist and eslint-plugin-react-perf to the base and /react configs, respectively Sep 14, 2024
Copy link
Contributor Author

@mangs mangs left a comment

Choose a reason for hiding this comment

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

Some notes for context:

"perfectionist/sort-imports": [
"error",
{
"environment": "bun",
Copy link
Contributor Author

@mangs mangs Sep 14, 2024

Choose a reason for hiding this comment

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

environment switched to Bun so bun:* imports work (e.g. bun:test) without any more hacks (e.g. the settings: section that I removed in this PR)

Comment on lines +43 to +62
"perfectionist/sort-imports": [
"error",
{
"environment": "node",
"groups": [
["side-effect", "side-effect-style"],
["builtin", "external"],
["index", "internal", "parent", "sibling", "unknown"],
["type"],
["object"]
],
"newlines-between": "always"
"object",
[
"builtin-type",
"external-type",
"index-type",
"internal-type",
"parent-type",
"sibling-type",
"type"
],
"style"
]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

a huge upside to these are they are now auto-fixable with eslint-plugin-perfectionist, so you can fix your whole codebase with one command (e.g. eslint --fix)

"extends": [
"eslint-config-airbnb",
"airbnb/hooks",
"plugin:jsx-a11y/recommended",
"plugin:react-perf/recommended",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

nice performance recommendations here for React apps

test/eslintBaseConfig/exampleBaseConfigEntrypoint.mjs Outdated Show resolved Hide resolved
@@ -192,26 +192,26 @@ export {
anError,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

text fixes from here down

@mangs mangs merged commit 190a48d into babbel:main Sep 18, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants