Open swashata opened 6 years ago
Right now with the space-unary-ops settings, unary words like yield throw error saying
space-unary-ops
yield
file: 'file:///Volumes/Development/vagrant/www/es6/public_html/wesbos-js-es6/16%20-%20Generators/indes.js' severity: 'Error' message: 'Unexpected space after unary word operator 'yield'. (space-unary-ops)' at: '2,2' source: 'eslint' code: 'space-unary-ops'
Example code:
function* listPeople() { yield 'Swas'; yield 'Sonali'; const myArray = new Array( 1, 2, 3 ); }
Strangely, it doesn't throw error for line 4 with const myArray = new Array( 1, 2, 3 );.
const myArray = new Array( 1, 2, 3 );
Overriding the space-unary-ops rule like this
"space-unary-ops": [ 'error', { "words": true, "nonwords": false, "overrides": { "!": true } } ]
does solve the problem. Should we go ahead and implement that?
Right now with the
space-unary-ops
settings, unary words likeyield
throw error sayingExample code:
Strangely, it doesn't throw error for line 4 with
const myArray = new Array( 1, 2, 3 );
.Overriding the
space-unary-ops
rule like thisdoes solve the problem. Should we go ahead and implement that?