【发布时间】:2021-01-14 14:49:26
【问题描述】:
所以我正在使用 eslint 来修复我的文件格式,这是我的依赖项。
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^3.10.1",
"@typescript-eslint/parser": "^3.10.1",
"babel-eslint": "^10.1.0",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.12.0",
"eslint-plugin-flowtype": "^5.2.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-jsx-a11y": "^6.3.1",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-react": "^7.20.6",
"eslint-plugin-react-hooks": "^4.1.2",
"husky": "^4.3.0",
"lint-staged": "^10.4.0",
"prettier": "^2.1.1"
},
这是我的 lint 暂存
"lint-staged": {
"!(node_modules|build)/**/*.{js,tsx,json,css,scss,html}": [
"prettier --write",
"eslint --fix"
]
}
但是它会在我的 json 文件中抛出错误
1:1 error Expected an assignment or function call and instead saw an expression no-unused-
expressions
虽然我的 JSON 文件是这样的
{
"homeTitle": "Hello <br/> <strong>World</strong>"
}
我可以知道我的 JSON 文件有什么问题吗?
【问题讨论】:
标签: javascript node.js json eslint