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

[core] Update @typescript-eslint/* packages and remove deprecated eslint-config-airbnb-typescript package #45245

Merged
merged 10 commits into from
Feb 11, 2025

Conversation

ZeeshanTamboli
Copy link
Member

@ZeeshanTamboli ZeeshanTamboli commented Feb 8, 2025

Resolves #44532

Part of mui/mui-public#264

I have applied the rules from eslint-config-airbnb-typescript here.

For the record, these style rules which were applied in eslint-config-airbnb-typescript are no longer supported in @typescript-eslint/eslint-plugin and they have moved it to stylistic:

  • comma-dangle
  • brace-style
  • comma-spacing
  • func-call-spacing
  • indent
  • keyword-spacing
  • lines-between-class-members
  • no-extra-parens
  • no-extra-semi
  • space-before-blocks
  • quotes
  • semi
  • space-before-function-paren
  • space-infix-ops
  • object-curly-spacing

These should be handle by Prettier.

Questions:

  1. Should I not use eslint-config-airbnb-base and directly hardcode the rules here? The rules options will be the same.
  2. Should I use @typescript-eslint' s recommended preset?
  3. Will this affect other repos like MUI X?

@ZeeshanTamboli ZeeshanTamboli added the core Infrastructure work going on behind the scenes label Feb 8, 2025
@mui-bot
Copy link

mui-bot commented Feb 8, 2025

Netlify deploy preview

https://deploy-preview-45245--material-ui.netlify.app/

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against ed03594

@ZeeshanTamboli ZeeshanTamboli changed the title [core] Update @typescript-eslint/* packages and remove eslint-config-airbnb-typescript [core] Update @typescript-eslint/* packages and remove deprecated eslint-config-airbnb-typescript package Feb 8, 2025
args: 'after-used',
ignoreRestSiblings: true,
argsIgnorePattern: '^_',
caughtErrors: 'none',
Copy link
Member Author

@ZeeshanTamboli ZeeshanTamboli Feb 8, 2025

Choose a reason for hiding this comment

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

Override caughtErrors to none here to avoid an unused error parameter eslint error in the catch block. It's a breaking change in v8—the default is changed to all. See https://typescript-eslint.io/blog/announcing-typescript-eslint-v8/#rule-breaking-changes. So I had to override it.

@ZeeshanTamboli ZeeshanTamboli marked this pull request as ready for review February 8, 2025 09:45
@ZeeshanTamboli ZeeshanTamboli added the dependencies Update of dependencies label Feb 8, 2025
@ZeeshanTamboli ZeeshanTamboli requested a review from a team February 8, 2025 09:47
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Feb 10, 2025
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Feb 10, 2025
@Janpot
Copy link
Member

Janpot commented Feb 10, 2025

Just to get us started on properly abstracting the basic rules, can this go in its own file and use the extends feature?

diff --git a/.eslintrc.js b/.eslintrc.js
index 24f8b126a7..7b402f1b33 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -64,7 +64,7 @@ module.exports = /** @type {Config} */ ({
     'plugin:eslint-plugin-import/recommended',
     'plugin:eslint-plugin-import/typescript',
     'eslint-config-airbnb',
-    'eslint-config-airbnb-typescript',
+    './eslint/config-airbnb-typescript.js',
     'eslint-config-prettier',
   ],
   parser: '@typescript-eslint/parser',

@ZeeshanTamboli
Copy link
Member Author

Just to get us started on properly abstracting the basic rules, can this go in its own file and use the extends feature?

diff --git a/.eslintrc.js b/.eslintrc.js
index 24f8b126a7..7b402f1b33 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -64,7 +64,7 @@ module.exports = /** @type {Config} */ ({
     'plugin:eslint-plugin-import/recommended',
     'plugin:eslint-plugin-import/typescript',
     'eslint-config-airbnb',
-    'eslint-config-airbnb-typescript',
+    './eslint/config-airbnb-typescript.js',
     'eslint-config-prettier',
   ],
   parser: '@typescript-eslint/parser',

@Janpot Done.

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Feb 11, 2025
Copy link
Member

@Janpot Janpot left a comment

Choose a reason for hiding this comment

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

👍 Thanks, let's go with this for now. We'll revisit the abstractions once we move to flat config

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Feb 11, 2025
@ZeeshanTamboli ZeeshanTamboli merged commit ffb8ed9 into mui:master Feb 11, 2025
19 checks passed
@ZeeshanTamboli ZeeshanTamboli deleted the bump-typescript-eslint-to-v8 branch February 11, 2025 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Infrastructure work going on behind the scenes dependencies Update of dependencies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants