digitalbazaar / eslint-config-digitalbazaar

BSD 3-Clause "New" or "Revised" License
2 stars 1 forks source link

Dissallow yoda comparisons. #35

Closed aljones15 closed 4 years ago

aljones15 commented 4 years ago

This PR requires that all comparisons are variable first, constant second i.e.

const color = 'foo';
if('red' === color) {
  // eslint does not like this
}

if(color === 'red') {
  // eslint lint likes this
}

It also includes a new dir test which contains a file we can test stuff in.

also... don't tell @davidlehn about this one. He gets kind of touchy about yoda related things.

davidlehn commented 4 years ago

Ok with this style I am. Approve this PR I do.