Invalid options error with next lint/eslint(?)

I’ve had this project for over a year now, and doing next lint has pretty much never worked, i’m not sure why.

Although the error message is in my terminal, it is not succinct, as i’ve tried looking for what it means exactly, but i’ve failed to grasp it.

Here’s the error

> next lint

Invalid Options:
- Unknown options: useEslintrc, extensions, resolvePluginsRelativeTo, rulePaths, ignorePath, reportUnusedDisableDirectives
- 'extensions' has been removed.
- 'resolvePluginsRelativeTo' has been removed.
- 'ignorePath' has been removed.
- 'rulePaths' has been removed. Please define your rules using plugins.
- 'reportUnusedDisableDirectives' has been removed. Please use the 'overrideConfig.linterOptions.reportUnusedDisableDirectives' option instead.
 ELIFECYCLE  Command failed with exit code 1.

My best guess is this could be somewhat related to a versioning thing? I’m on next@14.1.4, eslint@9.15.0, eslint-config-next@15.3.2

Here’s what my eslintrc.json file contains:

{
  "extends": [
    "next",
    "next/core-web-vitals",
    "eslint:recommended",
    "plugin:@typescript-eslint/recommended",
    "plugin:react-hooks/recommended"
  ],
  "parser": "@typescript-eslint/parser",
  "plugins": ["@typescript-eslint", "react-hooks"],
  "root": true,
  "rules": {
    "no-unused-vars": "on",
    "@typescript-eslint/no-unused-vars": ["error"],
    "react-hooks/rules-of-hooks": "error",
    "react-hooks/exhaustive-deps": "warn"
  }
}

apparently, upgrading to the latest version of next, from “14.1.4” fixed it.

Yeah I’m pretty sure Next 14 only supports up to eslint 8, and there were a lot of changes to eslint between 8 and 9

The most important thing is to keep your next and your eslint-config-next on the same version so they stay compatible

1 Like

Sure thing, Jacob! Thanks.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.