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

Update for typescript-eslint v6 #48

Merged
merged 7 commits into from
Sep 5, 2023
Merged

Update for typescript-eslint v6 #48

merged 7 commits into from
Sep 5, 2023

Conversation

jtbandes
Copy link
Member

@jtbandes jtbandes commented Jul 20, 2023

Public-Facing Changes

  • Update package version to 1.0.0 since the package has been stable for quite a while.

Breaking changes:

  • Updated peer and dev dependencies to v6 of typescript-eslint packages
  • Updated plugin:@foxglove/typescript config to be based on new strict-type-checked and stylistic-type-checked configs from upstream
    • This adds several new rules that may require disabling or fixing.
  • Deleted no-private-identifier rule (see Add prefer-hash-private rule #46)
  • Enabled prefer-hash-private by default

Description

See typescript-eslint v6 release notes: https://typescript-eslint.io/blog/announcing-typescript-eslint-v6/

  • checkCompoundAssignments: true is now the default for restrict-plus-operands
  • Switched from @typescript-eslint/recommended + @typescript-eslint/recommended-requiring-type-checking to @typescript-eslint/strict-type-checked + @typescript-eslint/stylistic-type-checked
    • prefer-nullish-coalescing and prefer-optional-chain are now on by default
  • Switched to @typescript-eslint/rule-tester for RuleTester

@jtbandes
Copy link
Member Author

Currently looking for feedback on these changes and whether the following newly enabled rules (which cause a lot of errors in Studio) should be left up to the downstream user to decide whether they want them on or off?

"@typescript-eslint/consistent-type-definitions": off
"@typescript-eslint/consistent-indexed-object-style": off
"@typescript-eslint/consistent-generic-constructors": off
"@typescript-eslint/no-confusing-void-expression": off
"@typescript-eslint/dot-notation": off
"@typescript-eslint/prefer-for-of": off
"@typescript-eslint/no-dynamic-delete": off
"@typescript-eslint/array-type": off
"@typescript-eslint/no-invalid-void-type": off
"@typescript-eslint/no-unsafe-enum-comparison": off
"@typescript-eslint/unified-signatures": off
@typescript-eslint/no-unnecessary-type-arguments
@typescript-eslint/prefer-function-type
@typescript-eslint/no-redundant-type-constituents
@typescript-eslint/no-base-to-string
@typescript-eslint/prefer-nullish-coalescing
@typescript-eslint/prefer-optional-chain (think we already had this but it catches more cases now)
@typescript-eslint/prefer-reduce-type-parameter
@typescript-eslint/no-throw-literal
@typescript-eslint/prefer-string-starts-ends-with
@typescript-eslint/non-nullable-type-assertion-style

@bryfox
Copy link

bryfox commented Jul 20, 2023

Currently looking for feedback on these changes

I'd be OK leaving these disabled: no-base-to-string and prefer-nullish-coalescing seemed to cause false positives; consistent-type-definitions, array-type, and perhaps prefer-optional-chain can (IMO) harm readability and/or IDE usability.

I would most favor re-enabling no-unsafe-enum-comparison and no-throw-literal.

For the rest, from the point of view of Console, I think they'd be straightforward to fix in a single PR if we wanted them enabled, but I wouldn't override the defaults to do so; I'd rather keep as close to Studio as possible.

@foxymiles
Copy link
Contributor

no-confusing-void-expression

no-invalid-void-type

These two seem possibly useful. The rest not so much.

@jtbandes jtbandes marked this pull request as ready for review September 2, 2023 01:47
@@ -1,6 +1,6 @@
{
"name": "@foxglove/eslint-plugin",
"version": "0.23.0",
"version": "1.0.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

what a time to be alive

Copy link

@bryfox bryfox left a comment

Choose a reason for hiding this comment

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

The override choices seem sensible to me, and from the point of view of console (https://github.com/foxglove/console/pull/3900), I'm 👍

@jtbandes jtbandes merged commit e4c9661 into main Sep 5, 2023
2 checks passed
@jtbandes jtbandes deleted the jacob/update branch September 5, 2023 16:52
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.

4 participants