Skip to content

Upgrade ESLint to 9.x #451

@slvrtrn

Description

@slvrtrn

Automatic migration from 8.x to 9.x they suggest does not work as expected. While it executes properly:

npx @eslint/migrate-config .eslintrc.json 
Need to install the following packages:
@eslint/[email protected]
Ok to proceed? (y) y


Migrating .eslintrc.json
Also importing your .eslintignore file

Wrote new config to ./eslint.config.mjs

You will need to install the following packages to use the new config:
- globals
- @eslint/js
- @eslint/eslintrc

You can install them using the following command:

npm install globals @eslint/js @eslint/eslintrc -D

The following messages were generated during migration:
- The 'node' environment is used, but the sourceType is 'module'. Using sourceType 'module'. If you want to use CommonJS modules, set the sourceType to 'commonjs'.

Not everything is moved from JSON correctly:

✗ npm run lint

> [email protected] lint
> eslint . --ext .ts

(node:551532) ESLintIgnoreWarning: The ".eslintignore" file is no longer supported. Switch to using the "ignores" property in "eslint.config.js": https://eslint.org/docs/latest/use/configure/migration-guide#ignoring-files
(Use `node --trace-warnings ...` to show where the warning was created)

Oops! Something went wrong! :(

ESLint: 9.33.0

file:///home/serge/work/clickhouse-js/eslint.config.mjs?mtime=1755171287375:4
import expectType from 'eslint-plugin-expect-type'
       ^^^^^^^^^^
SyntaxError: The requested module 'eslint-plugin-expect-type' does not provide an export named 'default'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:228:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:335:5)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:647:26)
    at async dynamicImportConfig (/home/serge/work/clickhouse-js/node_modules/eslint/lib/config/config-loader.js:186:17)
    at async loadConfigFile (/home/serge/work/clickhouse-js/node_modules/eslint/lib/config/config-loader.js:276:9)
    at async ConfigLoader.calculateConfigArray (/home/serge/work/clickhouse-js/node_modules/eslint/lib/config/config-loader.js:589:23)
    at async #calculateConfigArray (/home/serge/work/clickhouse-js/node_modules/eslint/lib/config/config-loader.js:743:23)
    at async directoryFilter (/home/serge/work/clickhouse-js/node_modules/eslint/lib/eslint/eslint-helpers.js:276:5)
    at async NodeHfs.<anonymous> (file:///home/serge/work/clickhouse-js/node_modules/@humanfs/core/src/hfs.js:586:29)
    at async NodeHfs.walk (file:///home/serge/work/clickhouse-js/node_modules/@humanfs/core/src/hfs.js:614:3)

Metadata

Metadata

Assignees

No one assigned

    Labels

    dependenciesPull requests that update a dependency fileenhancementNew feature or requesttech debt

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions