prettier / eslint-config-prettier

Turns off all rules that are unnecessary or might conflict with Prettier.
MIT License
5.34k stars 251 forks source link

New prettier update breaking Eslint plugin? #255

Closed DarpNagarsheth closed 1 year ago

DarpNagarsheth commented 1 year ago

I just created a new project to learn Next and I think "prettier": "^3.0.0" broke prettier.resolveConfig.sync.

I have an identical setup with old prettier version where everything works.

The command I ran and the error I get: PS C:\Code\Test Projects\nextjs-fireship-full-course> npm run lint

nextjs-fireship-full-course@0.1.0 lint next lint

prettier.resolveConfig.sync is not a function Occurred while linting C:\Code\Test Projects\nextjs-fireship-full-course\app\layout.tsx:1 Rule: "prettier/prettier"

My .eslintrc.json { "env": { "browser": true, "es2021": true }, "extends": ["next/core-web-vitals", "plugin:react/recommended", "plugin:prettier/recommended"], "parser": "@typescript-eslint/parser", "parserOptions": { "ecmaVersion": "latest", "sourceType": "module" }, "plugins": ["simple-import-sort", "unused-imports", "sort-exports", "react-hooks"], "rules": { "react/react-in-jsx-scope": "off", "simple-import-sort/imports": "error", "simple-import-sort/exports": "error", "no-unused-vars": "off", "unused-imports/no-unused-imports": "error", "unused-imports/no-unused-vars": [ "warn", { "vars": "all", "varsIgnorePattern": "^", "args": "after-used", "argsIgnorePattern": "^" } ], "sort-exports/sort-exports": ["error", { "sortDir": "asc" }], "react-hooks/rules-of-hooks": "error", "react-hooks/exhaustive-deps": "warn" } }

My package.json: { "name": "nextjs-fireship-full-course", "version": "0.1.0", "private": true, "scripts": { "dev": "next dev", "build": "next build", "start": "next start", "lint": "next lint" }, "dependencies": { "@types/node": "20.4.0", "@types/react": "18.2.14", "@types/react-dom": "18.2.6", "eslint": "8.44.0", "eslint-config-next": "13.4.8", "next": "13.4.8", "react": "18.2.0", "react-dom": "18.2.0", "typescript": "5.1.6" }, "devDependencies": { "eslint-config-prettier": "^8.8.0", "eslint-plugin-jest": "^27.2.2", "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-simple-import-sort": "^10.0.0", "eslint-plugin-sort-exports": "^0.8.0", "eslint-plugin-unused-imports": "^2.0.0", "prettier": "^3.0.0" } }

lydell commented 1 year ago

Hi! You seem to have posted this issue in the wrong repo. Follow along here instead: https://github.com/prettier/eslint-plugin-prettier/issues/562

(You’re not the only one: https://github.com/prettier/eslint-config-prettier/issues/254)

DarpNagarsheth commented 1 year ago

Thank you!! The alpha fixed it