Linting, dependency management and code formatting
Closed this issue · 12 comments
Rn, the extension doesn't have any dependency management, linting or code formatting. I propose that we:
- Initialize the extension as an npm package
- Add
eslint
with theairbnb
config, to maintain code consistency - Set up a githook using
husky
to automatically lint and format code as soon as it's staged.
Add prettier
too. Not sure how well prettier
plays with husky
though. You might have to the git index stuff we did previously.
Yep we should add prettier too. I just configured husky to work with prettier and eslint. It was pretty straightforward.
@AdaephonBen, remember the git index issue we previously had? Can you make sure that isn't the case?
@TarunNoone, please let me know before you setup ESLint and more importantly, first run. There are a couple of minor Git issues that popup and I don't want you guys to be affected by them down the line.
Added Husky, ESLint Airbnb Config and Prettier. Pushed to linting_v1
branch. Pre-Commit errors have not been fixed.
ESLint and Prettier errors. There are quite a few of those.
I've fixed a few eslint errors. #19 took care of the rest. I've added firebase
and html2pdf
as NPM modules and removed the static imports. There are only 2 errors left.
We'll have to test this before merging to master, but the AIMS course registration page is not active currently. If anyone has a saved older version, please push it to the branch.
We could even have tests based on this saved copy @npalladium
We can also consider adding JQuery as an NPM module and completely dumping our /js folder. Right now, ESLint is not throwing JQuery errors since we've added it as an environment variable to our eslint config.
All ESLint errors have been resolved.
@TarunNoone Cool. Apparently, no one has a copy of the AIMS registration page, so we'll have to wait a few days for the Add/Drop period to start. We can close this issue and merge back to master then.
Initialized as npm package; Code fixed to conform to ESLint Airbnb Config; Lint-staged and Husky set up.
Good work on this, @TarunNoone