I am using coc-eslint on NeoVim with the following config and I am not getting proper linting on very basic error.
.eslintrc.json
{
"env": {
"browser": true,
"es2021": true
},
"extends": "eslint:recommended",
"overrides": [
],
"parserOptions": {
"ecmaVersion": "latest"
},
"rules": {
}
}
Example of errors:
var mapTargetX = Math.floor((playerY / MAP_SCALE)) * MAP_SIZE + Math.floor((playerX + playerOffsetX) / MAP_SCALE);
var mapTargetX = Math.floor((playerY + mapOffsetY) / MAP_SCALE) * MAP_SIZE + Math.floor((playerX / MAP_SCALE)); //Here I redeclare the same variable.
document.onKeyDown = function(event) { //Here I used camelcasing when I shouldn't.
... }
Solution I have tried:
- 'use strict' This doesn't seem to change anything.
- Check the errors in the dev tools console window of the browser, sadly no error.
- Added the following rule to fix the redeclare linting error :
"rules": {
"no-redeclare": "error"
}
This also didn't fix the problem.