我刚刚使用创建了一个新项目
npx create-next-app@latest --ts
Run Code Online (Sandbox Code Playgroud)
当我跑步时
npm run lint
Run Code Online (Sandbox Code Playgroud)
我收到错误:
next lint 信息 - 使用 webpack 5。原因:默认启用https://nextjs.org/docs/messages/webpack5 错误 - 必须安装 ESLint:yarn add --dev eslint
但eslint已经安装了!
可能是什么?
重现步骤:
npx create-next-app@latest --ts
cd app
npm install
npm run lint
Run Code Online (Sandbox Code Playgroud)
我的package.json
{
"name": "frontend",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
"lint:css": "stylelint '**/*.{css,tsx}'",
"format": "prettier '**/*' --write --ignore-unknown",
"prepare": "husky install"
},
"dependencies": {
"next": "11.1.2",
"react": "17.0.2",
"react-dom": "17.0.2"
},
"devDependencies": {
"@stylelint/postcss-css-in-js": "^0.37.2",
"@types/react": "17.0.31",
"eslint": "^8.0.1",
"eslint-config-next": "11.1.2",
"husky": "^7.0.4",
"postcss-syntax": "^0.36.2",
"prettier": "^2.4.1",
"pretty-quick": "^3.1.1",
"stylelint": "^14.0.0",
"stylelint-config-standard": "^23.0.0",
"stylelint-config-styled-components": "^0.1.1",
"typescript": "4.4.4"
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6369 次 |
| 最近记录: |