create lint:fix command and add more eslint rules#2089
Conversation
| "always" | ||
| ], | ||
| "no-undef": "off", | ||
| "no-unused-vars": "off", |
There was a problem hiding this comment.
Why do you think no-undef and no-unused-vars should be turned off?
There was a problem hiding this comment.
@dteviot This was for the sake of making fixing lint errors automatically possible. Without turning those off, the npm run lint:fix does this for me:


These things ARE all defined when the files are concatenated together into one big packed.js (or running and added with script tags to the html), but when running lint to auto fix the individual files without stitching them together, they don't exist. I believe it's possible to tell eslint which things exist.
|
Will accept as is, can decide on the lint rules later. Note, My reason for running lint was to look for potential bugs, rather than code style. The fact that we need to fix the style, I'm not entirely sure is a benefit. But is necessary to keep the warnings clean. (Yes, I could probably turn off the indentation warnings. But, well, it works well enough, can't be bothered trying to mess with it.) I'll note, we probably missed an opportunity to replace all the parserFactory.register("gravitytales.com", function() { return new GravityTalesParser() });with parserFactory.register("gravitytales.com", () => new GravityTalesParser()});As lint was reformatting them to add the missing colon. |
npm run lint:fixto make fixing what doesn't match the rules easy.This continues to help me reduce diffs with the versions of the plugin I run all the time: (https://github.com/crybx/WebToEpub/tree/dev-v2 if interested. Despite the diverging ahead/behind commit numbers, I keep cherry picking or rebasing updates from the original repo and merging the diffs is a pain, and this branch is from before I started merging with another extension 😭)