Next.js Discord

Discord Forum

Eslint err while using src/pages/product/[product]/..

Unanswered
Orange-tailed bumble bee posted this in #help-forum
Open in Discord
Orange-tailed bumble beeOP
I have script "lint": "eslint --ignore-path .gitignore \"src/**/*.+(ts|js|tsx)\"",
and runs err
Error:   58:7  error  Insert `··`   prettier/prettier

on /home/runner/work/..../index.tsx
failed while deployment but works locally!!

22 Replies

just crate a eslint eslintrc.json and why not use Nextnext-lint
@Jesse just crate a eslint eslintrc.json and why not use Nextnext-lint
Orange-tailed bumble beeOP
I have .eslintrc but i didnt configure this project, im just working on it.
is there role to add it to allow this or as skip this error?
Instead of having a bunch of extra stuff when running ES Lint configure it to ignore certain things and only look at certain files maybe
Have you checked /home/runner/work at line 58 to see what the problem is
Also how are you getting a prettier error in production
Prettier is just for code formatting
It doesn’t affect production
@Jesse Instead of having a bunch of extra stuff when running ES Lint configure it to ignore certain things and only look at certain files maybe
Orange-tailed bumble beeOP
i might quite not following what happeing cause of eslint and prettier here, and i dont have any directory with /home/runner/work, this just happening without real issue in code
That’s really weird I’m not sure what could be happening
@Jesse That’s really weird I’m not sure what could be happening
Orange-tailed bumble beeOP
im using in .eslintrc
"extends": ["next", "next/core-web-vitals", "prettier"],
could prettier cause this errors?
yeah lol
that's definetly causing the error
Orange-tailed bumble beeOP
what could be the reason its added here?
no idea
in my config I don't have it
this is mine.
{
  "root": true,
  "parser": "@typescript-eslint/parser",
  "parserOptions": {
    "project": "./tsconfig.json"
  },
  "ignorePatterns": ["next.config.js"],
  "plugins": ["@typescript-eslint", "react", "import", "react-hooks"],
  "extends": [
    "next/core-web-vitals",
    "eslint:recommended",
    "plugin:react/recommended",
    "plugin:@typescript-eslint/eslint-recommended",
    "plugin:@typescript-eslint/recommended",
    "plugin:@next/next/recommended",
    "plugin:import/errors",
    "plugin:import/warnings",
    "plugin:import/typescript",
    "plugin:react-hooks/recommended"
  ],
  "rules": {
    "no-case-declarations": "off",
    "react/react-in-jsx-scope": "off",
    "react/no-unknown-property": "off",
    "react-hooks/exhaustive-deps": "off",
    "@typescript-eslint/no-unused-vars": "off",
    "no-console": "warn",
    "no-unused-vars": "warn",
    "react-hooks/rules-of-hooks": "warn",
    "@typescript-eslint/no-explicit-any": "warn",
    "@typescript-eslint/no-unnecessary-condition": "warn"
  }
}
Orange-tailed bumble beeOP
i found so many for prettier idk why
{ "plugins": ["prettier"], "extends": ["next", "next/core-web-vitals", "prettier"], "rules": { "prettier/prettier": "error",

"overrides": [ { "files": "**/*.+(ts|tsx)", "parser": "@typescript-eslint/parser", "plugins": ["@typescript-eslint/eslint-plugin"], "extends": ["plugin:@typescript-eslint/recommended", "prettier"],
somtimes when you add a plugin there's a bunch of stuff you need to add
did it work?
@Jesse somtimes when you add a plugin there's a bunch of stuff you need to add
Orange-tailed bumble beeOP
cant remember any thing special I'm doing to benefit from it, i will go with next-lint as u said
@Jesse tell me if works?
Orange-tailed bumble beeOP
sure, will make a meeting first for further check if not good will replace it