【发布时间】:2020-01-16 17:51:31
【问题描述】:
我是使用 Eslint 的新手。
到目前为止,我已经在本地项目中安装了 Eslint 并进行了配置。 eslintrc.js 文件包含
module.exports = {
env: {
node: true,
commonjs: true,
es6: true,
mocha: true,
},
extends: [
'airbnb-base',
],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
parserOptions: {
ecmaVersion: 2018,
},
rules: {
},
};
在 package.json 我有
"scripts": {
"lint": "eslint .eslintrc.js --fix",
}
在终端我运行
npm run lint
输出是
> apigateway@1.0.0 lint C:\nodeprojects\restapi
> eslint .eslintrc.js --fix
C:\nodeprojects\restapi\.eslintrc.js
0:0 warning File ignored by default. Use a negated ignore pattern (like "--ignore-pattern '!<relative/path/to/filename>'") to override
但是如果我跑了
eslint <foldername> --fix 然后就可以了。
我正在使用 webstorm IDE 和 windows 操作系统。
非常感谢任何帮助。
【问题讨论】:
标签: javascript node.js eslint