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

New prettier update breaking Eslint plugin? #255

Closed
DarpNagarsheth opened this issue Jul 6, 2023 · 2 comments
Closed

New prettier update breaking Eslint plugin? #255

DarpNagarsheth opened this issue Jul 6, 2023 · 2 comments

Comments

@DarpNagarsheth
Copy link

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

[email protected] 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
Copy link
Member

lydell commented Jul 6, 2023

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

(You’re not the only one: #254)

@lydell lydell closed this as not planned Won't fix, can't repro, duplicate, stale Jul 6, 2023
@DarpNagarsheth
Copy link
Author

Thank you!! The alpha fixed it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants