Migrate from jslint to eslint for the javascript linter #535

Closed
timabbott opened this Issue Mar 15, 2016 · 5 comments

Projects

None yet

3 participants

@timabbott
Member

jslint is pretty clearly no longer the preferred choice for javascript linter, and eslint has a pretty active plugin ecosystem which should make it easy to add new options.

Since the projects likely have different configurations by default, the way I'd want to do this project is to first replace jslint with eslint configured to check as close to the same rules as we have jslint doing (to minimize the amount of refactoring involved in switching), and then if we want to, we can incrementally improve the eslint configuration...

@timabbott timabbott added the bite size label Mar 31, 2016
@timabbott
Member

This is probably a manageable task for someone new to the project, since an initial goal would be to get eslint to check for the issues we're checking with jslint and throw no errors (I'm sure there are guides on the internet for how to do this) and then we can go from there.

@timabbott timabbott added this to the 2016 roadmap milestone Apr 29, 2016
@timabbott
Member

Just noting that @TroJan is planning to work on this.

@brainwane
Contributor

@TroJan Are you still planning to work on this? If so, please speak up here by Wednesday the 21st. If not, I'd like to suggest it to a new contributor. Thanks!

@TroJan
Contributor
TroJan commented Sep 21, 2016

@brainwane : You can assign this to a new contributor. Right now much busy at my workplace.

@timabbott timabbott modified the milestone: Zulip roadmap, Old roadmap Nov 18, 2016
@timabbott timabbott added a commit that closed this issue Nov 19, 2016
@arpith @timabbott arpith + timabbott Run eslint in tools/lint-all with npm run --silent lint
This commit adds a basic eslintrc that emulates jslint defaults.
Rules that conflict with our existing code have been switched to
warnings instead of errors. Globals have been added to the eslintrc. The
bundled js file (generated by webpack) and blueslip.js are ignored with
.eslintignore.

To display warnings, run npm run lint-loud. This runs eslint without the
--quiet option on static/js and frontend_tests.

npm run --silent lint is run by tools/lint-all (in addition to jslint).
The --silent option is used to suppress the default output from npm run.

Fixes #535.
497c770
@timabbott timabbott closed this in 497c770 Nov 19, 2016
@timabbott
Member

This was fixed via #2246. While technically the description of this issue was about replacing jslint, the actual core goal was to integrate and add eslint so that we can start configuring more advanced linter rules; we can remove jslint now at our leisure.

@brockwhittaker brockwhittaker added a commit to brockwhittaker/zulip that referenced this issue Nov 30, 2016
@arpith @brockwhittaker arpith + brockwhittaker Run eslint in tools/lint-all with npm run --silent lint
This commit adds a basic eslintrc that emulates jslint defaults.
Rules that conflict with our existing code have been switched to
warnings instead of errors. Globals have been added to the eslintrc. The
bundled js file (generated by webpack) and blueslip.js are ignored with
.eslintignore.

To display warnings, run npm run lint-loud. This runs eslint without the
--quiet option on static/js and frontend_tests.

npm run --silent lint is run by tools/lint-all (in addition to jslint).
The --silent option is used to suppress the default output from npm run.

Fixes #535.
d5a071b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment