Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

next lint command doesn't work #30062

Closed
mykhailo-motornyi-improveit opened this issue Oct 19, 2021 · 5 comments
Closed

next lint command doesn't work #30062

mykhailo-motornyi-improveit opened this issue Oct 19, 2021 · 5 comments
Labels
bug Issue was opened via the bug report template.

Comments

@mykhailo-motornyi-improveit

What version of Next.js are you using?

11.1.2

What version of Node.js are you using?

14.7.0

What browser are you using?

Chrome

What operating system are you using?

macOS, Windows

How are you deploying your application?

Vercel

Describe the Bug

When I run next lint I receive an error error - ESLint must be installed: yarn add --dev eslint.
In package.json I have eslint installed "eslint": "^8.0.1".
Also my IDE works with local eslint correctly.

package.json

"scripts": { "dev": "next dev", "build": "next build", "start": "next start", "lint": "next lint", "format": "prettier --write src/**/*.{js,jsx,ts,tsx,css,md,json} --config ./.prettierrc" },
...
"devDependencies": { "@commitlint/cli": "^13.2.1", "@commitlint/config-conventional": "^13.2.0", "autoprefixer": "^10.3.7", "eslint": "^8.0.1", "eslint-config-next": "^11.1.2", "eslint-config-prettier": "^8.3.0", "eslint-plugin-prettier": "^4.0.0", "eslint-plugin-simple-import-sort": "^7.0.0", "husky": "^7.0.2", "postcss": "^8.3.9", "prettier": "^2.4.1" }

eslint.json

{ "extends": ["next/core-web-vitals", "plugin:prettier/recommended"], "plugins": ["simple-import-sort"], "rules": { "prettier/prettier": ["error", {}, { "usePrettierrc": true }], "simple-import-sort/imports": "error", "simple-import-sort/exports": "error" } }

Without simple-import-sort plugin bug is also reproducing

Expected Behavior

ESLint should work

To Reproduce

Install next 11.1.2
Add script "lint": "next lint" to your package.json
Run "yarn lint"

@mykhailo-motornyi-improveit mykhailo-motornyi-improveit added the bug Issue was opened via the bug report template. label Oct 19, 2021
@yassh
Copy link

yassh commented Oct 19, 2021

I have encounter the same issue.

@tooshikii
Copy link

@mykhailo-motornyi-improveit
This workaround works for me #29977

@thibautsabot
Copy link
Contributor

Hello.

Eslint 8 is not supported yet.
A pull request is opened here: #29865 to address this issue.

In the meantime, you can downgrade to Eslint 7.

@housseindjirdeh
Copy link
Collaborator

@tooshikii and @thibautsabot are correct, ESLint 8 is not yet supported so please downgrade to v7 for the meantime

  • yarn remove eslint && yarn add --dev eslint@"<8.0.0"
  • npm uninstall eslint && npm install --save-dev eslint@"<8.0.0"

Closing this since it's a duplicate!

@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

No branches or pull requests

6 participants