How to override es-lint rules in a specific file, in a React app?

126
October 17, 2019, at 06:20 AM

I'm using some "legacy" code in my React app. Webpack throws countless "no-restricted-globals" and "no-undef" errors, and doesn't allow me to compile.

I would like to override this functionality in the specific problematic file. If not possible, i'm willing to disable those es-lint features all together.

How can it be done? I'm using an app that wasn't booted with react-create-app

Answer 1

You can tell ESLint to ignore specific files and directories by creating an .eslintignore file in your project’s root directory. The .eslintignore file is a plain text file where each line is a glob pattern indicating which paths should be omitted from linting. For example, the following will omit all JavaScript files:

**/*.js

https://eslint.org/docs/2.13.1/user-guide/configuring#ignoring-files-and-directories

Rent Charter Buses Company
READ ALSO
How do I populate dynamically a StringField with the value of a SelectField in Wtforms

How do I populate dynamically a StringField with the value of a SelectField in Wtforms

in a wtforms, I would like my SelectField to fill up with its selected value a StringFieldI use flask, bootstrap, and python 3

131
Slick Filter not filtering, just deleting all elements

Slick Filter not filtering, just deleting all elements

I'm having problems with SlickFilter function, when i hit the button that is suposed to filter, it is just deleting all elements, is not filteringI'm writing my code below

103
value of 'this' being destroyed by listener

value of 'this' being destroyed by listener

I have the following functions:

124