老师,我添加 .eslintrc.js 文件,并配置后,在index.js 写代码并不会提示
来源:5-2 项目初始化 02--ESlint

灰鸽1号
2018-01-10
.eslintrc.js:
module.exports = { "extends": ["eslint:recommended"], "rules": { "no-console": ["error", { "allow": ["warn", "error", "info"] }] }, "parser": "babel-eslint", "parserOptions": { "ecmaVersion": 6, "sourceType": "script" }, "globals": { }, "env": { "node": true, "es6": true, "mocha": true } };
/src/index.js:
console.log("ok");
然而并木有提醒?
是什么缘故呢? 配置后是不是还要启动什么?
写回答
2回答
-
Samaritan
2018-01-14
你配置 allow 了,那就是允许的意思,所以不报错,删了 "allow": ["warn", "error", "info"] 试试
012018-12-01 -
灰鸽1号
提问者
2018-01-11
问题找到了,需要全局不在本地环境安装eslint:
npm install -g babel-eslint
012018-12-08
相似问题