jon*_*odo 2 javascript ecmascript-6 eslint
我有我的ESLint所有设置和工作,但我希望它在我不使用ES6之类的东西时抛出错误let,const或箭头函数(=>).
{
"env": {
"node": true,
"es6": true,
"mocha": true
},
"rules": {
"semi": 2
},
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "script",
"ecmaFeatures": {
"arrowFunctions": true,
"binaryLiterals": true,
"blockBindings": true,
"classes": true
}
}
}
Run Code Online (Sandbox Code Playgroud)
目前,这不会抛出错误:
var stars = [];
var speed = 20;
function setup() {
createCanvas(windowWidth, windowHeight);
// Create 1000 stars
for (var i = 0; i < 1000; i++) {
stars.push(new Star());
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1306 次 |
| 最近记录: |