Skip to content

chore: enable eslint-plugin-perfectionist on eslint-plugin package, with ordering tweaks #9843

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

Conversation

JoshuaKGoldberg
Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg commented Aug 20, 2024

PR Checklist

Overview

Enables sorting on packages/eslint-plugin.

This by nature includes a couple changes to rule ordering preferences edit: after review feedback, this now sets the config to explicitly override alphabetrization:

  • Putting create after metadata such as meta in rule definitions
  • Putting start before end in rule reports and test cases
  • Putting type before other properties in rule meta and schema objects
  • Putting valid entries before invalid ones in rule tests

💖

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @JoshuaKGoldberg!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint.

Copy link

netlify bot commented Aug 20, 2024

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit d79866d
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/6706a9c74e6e0900087f60eb
😎 Deploy Preview https://deploy-preview-9843--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 95 (🟢 up 1 from production)
Accessibility: 100 (no change from production)
Best Practices: 92 (no change from production)
SEO: 90 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@JoshuaKGoldberg JoshuaKGoldberg force-pushed the perfectionist-eslint-plugin branch from a9f8902 to 06c6ece Compare August 20, 2024 20:20
@JoshuaKGoldberg JoshuaKGoldberg marked this pull request as ready for review August 20, 2024 21:19
@JoshuaKGoldberg JoshuaKGoldberg requested a review from a team August 20, 2024 21:19
Copy link

codecov bot commented Aug 20, 2024

Codecov Report

Attention: Patch coverage is 95.66563% with 14 lines in your changes missing coverage. Please review.

Project coverage is 86.07%. Comparing base (f898248) to head (d79866d).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...s/eslint-plugin/src/util/collectUnusedVariables.ts 88.37% 3 Missing and 2 partials ⚠️
...es/eslint-plugin/src/util/getOperatorPrecedence.ts 37.50% 5 Missing ⚠️
...s/eslint-plugin/src/rules/no-restricted-imports.ts 77.77% 2 Missing ⚠️
...es/no-unnecessary-parameter-property-assignment.ts 91.66% 0 Missing and 1 partial ⚠️
...ages/eslint-plugin/src/rules/unified-signatures.ts 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #9843   +/-   ##
=======================================
  Coverage   86.07%   86.07%           
=======================================
  Files         428      428           
  Lines       14939    14939           
  Branches     4333     4333           
=======================================
  Hits        12859    12859           
  Misses       1735     1735           
  Partials      345      345           
Flag Coverage Δ
unittest 86.07% <95.66%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...t-plugin/src/rules/adjacent-overload-signatures.ts 100.00% <ø> (ø)
packages/eslint-plugin/src/rules/array-type.ts 97.26% <ø> (ø)
packages/eslint-plugin/src/rules/await-thenable.ts 100.00% <ø> (ø)
packages/eslint-plugin/src/rules/ban-ts-comment.ts 100.00% <100.00%> (ø)
...ages/eslint-plugin/src/rules/ban-tslint-comment.ts 100.00% <ø> (ø)
...t-plugin/src/rules/class-literal-property-style.ts 100.00% <100.00%> (ø)
.../eslint-plugin/src/rules/class-methods-use-this.ts 91.30% <ø> (ø)
...lugin/src/rules/consistent-generic-constructors.ts 90.24% <100.00%> (ø)
...lugin/src/rules/consistent-indexed-object-style.ts 96.61% <100.00%> (ø)
...kages/eslint-plugin/src/rules/consistent-return.ts 93.61% <100.00%> (ø)
... and 148 more

Copy link
Member

@bradzacher bradzacher left a comment

Choose a reason for hiding this comment

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

my 2c: big no no here for rule definitions and test definitions.

Copy link
Member

@kirkwaiblinger kirkwaiblinger left a comment

Choose a reason for hiding this comment

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

Fully agree with @bradzacher here.

Also, even if I agreed the sorted version were preferable, I would say this is a huge disruption to the git history for marginal gain at best, and therefore better to pass on, granted the existing codebase state.

@bradzacher
Copy link
Member

There's a sorting rule in eslint-plugin-eslint-plugin right? That one maintains a sort order closer to what we do IIRC

@JoshuaKGoldberg JoshuaKGoldberg marked this pull request as draft August 23, 2024 15:56
@JoshuaKGoldberg JoshuaKGoldberg added the awaiting response Issues waiting for a reply from the OP or another party label Sep 8, 2024
@JoshuaKGoldberg JoshuaKGoldberg removed the awaiting response Issues waiting for a reply from the OP or another party label Sep 16, 2024
@JoshuaKGoldberg JoshuaKGoldberg marked this pull request as ready for review September 16, 2024 17:40
kirkwaiblinger
kirkwaiblinger previously approved these changes Sep 18, 2024
Copy link
Member

@kirkwaiblinger kirkwaiblinger left a comment

Choose a reason for hiding this comment

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

ok, i guess i have been picky enough 😆 Thanks for indulging me

@JoshuaKGoldberg JoshuaKGoldberg requested review from bradzacher and removed request for bradzacher September 18, 2024 14:42
@JoshuaKGoldberg JoshuaKGoldberg changed the title chore: enable eslint-plugin-perfectionist on eslint-plugin package chore: enable eslint-plugin-perfectionist on eslint-plugin package, with ordering tweaks Oct 8, 2024
bradzacher
bradzacher previously approved these changes Oct 9, 2024
@JoshuaKGoldberg JoshuaKGoldberg merged commit 3f02687 into typescript-eslint:main Oct 9, 2024
60 checks passed
@JoshuaKGoldberg JoshuaKGoldberg deleted the perfectionist-eslint-plugin branch October 9, 2024 16:24
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants