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

feat!: Update TypeScript Rules and Config to support ESLint v9 #338

Merged
merged 7 commits into from
Dec 9, 2024

Conversation

wakamsha
Copy link
Contributor

@wakamsha wakamsha commented Nov 29, 2024

What changed / motivation ?

  • The TypeScript ESLint plugin has been updated from v7.10.0 to v8.16.0, resulting an updated rule set.
  • The required versions of Node.js and TypeScript have been updated due to the update of typescript-eslint.

Linked PR / Issues

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Chore (routine task, maintenance, or non-functional change that doesn't modify src or test files)

Pre-flight checklist

References

@wakamsha wakamsha self-assigned this Nov 29, 2024
@wakamsha wakamsha force-pushed the feat/typescript-eslint branch from b205fbe to cf81526 Compare November 29, 2024 11:10
@wakamsha wakamsha marked this pull request as draft November 29, 2024 11:11
Comment on lines -42 to -43
'@typescript-eslint/no-throw-literal':
baseBestPracticesRules['no-throw-literal'],
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This rule has already deleted.

parser: tseslint.parser,
parserOptions: {
projectService: true,
tsconfigRootDir: process.env.TSCONFIG_ROOT_DIR ?? import.meta.dirname,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This property is necessary to automatically detect the nearest tsconfig.json.

However, it's not desirable to reference import.meta.dirname when running snapshot test, so a dummy path is assigned to process.env.TSCONFIG_ROOT_DIR only during snapshot test to prevent import.meta.dirname from being referenced.

see: @typescript-eslint/parser | typescript-eslint

Comment on lines +5 to +7
beforeAll(() => {
process.env.TSCONFIG_ROOT_DIR = '/dummy';
});
Copy link
Contributor Author

Choose a reason for hiding this comment

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

A dummy path is assigned to process.env.TSCONFIG_ROOT_DIR only during snapshot test to prevent import.meta.dirname from being referenced.

@wakamsha
Copy link
Contributor Author

This PR is frozen as a Draft PR until #339 is merged.

@wakamsha wakamsha force-pushed the feat/typescript-eslint branch from 8a6ff8e to 1d8b521 Compare December 2, 2024 02:17
@wakamsha wakamsha force-pushed the feat/typescript-eslint branch from 1d8b521 to 7dc9b7b Compare December 7, 2024 04:42
@wakamsha wakamsha marked this pull request as ready for review December 7, 2024 04:44
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This file was installed for snapshot testing, but it was found to be unnecessary so I deleted it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This file was installed for snapshot testing, but it was found to be unnecessary so I deleted it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This file was installed for snapshot testing, but it was found to be unnecessary so I deleted it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This file was installed for snapshot testing, but it was found to be unnecessary so I deleted it.

Copy link
Contributor

@tongari07 tongari07 left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM 👍

@wakamsha wakamsha merged commit b945312 into main Dec 9, 2024
2 checks passed
@wakamsha wakamsha deleted the feat/typescript-eslint branch December 9, 2024 01:38
oss-frontend-github-app bot pushed a commit that referenced this pull request Dec 10, 2024
## [5.0.0](4.1.2...5.0.0) (2024-12-10)

### ⚠ BREAKING CHANGES

* Update ESLint version requirements (#354)
* Update TypeScript Rules and Config to support ESLint v9 (#338)
* Update eslint-plugin-next version (#353)
* Update eslint-plugin-testing-library version (#351)
* Update eslint-plugin-react-hooks version (#349)
* Update eslint-plugin-jsdoc version (#346)
* Update eslint-plugin-promise version (#345)
* Update eslint-plugin-import version (#344)
* Add a ruleset powered by `unicorn` plugin into `essentials` config (#335)

### Features

* Add a ruleset powered by `unicorn` plugin into `essentials` config ([#335](#335)) ([c5a1544](c5a1544))
* Update ESLint version requirements ([#354](#354)) ([78aa086](78aa086))
* Update eslint-plugin-import version ([#344](#344)) ([37927c4](37927c4))
* Update eslint-plugin-jest version ([#342](#342)) ([5beb961](5beb961))
* Update eslint-plugin-jest-dom version ([#343](#343)) ([e803148](e803148))
* Update eslint-plugin-jsdoc version ([#346](#346)) ([9e0cf74](9e0cf74))
* Update eslint-plugin-jsx-a11y version ([#348](#348)) ([85f8fe9](85f8fe9))
* Update eslint-plugin-n version ([#347](#347)) ([3d78df4](3d78df4))
* Update eslint-plugin-next version ([#353](#353)) ([e906b76](e906b76))
* Update eslint-plugin-promise version ([#345](#345)) ([e7abb32](e7abb32))
* Update eslint-plugin-react version ([#350](#350)) ([6c8551c](6c8551c))
* Update eslint-plugin-react-hooks version ([#349](#349)) ([22f5358](22f5358))
* Update eslint-plugin-storybook version ([#352](#352)) ([2171394](2171394))
* Update eslint-plugin-testing-library version ([#351](#351)) ([ca2bcec](ca2bcec))
* Update TypeScript Rules and Config to support ESLint v9 ([#338](#338)) ([b945312](b945312))
@oss-frontend-github-app
Copy link

🎉 This PR is included in version 5.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants