【发布时间】:2022-02-05 09:42:16
【问题描述】:
我是 JS 的业余爱好者,使用 MacBook Pro Catalina 和 VSCode。我正在努力实现模拟和类似的运行。
我在 VSC (globally) 中启用了 ESLint,然后我完成了 ESLint 网页中概述的过程。当我查看 eslintrc.js 文件时,我看到“规则”行是空的。我以为 ESLint 规则会列在这里,但什么都没有。或者这可能是引用可选标准、airBnB 或 Google 规则的地方?我不相信 ESLint 正在工作,我可能忽略了一些东西。你能帮忙吗?附上我的 .eslintrc.js 和 package.json 文件。谢谢。
module.exports = {
"env": {
"browser": true,
"es2021": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended"
],
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"react"
],
"rules": {
}
}
{
"name": "javascript",
"version": "8.1.2",
"description": "npm for macos",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"devDependencies": {
"eslint": "^8.8.0",
"eslint-plugin-react": "^7.28.0"
},
"explorer.sortOrder":"filesFirst"
}
【问题讨论】:
标签: javascript eslint package.json eslintrc