Linting #583
Linting #583
Conversation
- Linting: Add `.eslintignore` file - Linting: Use `overrides` for special treatment of config files - Linting: Remove `no-undefined` rule (not useful in strict mode and with `no-restricted-names` protecting against shadowing; while useful to use `undefined` for explicit array return) - Linting: Comment out `no-invalid-this` (not practical for jQuery) - Linting: Comment out `no-ternary` (really want to disable?) - Linting: Allow `clk_x` and `clk_y` non-camel-cased - Linting (HTML): Add self-closing tag for non-void `<option>`; add DOCTYPE; consistent/fixed quotes - Docs: Remove stray quote in CONTRIBUTING (tripping up syntax highlighting in Atom) - Refactoring/Linting: Throw `Error` object in place of "abort" string - npm: Add `lint `and `test` script - npm: Add `eslint` devDep.
- Refactoring: Avoid further `let`, bringing declaration closer to scope
Any chance you'll be able to take a look? |
Hi--I'd like to possibly make some more substantial contributions, but figure it is safer to build on a well-linted foundation. |
…dep. to earliest npm version 1.9.1 (though `package.json` started in 1.8.0)
A large PR as it fixes the linting issues per your current desired config.
Re disabling:
complexity
andmax-statements
rules, though I can undo that if you like.no-continue
, as for longer code,continue
helps prevent overly nested blocks. (Let me know if you prefer to have this rule removed.)no-ternary
as I hope you'd reconsider not enforcing this (just restricting nested ternaries), though I can re-enable that and offer fixes if you are set on that.clk_x
andclk_y
to camel-casing without introducing a breaking change, so I explicitly ignored them in the camel-case rule, but let me know if I can change..eslintignore
file (allows linting IDEs to know what should not be linted)overrides
for special treatment of config filesno-undefined
rule (not useful in strict mode and withno-restricted-names
protecting against shadowing; while useful to useundefined
for explicit array return)no-invalid-this
(not practical for jQuery)no-ternary
(really want to disable?)clk_x
andclk_y
non-camel-cased<option>
; add DOCTYPE; consistent/fixed quotesError
object in place of "abort" stringArray.isArray
, movelet
/const
closer to scopelint
andtest
scripteslint
devDep.engines
to Node 8 (forObject.values
); bump jquery dep. to earliest npm version 1.9.1 (thoughpackage.json
started in 1.8.0)If you need a build step so as to convert
const
tovar
andfor..of
for older browsers, I can look to add Babel to the build steps, though in so doing, and if it's all right, I'd like to:package.json
scripts onlyObject.values
, so for older browsers, that may need a polyfill, depending on what you wanted to do about such, e.g., to refer users tocore-js
if they need these.)Other items I might tackle if you're ok with it:
eslint-config-ash-nazg
for a very robust config (drawing together several plugins in the community).husky
, possibly withlint-staged
to avoid the need for handling installation of shell scripts in the repo (keeping it all nicely Node orpackage.json
command driven).I'm on a very slow connection atm, so not able to download PhantomJS to confirm tests are still passing, but I think if you find any issues, there really shouldn't be many (or I can explain).