chore: upgrade eslint and typescript-eslint#6520
chore: upgrade eslint and typescript-eslint#6520schaable merged 19 commits intoNomicFoundation:v-nextfrom
Conversation
🦋 Changeset detectedLatest commit: 58adbbd The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
The eslint-config-prettier plugin was not being used, so it was removed. |
|
I saw some test tailed. let me check it. |
It looks like it's due to diverging versions of the eslint plugin. While you're at it, do you mind:
EDIT: for pinning I mean use exact versions (no ^ or ~) for eslint and its plugins to avoid version mismatches |
OK. and some eslint check failed, I need check why. |
I think i need to fix the error in eslint v9, but this will get lot of changes. So i will add commit for each package change to ease the review. or do you have any suggestions on this? |
|
@schaable Hi, I have fixed the ESLint errors. Although there were a lot of changes, they were simple. So, I only made one commit and updated the PR description. |
|
The [config-v-next] lint job failed because the config-v-next package was not in the v-next folder. I have moved the package into the v-next folder and updated the relevant references to fix this. I tried multiple times to reproduce the error from CI locally bug couldn't, which left me puzzled. After numerous tries, i finally realized it was because i hadn't clear the build cache and rebuild the code. |
|
@iosh we can ignore the EDIT: and we can probably get rid of these scripts in |
b42a8d5
ESLint from v8 to v9
resolve #5568
This PR migrates the project's ESLint setup from version 8 to version 9. This includes adopting the new flat configuration format (
eslint.config.cjs) and updating related dependencies.Key Changes:
New Configuration Package (
config) in v-next:config) to hold the shared ESLint 9 configuration.Dependency Updates:
eslint->9.25.1typescript-eslint->8.31.0eslint-plugin-import->v2.31.0eslint-plugin-no-only-tests->3.3.0Configuration File Renaming:
.eslintrc.cjstoeslint.config.cjsacross the entire workspace, including the root and individual packages.Configuration Syntax Updates (ESLint 9 Flat Config):
envwithlanguageOptions. (See ESLint Docs)@typescript-eslint/ban-typesrule with the recommended@typescript-eslint/no-wrapper-object-types. (See TS-ESLint Blog)pluginsconfiguration from an array (plugins: ["import"]) to an object format (plugins: { import: eslintPluginImport }). (See ESLint Docs)overridesconfig . (See ESLint Docs)createConfighelper function now returns an array of configuration objects (import("eslint").Linter.Config[]) instead of a single object.Workspace Package Updates:
Updated ESLint config file names (
.eslintrc.cjs->eslint.config.cjs).Removed the following dependencies from individual packages (now managed centrally in
config-v-next):@eslint-community/eslint-plugin-eslint-comments@typescript-eslint/eslint-plugin@typescript-eslint/parsereslint-import-resolver-typescripteslint-plugin-importeslint-plugin-no-only-teststypescript-eslinteslint-config-prettier(unused)I have run
pnpm eslintin each package for both the v8 and v9 configurations. When the number of errors/warnings differed,npx eslint --print-configwas used to compare the effective configurations and check the rule is same.~~ Update 2025-4-20 ~~
Instead ofpnpm eslintrunnpx eslint --rule 'no-restricted-imports: off' "src/**/*.ts" "test/**/*.ts"ignore"error 'node:test' import is restricted from being used by a pattern. Use the 'node:' prefix to import built-in Node.js modules no-restricted-imports"in the results** Update 2025-4-25: **
Fix eslint check error and warnings:
hardhat:
@typescript-eslint/switch-exhaustiveness-check: 2
Disable errors:
@typescript-eslint/no-unused-vars: 8
caughtErrorsIgnorePattern: "^_",and rename the unusederrorto_errorUnused eslint-disable directive: 5 (warnings)
hardhat-errors:
hardhat-ethers:
hardhat-ethers-chai-matchers:
errorto_errorhardhat-ignition:
hardhat-ignition-core:
v9: 8 errors, 0 warnings
import/order: 4
@typescript-eslint/strict-boolean-expressions: 1
@typescript-eslint/no-unused-vars: 1
errorto_error@typescript-eslint/switch-exhaustiveness-check: 2
hardhat-ignition-ethers:
hardhat-ignition-ui:
hardhat-ignition-viem:
Expect an errorto commentThis function return booleanto commenthardhat-keystore:
hardhat-mocha:
hardhat-network-helpers:
=== truecheckhardhat-node-test-reporter:
hardhat-node-test-runner:
hardhat-test-utils:
errorto_errorhardhat-typechain:
hardhat-utils:
v9: 6 errors, 0 warnings
@typescript-eslint/switch-exhaustiveness-check: 1
@typescript-eslint/no-unused-vars: 5
hardhat-viem:
hardhat-zod-utils:
template-package:
hardhat-toolbox-mocha-ethers
hardhat-toolbox-viem
v8: 1 errors, 0 warnings
v9: 1 errors, 0 warnings