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

chore: brought in typescript-eslint@v8 with stylistic preset #10911

Conversation

JoshuaKGoldberg
Copy link
Contributor

@JoshuaKGoldberg JoshuaKGoldberg commented Jul 4, 2024

This applies two internal tooling updates:

Any changes (will be) commented inline. This also doesn't tackle three good followups:

There should be no user-facing functional changes. It should just be cleanups.

⚠️ This isn't ready for merge, as it uses rc-v8 versions of typescript-eslint. Just posting as a reference prior to v8 going stable.

  • Once v8 is stable, I can update this to use the released version.
  • Alternately, if you'd like these changes sooner, I can make a version of this that doesn't update to rc-v8 - it'll just have slightly fewer changes...

This PR came out of a casual conversation with @Tobbe. I'm happy to file an issue / make a more formal internal tooling request if you'd prefer. ❤️

.eslintrc.js Outdated Show resolved Hide resolved
@Tobbe Tobbe added the release:chore This PR is a chore (means nothing for users) label Jul 6, 2024
@Tobbe Tobbe added this to the next-release-major milestone Jul 6, 2024
@Tobbe Tobbe added release:breaking This PR is a breaking change and removed release:chore This PR is a chore (means nothing for users) labels Jul 6, 2024
packages/structure/src/model/RWRoute.ts Outdated Show resolved Hide resolved
packages/structure/src/model/RWTOML.ts Outdated Show resolved Hide resolved
packages/eslint-config/shared.js Show resolved Hide resolved
@Tobbe
Copy link
Member

Tobbe commented Jul 8, 2024

@JoshuaKGoldberg I like the fixes/changes to the source code that this has prompted!

Would you be up for moving those out into a separate PR that we can merge right away? This PR currently touches so many files it's highly likely a bunch of them will change while we wait for v8 to reach GA. So to not have to worry about so many potential merge conflicts I figured we could get those changes merged asap 🙂

@JoshuaKGoldberg
Copy link
Contributor Author

You got it! #10924

@Tobbe
Copy link
Member

Tobbe commented Jul 8, 2024

From 55 to 8 changed files after #10924 got merged! Nice!

// 'recommended' rules we alter
'@typescript-eslint/no-explicit-any': 'warn',
// TODO: look into enabling these eventually
'@typescript-eslint/no-empty-function': 'off',
Copy link
Member

Choose a reason for hiding this comment

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

I tried turning this on, but didn't see any errors being reported.
Same for the rule below.

Am I doing something wrong? Or was this to limit the effect of this PR on user's apps?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh shoot sorry @Tobbe, I missed this comment. It was to limit the effect of this PR on user's apps. I remember that some of these had >0 failures but didn't pay attention to which.

@Tobbe Tobbe self-assigned this Jul 9, 2024
@Josh-Walker-GM
Copy link
Collaborator

@JoshuaKGoldberg I pushed through the renovate update to get us to v8. Do you want me to get this PR back to a non conflicted state and look to get this in?

@JoshuaKGoldberg
Copy link
Contributor Author

Sure! Let me know if you run out of time, I can help too. 🙂

@Josh-Walker-GM
Copy link
Collaborator

Last time I was working on linting rules I hacked together a quick script which helps me understand the impact on a users project. A summary of what that has told me is:

  1. jsx-a11y/no-noninteractive-element-to-interactive-role is different - looks like it's default internal config is just updated - fine for us
  2. @typescript-eslint/explicit-function-return-type - used to be turned off, now it's gone
  3. @typescript-eslint/no-empty-interface - used to be turned off, now it's gone
  4. @typescript-eslint/explicit-module-boundary-types - used be turned off, now it's gone
  5. @typescript-eslint/ban-types - used to be 'warn', now it's gone. This has been replaces with a set of smaller more specific rules.
  6. no-empty-function - used be turned off, not it's gone. The ts-eslint flavour is still there and turned off still.
  7. camelcase - used to be turned off, now it's 'warn'
  8. @typescript-eslint/camelcase - used to be turned off, now it's gone
  9. no-use-before-define - used to be turned off, now it's gone
  10. @typescript-eslint/no-use-before-define - used to be turned off, now it's gone
  11. @typescript-eslint/prefer-namespace-keyword - used to be turned off, now it's 'error'
  12. unicode-bom - used to be turned off, now it's gone
  13. @typescript-eslint/adjacent-overload-signatures - used to be 'error', now it's gone
  14. @typescript-eslint/no-explicit-any - used be 'warn', now 'error'
  15. @typescript-eslint/no-inferrable-types - used to be 'error', now it's gone
  16. no-loss-of-precision - used be 'off', now 'error'
  17. @typescript-eslint/no-loss-of-precision - used be 'error', now gone
  18. @typescript-eslint/no-non-null-assertion - used be 'warn', now gone
  19. valid-typeof - used be either 'error' or 'off', now always 'error'
  20. no-unused-expressions - used be always 'error', now either 'error' or 'off'
  21. @typescript-eslint/prefer-function-type - newly added as 'off'
  22. @typescript-eslint/no-require-imports - newly added as 'off'
  23. @typescript-eslint/no-empty-object-type - newly added as 'off'
  24. unicorn/template-indent - newly added as 'off'
  25. @typescript-eslint/no-duplicate-enum-values - newly added as 'error'
  26. @typescript-eslint/no-unsafe-declaration-merging - newly added as 'error'
  27. @typescript-eslint/no-unsafe-function-type - newly added as 'error'
  28. @typescript-eslint/no-unused-expressions - newly added as 'error'
  29. @typescript-eslint/no-wrapper-object-types - newly added as 'error'
  30. no-new-native-nonconstructor - newly added as 'off'

@Josh-Walker-GM Josh-Walker-GM added changesets-ok Override the changesets check and removed changesets-ok Override the changesets check labels Aug 13, 2024
@Josh-Walker-GM
Copy link
Collaborator

Josh-Walker-GM commented Aug 13, 2024

I'm happy with those user facing changes to go out in our current v8 major release. @JoshuaKGoldberg Are you happy with this PR and I'll merge?

@JoshuaKGoldberg JoshuaKGoldberg marked this pull request as ready for review August 13, 2024 22:06
@JoshuaKGoldberg
Copy link
Contributor Author

No blockers from me!

I'll note that jsx-a11y/no-noninteractive-element-to-interactive-role isn't from typescript-eslint, just from a dependency.

@Josh-Walker-GM
Copy link
Collaborator

Josh-Walker-GM commented Aug 13, 2024

Awesome I'll look over this again and then merge it!

The little diff script just dumps all the changes in applied linting rules it finds. Thanks for confirming that though!

Copy link
Member

@Tobbe Tobbe left a comment

Choose a reason for hiding this comment

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

LGTM

@Josh-Walker-GM Josh-Walker-GM merged commit 25630e9 into redwoodjs:main Aug 13, 2024
45 checks passed
@JoshuaKGoldberg JoshuaKGoldberg deleted the typescript-eslint-stylistic-and-rc-v8 branch August 13, 2024 22:50
dac09 added a commit to dac09/redwood that referenced this pull request Aug 14, 2024
…pload-link

* 'main' of github.com:redwoodjs/redwood:
  chore(linting): Remove/fix references to non-existant files (redwoodjs#11245)
  chore(rsa): Use swc for parsing server actions (redwoodjs#11243)
  chore(lint): Remove override for 'unused-imports/no-unused-imports' (redwoodjs#11244)
  chore(linting): Separate out framework and user linting config (redwoodjs#11242)
  fix: Update default tsconfig options (target, module and moduleResolution) (redwoodjs#11170)
  chore(fixture): Update tailwind dep (redwoodjs#11241)
  chore(deps): bump fast-xml-parser from 4.4.0 to 4.4.1 (redwoodjs#11239)
  chore(rsc): Switch last remaining transform-server test to inline snapshot (redwoodjs#11240)
  chore: brought in typescript-eslint@v8 with stylistic preset (redwoodjs#10911)
  chore(deps): bump axios from 1.7.3 to 1.7.4 (redwoodjs#11237)
  docs(serverConfig): Remove server config option from TOML (redwoodjs#11236)
  fix(deps): update typescript-eslint monorepo to v8 (major) (redwoodjs#11235)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:breaking This PR is a breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants