gatsbyjs / gatsby

The best React-based framework with performance, scalability and security built in.
https://www.gatsbyjs.com
MIT License
55.22k stars 10.33k forks source link

Updating eslint to 9 causes dev server errors. #39033

Open JustFly1984 opened 2 months ago

JustFly1984 commented 2 months ago

Preliminary Checks

Description

I've tried to update eslint to 9, with new flat config.VSCode and cli works good, but then I'm trying to run dev, it fails with error. Looking at documentation, disabling eslint with empty .eslintrc doesn't help.

Error:

 ERROR #98123  WEBPACK.DEVELOP

Generating development JavaScript bundle failed

Invalid Options:
- Unknown options: extensions, rulePaths, useEslintrc
- 'extensions' has been removed.
- 'rulePaths' has been removed. Please define your rules using plugins.

failed Building development bundle - 3.210s
ERROR in Invalid Options:
- Unknown options: extensions, rulePaths, useEslintrc
- 'extensions' has been removed.
- 'rulePaths' has been removed. Please define your rules using plugins.

develop compiled with 1 error

Reproduction Link

don't have a repro

Steps to Reproduce

  1. Update eslint and plugins to latest
  2. Run migration eslintrc to mjs https://eslint.org/docs/latest/use/configure/migration-guide
  3. Run eslint in cli, to check if config is correct.
  4. Run gatsby develop - you will get an error

Expected Result

Dev server should be decoupled from eslint version. Gatsby should support eslint@9 and flat config.

Actual Result

Error:

 ERROR #98123  WEBPACK.DEVELOP

Generating development JavaScript bundle failed

Invalid Options:
- Unknown options: extensions, rulePaths, useEslintrc
- 'extensions' has been removed.
- 'rulePaths' has been removed. Please define your rules using plugins.

failed Building development bundle - 3.210s
ERROR in Invalid Options:
- Unknown options: extensions, rulePaths, useEslintrc
- 'extensions' has been removed.
- 'rulePaths' has been removed. Please define your rules using plugins.

develop compiled with 1 error

Environment

System:
    OS: macOS 14.5
    CPU: (10) arm64 Apple M1 Max
    Shell: 3.2.57 - /bin/sh
  Binaries:
    Node: 22.4.0 - /tmp/yarn--1720005845909-0.247377011876049/node
    Yarn: 1.22.22 - /tmp/yarn--1720005845909-0.247377011876049/yarn
    npm: 10.8.1 - ~/.nvm/versions/node/v22.4.0/bin/npm
  Browsers:
    Chrome: 126.0.6478.127
    Safari: 17.5
  npmPackages:
    gatsby: 5.13.6 => 5.13.6
    gatsby-link: 5.13.1 => 5.13.1
    gatsby-plugin-catch-links: 5.13.1 => 5.13.1
    gatsby-plugin-dts-css-modules: 3.0.0 => 3.0.0
    gatsby-plugin-minify-classnames: 5.0.0 => 5.0.0
    gatsby-plugin-postcss: 6.13.1 => 6.13.1
    gatsby-plugin-purgecss: 6.2.1 => 6.2.1
    gatsby-plugin-root-import: 2.0.9 => 2.0.9
    gatsby-plugin-sass: 6.13.1 => 6.13.1
    gatsby-plugin-sitemap: 6.13.1 => 6.13.1
    gatsby-plugin-typescript: 5.13.1 => 5.13.1
    gatsby-react-router-scroll: 6.13.1 => 6.13.1
    gatsby-script: 2.13.0 => 2.13.0

Config Flags

No response

Austaras commented 1 month ago

As a workaround, you can create a empty .eslintrc to disable eslint-loader. A proper fix is possible, but with the current status of gatsby, it would take some time.

JustFly1984 commented 1 month ago

I've tried the workaround, gatsby still crashes