cheminfo-js / spectra-data

Library to deal with spectra (IR, UV, ...), 1D NMR as well as 2D NMR
https://cheminfo-js.github.io/spectra-data
MIT License
4 stars 0 forks source link

eslint #54

Closed andcastillo closed 7 years ago

andcastillo commented 7 years ago

@stropitek why the automatic eslint fix produce these extra whites in before and after the curly? Is it the expected format?

if (sub % 2 === 0)                            {
   outString += '(X++(R..R)), XYDATA' + CRLF;
}                                                  else                                   {
                        outString += '(X++(I..I)), XYDATA' + CRLF;
}
maasencioh commented 7 years ago

that's the fix that the do, and there's no eslint rule to avoid that many spaces, so currently I'm only able to fix if by hand

targos commented 7 years ago

If that's what they do I think you should open an issue in the ESLint project (look if there is already one) because this fix violates our indentation rule

maasencioh commented 7 years ago

@targos but that's not related with identation, that's the problem, that currently there's no rule to caught this issue (as far as I know)

targos commented 7 years ago

The line 4 of this example has an indentation problem.

targos commented 7 years ago

If that appeared with ESLint-fix then it's a bug with ESLint because fixes are not supposed to introduce errors with other rules

targos commented 7 years ago

I'd like to see the original code before you run ESLint-fix

maasencioh commented 7 years ago

it's the same but without the braces

targos commented 7 years ago

There is a rule. It's called no-multi-spaces, it is auto-fixable and I added it to our common configuration.

targos commented 7 years ago

BTW the full list of ESLint rules is available here: http://eslint.org/docs/rules/ If you realize that we should add or change one of them, please open an issue in our custom config repo: https://github.com/cheminfo/eslint-config