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 typescript-eslint #3192

Merged
merged 4 commits into from
Dec 17, 2024
Merged

Conversation

BenoitZugmeyer
Copy link
Member

@BenoitZugmeyer BenoitZugmeyer commented Nov 29, 2024

Motivation

Keep dependencies up to date. Also, ESLint v8 is not supported anymore, so this is a first toward upgrading ESLint to v9.

Changes

See commit messages.

Testing

  • Local
  • Staging
  • Unit
  • End to end

I have gone over the contributing documentation.

We still use the ("legacy setup")[1] on purpose: we'll upgrade to a flat
config in a separate PR, when we upgrade ESLint.

[1]: https://typescript-eslint.io/getting-started/legacy-eslint-setup

Rule changes:

* @typescript-eslint/ban-types have been split in multiple rules, most
  of them are enabled by default. The configuration we used has been
  ported to @typescript-eslint/no-restricted-types

* no-throw-literal isn't needed anymore as the new rule
  @typescript-eslint/only-throw-error is covering the same thing and
  more.

* @typescript-eslint/no-var-requires was replaced with
  @typescript-eslint/no-require-imports.

* @typescript-eslint/no-unused-experessions was turned on in the
  recommended rules, but we have a few cases where we avoid using an
  `if` like `foo && bar()` that raise that error, so I disabled the rule
  for now.
* The new @typescript-eslint/only-throw-error reports quite a few (valid)
  cases where we don't throw errors. I ignored those as issues as this was
  generally what we wanted.

* Some eslint-disable comments were not needed, so I removed them

* Optional properties and arguments that also accept `undefined` now
  raise an error

* typescript-eslint is also better at finding unused variables in catch
  clauses

* And other minor things...
@BenoitZugmeyer BenoitZugmeyer requested a review from a team as a code owner November 29, 2024 18:04
@codecov-commenter
Copy link

codecov-commenter commented Nov 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.47%. Comparing base (0dfe314) to head (84744e5).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3192   +/-   ##
=======================================
  Coverage   93.47%   93.47%           
=======================================
  Files         280      280           
  Lines        7703     7705    +2     
  Branches     1727     1727           
=======================================
+ Hits         7200     7202    +2     
  Misses        503      503           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

cit-pr-commenter bot commented Dec 4, 2024

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 162.12 KiB 162.15 KiB 24 B +0.01%
Logs 55.84 KiB 55.86 KiB 24 B +0.04%
Rum Slim 110.96 KiB 110.99 KiB 24 B +0.02%
Worker 25.21 KiB 25.21 KiB 0 B 0.00%
🚀 CPU Performance
Action Name Base Average Cpu Time (ms) Local Average Cpu Time (ms) 𝚫
addglobalcontext 0.002 0.002 -0.001
addaction 0.067 0.044 -0.023
addtiming 0.001 0.001 -0.001
adderror 0.060 0.043 -0.017
startstopsessionreplayrecording 1.622 1.167 -0.455
startview 1.729 0.376 -1.353
logmessage 0.031 0.025 -0.006
🧠 Memory Performance
Action Name Base Consumption Memory (bytes) Local Consumption Memory (bytes) 𝚫 (bytes)
addglobalcontext 8.15 KiB 7.51 KiB -654 B
addaction 39.36 KiB 39.40 KiB 49 B
addtiming 7.06 KiB 7.01 KiB -52 B
adderror 44.08 KiB 44.26 KiB 184 B
startstopsessionreplayrecording 4.42 KiB 7.89 KiB 3.47 KiB
startview 419.61 KiB 427.57 KiB 7.95 KiB
logmessage 39.04 KiB 39.78 KiB 761 B

🔗 RealWorld

developer-extension/src/panel/components/tabs/infosTab.tsx Outdated Show resolved Hide resolved
@@ -52,7 +52,7 @@ describe('trackInteractionToNextPaint', () => {
setViewEnd = interactionToNextPaintTracking.setViewEnd

registerCleanupTask(() => {
interactionToNextPaintTracking.stop
interactionToNextPaintTracking.stop()
Copy link
Collaborator

Choose a reason for hiding this comment

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

👏 praise: ‏ nice catch!

@@ -22,7 +22,7 @@ export enum ExperimentalFeature {

const enabledExperimentalFeatures: Set<ExperimentalFeature> = new Set()

export function initFeatureFlags(enableExperimentalFeatures?: string[] | undefined) {
export function initFeatureFlags(enableExperimentalFeatures: string[] | undefined) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

👏 praise: ‏ Nice!

Co-authored-by: Thomas Lebeau <thomas.lebeau@datadoghq.com>
@cy-moi cy-moi requested a review from thomas-lebeau December 5, 2024 15:01
@thomas-lebeau thomas-lebeau merged commit db5520f into main Dec 17, 2024
20 checks passed
@thomas-lebeau thomas-lebeau deleted the benoit/upgrade-typescript-eslint branch December 17, 2024 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants