Top "Eslint" questions

The pluggable linting utility for JavaScript and related frameworks.

Alternative to nested ternary operator in JS

I personally love ternary operators, and in my humble opinion, they make complicated expressions very easy to digest. Take this …

javascript ternary-operator eslint
EsLint - Suppress "Do not use 'new' for side effects"

I saw the way to suppress this with jsLint, tried it, it did not work. I need the 'new' keyword …

eslint
Arrow function should not return assignment?

My code is working correctly in the app however, my eslint isn't liking it and is saying I should not …

javascript reactjs eslint
Disable eslint for all files in directory and subdirectories

I have some files that are in a certain folder and those files are from a vendor so I cannot …

eslint
How can I fix jsx-a11y/anchor-is-valid when using the Link component in React?

In a React app <Link to={`/person/${person.id}`}>Person Link</Link> results in the following …

reactjs eslint pa11y
ESLint - 'process' is not defined

I am using ESLinter for a simple node project. Below is the only code I have in index.js: const …

javascript node.js visual-studio-code eslint
ESLint "Unexpected tab character" when "indent" rule set to "tab"

I'm using ESLint with the Airbnb plugin (eslint-config-airbnb) and Babel parser. I've just added the extra rule of using Tab …

javascript indentation babeljs eslint airbnb
How to fix 'Static HTML elements with event handlers require a role.'?

My reactjs styledcomponent contains this code: <a styling="link" onClick={() => this.gotoLink()}> <SomeComponent /> </a&…

reactjs eslint styled-components prettier
Prettier + Airbnb's ESLint config

Recently, I've started using Visual Studio Code for my editor and found the Prettier - JavaScript formatter. I think it's …

javascript visual-studio eslint eslint-config-airbnb prettier
How can I use ESLint no-unused-vars for a block of code?

I need to disable some variable checks in ESLint. Currently, I am using this code, but am not getting the …

javascript eslint