How do you disable no-plusplus when using eslint?

Leigh Mathieson picture Leigh Mathieson · Dec 9, 2017 · Viewed 20.2k times · Source

When using eslint in Visual Studio Code, AirBnB style Ubuntu Linux, no-plusplus is enabled as default so using ++ for example in a for loop will error: [eslint] Unary operator '++' used. (no-plusplus)

How do you disable that setting?

Answer

koala picture koala · Dec 27, 2017

You can just override it in your .eslintrc.js file as follows:

'no-plusplus': 'off'

or if you don't want to disable it completely but only for for-loops:

'no-plusplus': [2, { allowForLoopAfterthoughts: true }]