ESLint’s “no-undef” rule is calling my use of Underscore an undefined variable

The official documentation should give you an idea on how to fix this. Any reference to an undeclared variable causes a warning, unless the variable is explicitly mentioned in a /*global …*/ comment, or specified in the globals key in the configuration file. The easiest fix would be to add /* global _ */ at … Read more

Omit property variable when using object destructuring

A possible way is to use // eslint-disable-next-line no-unused-vars e.g. // eslint-disable-next-line no-unused-vars const { a, …rest } = initObject Or by using ignoreRestSiblings The ignoreRestSiblings option is a boolean (default: false). Using a Rest Property it is possible to “omit” properties from an object, but by default the sibling properties are marked as “unused”. … Read more

Error when deploying react app and it keeps sayings

There is a conflict in the casing C:\Users\Ruben|desktop\reactapp\test…. whereas the nodemodules is looking for C:\Users\Ruben|Desktop\Reactapp\test…. This is a windows specific problem, and previously react would have run the app regardless of this difference. Not anymore it seems. The solution I used was to locate the folder and open with code; that ensures that the path … Read more

How to avoid no-param-reassign when setting a property on a DOM object

As @Mathletics suggests, you can disable the rule entirely by adding this to your .eslintrc.json file: “rules”: { “no-param-reassign”: 0 } Or you can disable the rule specifically for param properties: “rules”: { “no-param-reassign”: [2, { “props”: false }] } Alternatively, you can disable the rule for that function: /* eslint-disable no-param-reassign */ function (el) … Read more

VSCode Linter ES6 ES7 Babel linter

How I proceed: install globally eslint : npm install -g eslint install babel-eslint : npm install –save-dev babel-eslint install eslint-plugin-react : npm install –save-dev eslint-plugin-react create .eslintrc file in you root directory. here is my config: { “env”: { “browser”: true, “node”: true, “es6”: true, “jest”: true, “jquery”: true }, “parser”: “babel-eslint”, “parserOptions”: { “ecmaVersion”: … Read more