You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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"
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
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"
}
}
The text was updated successfully, but these errors were encountered: