-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEI-6012]: Update eslint-{config|plugin}-khan to work with TypeScrip…
…t v5.7.x (#1085) ## Summary: This PR updates all `@typescript-eslint/*` packages to 8.17.0. Earlier versions of `@typescript-eslint/typescript-estree` would print a warning message when loaded. This necessitated updating `eslint-jest-plugin` which uses `@typescript-eslint/utils` which uses `@typescript-eslint/typescript-estree` internally. I also needed to update eslint-plugin-khan's test harness to use `@typescript-eslint/rule-tester` since the old harness broke after the other upgrades. The plugins themselves needed some tweaking after some of the types changed when updating `@typescript-eslint/utils`. Issue: FEI-6012 ## Test plan: - yarn lint Author: kevinb-khan Reviewers: jeresig, kevinb-khan Required Reviewers: Approved By: jeresig Checks: ✅ Test (macos-latest, 20.x), ✅ CodeQL, ✅ Lint, typecheck, and coverage check (ubuntu-latest, 20.x), ✅ Prime node_modules cache for primary configuration (ubuntu-latest, 20.x), ✅ gerald, ✅ Analyze (javascript), ⏭️ dependabot Pull Request URL: #1085
- Loading branch information
1 parent
b2fc2d0
commit 86caa2d
Showing
24 changed files
with
276 additions
and
233 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@khanacademy/eslint-config": patch | ||
"@khanacademy/eslint-plugin": patch | ||
--- | ||
|
||
Update @typescript-eslint/\* to versions that work with TypeScript v5.7.x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
packages/eslint-plugin-khan/src/rules/jest-async-use-real-timers.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
packages/eslint-plugin-khan/src/rules/jest-await-async-matchers.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
packages/eslint-plugin-khan/src/rules/react-no-method-jsx-attribute.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
packages/eslint-plugin-khan/src/rules/react-no-subscriptions-before-mount.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
packages/eslint-plugin-khan/src/rules/react-svg-path-precision.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
packages/eslint-plugin-khan/src/rules/ts-no-error-suppressions.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// We need to define our own PluginDocs type in order for us to be | ||
// able to set the `recommended` field in meta.docs when calling | ||
// `createRule`. For more info, see: | ||
// https://typescript-eslint.io/developers/custom-rules/#extra-rule-docs-types | ||
export interface MyPluginDocs { | ||
recommended: boolean; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
import {ESLintUtils} from "@typescript-eslint/utils"; | ||
import * as path from "path"; | ||
|
||
function getFixturesRootDir(): string { | ||
return path.join(__dirname, "fixtures"); | ||
} | ||
|
||
const {batchedSingleLineTests, RuleTester, noFormat} = ESLintUtils; | ||
export { | ||
RuleTester, | ||
RunTests, | ||
ValidTestCase, | ||
InvalidTestCase, | ||
} from "@typescript-eslint/utils/dist/eslint-utils/rule-tester/RuleTester"; | ||
ValidTestCase, | ||
noFormat, | ||
} from "@typescript-eslint/rule-tester"; | ||
|
||
function getFixturesRootDir(): string { | ||
return path.join(__dirname, "fixtures"); | ||
} | ||
|
||
export {batchedSingleLineTests, getFixturesRootDir, noFormat, RuleTester}; | ||
export {getFixturesRootDir}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.