-
Notifications
You must be signed in to change notification settings - Fork 226
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 ESLint config and apply changes #5599
Conversation
Bumps the eslint group with 7 updates in the / directory: | Package | From | To | | --- | --- | --- | | [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) | `7.5.0` | `8.23.0` | | [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) | `7.5.0` | `8.23.0` | | [eslint](https://github.com/eslint/eslint) | `8.57.0` | `9.19.0` | | [eslint-import-resolver-typescript](https://github.com/import-js/eslint-import-resolver-typescript) | `3.6.1` | `3.7.0` | | [eslint-plugin-check-file](https://github.com/dukeluo/eslint-plugin-check-file) | `2.7.1` | `3.0.0` | | [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest) | `27.9.0` | `28.11.0` | | [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) | `48.2.2` | `50.6.3` | Updates `@typescript-eslint/eslint-plugin` from 7.5.0 to 8.23.0 - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.23.0/packages/eslint-plugin) Updates `@typescript-eslint/parser` from 7.5.0 to 8.23.0 - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.23.0/packages/parser) Updates `eslint` from 8.57.0 to 9.19.0 - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](eslint/eslint@v8.57.0...v9.19.0) Updates `eslint-import-resolver-typescript` from 3.6.1 to 3.7.0 - [Release notes](https://github.com/import-js/eslint-import-resolver-typescript/releases) - [Changelog](https://github.com/import-js/eslint-import-resolver-typescript/blob/master/CHANGELOG.md) - [Commits](import-js/eslint-import-resolver-typescript@v3.6.1...v3.7.0) Updates `eslint-plugin-check-file` from 2.7.1 to 3.0.0 - [Release notes](https://github.com/dukeluo/eslint-plugin-check-file/releases) - [Changelog](https://github.com/dukeluo/eslint-plugin-check-file/blob/main/CHANGELOG.md) - [Commits](dukeluo/eslint-plugin-check-file@v2.7.1...v3.0.0) Updates `eslint-plugin-jest` from 27.9.0 to 28.11.0 - [Release notes](https://github.com/jest-community/eslint-plugin-jest/releases) - [Changelog](https://github.com/jest-community/eslint-plugin-jest/blob/main/CHANGELOG.md) - [Commits](jest-community/eslint-plugin-jest@v27.9.0...v28.11.0) Updates `eslint-plugin-jsdoc` from 48.2.2 to 50.6.3 - [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases) - [Changelog](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/.releaserc) - [Commits](gajus/eslint-plugin-jsdoc@v48.2.2...v50.6.3) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-major dependency-group: eslint - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-major dependency-group: eslint - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-major dependency-group: eslint - dependency-name: eslint-import-resolver-typescript dependency-type: direct:development update-type: version-update:semver-minor dependency-group: eslint - dependency-name: eslint-plugin-check-file dependency-type: direct:development update-type: version-update:semver-major dependency-group: eslint - dependency-name: eslint-plugin-jest dependency-type: direct:development update-type: version-update:semver-major dependency-group: eslint - dependency-name: eslint-plugin-jsdoc dependency-type: direct:development update-type: version-update:semver-major dependency-group: eslint ... Signed-off-by: dependabot[bot] <[email protected]>
Preview URL 🚀 : https://blurts-server-pr-5599-mgjlpikfea-uk.a.run.app |
1 similar comment
Preview URL 🚀 : https://blurts-server-pr-5599-mgjlpikfea-uk.a.run.app |
9a4d79d
to
31f5a7f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments but lgtm, thanks for unblocking this eslint upgrade!
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to eslint/eslint#17726 (reply in thread) (I haven't verified further), Typescript is an available option for ESLint configuration now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only from ESLint 9.9.0
onwards, unfortunately. The dependency update PR #5590 is bumping ESLint from 8.57.0
to 9.19.0
.
@@ -67,7 +67,7 @@ test("EmailUtils.init with SMTP URL invokes nodemailer.createTransport", async ( | |||
|
|||
const result = await initEmail(testSmtpUrl); | |||
expect(mockedNodemailer.createTransport).toHaveBeenCalledWith(testSmtpUrl); | |||
// eslint-disable-next-line @typescript-eslint/unbound-method |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So nice being able to remove these!
@@ -24,7 +24,7 @@ export async function GET() { | |||
try { | |||
const flags = await getAllFeatureFlags(); | |||
return NextResponse.json(flags); | |||
} catch (e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know you didn't introduce this and I'm fine with the change as-is, but I think there's value in logging these messages so we can tell exactly what went wrong when diagnosing. I don't think that it should be returned to the caller or anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure how to tackle this, we might want a tech debt ticket to audit our existing exception handling. wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that’s a good idea — created MNTOR-4047.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh, that's fewer changes than I expected. (Probably still lot of effort though :) ) Nice work!
eslint.config.js
Outdated
project: "tsconfig.json", | ||
}, | ||
}, | ||
ignores: ["coverage", "dist", "scripts", "sentry.*.config.ts"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of scope for this PR, but in case it's super easy: scripts
is probably too broad, since it also includes our cron jobs. Could possibly be limited to src/scripts/loadtest/
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see now it did run against some of the files in there? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was confused with this at first: We had ./scripts
which has been removed completely so I also removed it from the list of ignored files here. This is the updated ignore list src/scripts and I agree that it is a bit too general. I wanted to limit the changes introduced by this PR and will address this in a follow-up.
@@ -49,7 +49,6 @@ global.TextEncoder = TextEncoder; | |||
|
|||
// Jest doesn't like the top-level await in envVars.ts, so we mock it. | |||
jest.mock("./src/envVars", () => { | |||
// eslint-disable-next-line @typescript-eslint/no-var-requires |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, from what I can see this rule has been replaced by this rule in the recommended set, which I'd expect to still trigger here. Could that indicate that we're not running ESLint on all TS files anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! Actually, the linter did complain about this line: Fixed in a43708c.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh? Hmm, then my followup question is: why don't I see any failed jobs here? Shouldn't the linter have complained about it in CI as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like it never failed on jest.setup.ts
. I’ve gone back to before the commits in this PR and checked (introduced intentional issues an ran the linter). I’m working on a follow-up to narrow down the ignored files even more and also to make sure that the linting issues in the config and setup files are blocking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Follow-up: I’ve created PR #5619 to address next lint
not running on the root files.
src/app/(proper_react)/(redesign)/(authenticated)/admin/emails/actions.tsx
Outdated
Show resolved
Hide resolved
Cleanup completed - database 'blurts-server-pr-5599' destroyed, cloud run service 'blurts-server-pr-5599' destroyed |
References:
PR #5590
Description
This PR does a couple of things:
eslint group
(PR chore(deps-dev): bump the eslint group across 1 directory with 7 updates #5590).eslintrc.json
toeslint.config.js
.git-blame-ignore-revs
which includes most of the automatically applied changes by Prettier.How to test
npm install
npm run lint