Open jacekbogdanski opened 5 years ago
The issue is also related to https://github.com/ckeditor/ckeditor-dev/issues/3277 - although the whole refactoring makes sense from a readability perspective, so wouldn't tread this one as a fix.
ESLint is definitely the better choice than JSHint & JSCS combo, especially nowadays as ESLint became an industry standard. Additionally JSCS is discontinued. So a big 👍 from me.
We need to update docs too since grunt githooks
command will be removed https://ckeditor.com/docs/ckeditor4/latest/guide/dev_contributing_code.html.
I've made the rules a little bit more loose, changing some errors to warnings (e.g. max-length one). I've also switched off block scoped vars rules, as we have too many places created without such restriction.
ESLint automatic fixes are in #3854 – they should make the code much more elegant without breaking anything.
I've prepared ckeditor/ckeditor4-docs#287 to update docs.
Type of report
Task
Provide description of the task
Currently, we are using JSHint and JSCS as our linting tools. It would be nice to get ESLint support also, which seems to have much better TE/IDE support and have great extension mechanism for custom rules.
Additionally, JSCS has a terrible performance which slows down any Text Editor including the ones with the best performance (like Sublime, VIM, etc) when opening bigger JS files - almost freezes on
plugins/widget/plugin.js
when using live linting.Not really sure if we should totally replace current liners, although it makes sense for me to use a single tool, especially that some rules may not be available for JSHint/JSCS when moving to ESLint.
There is already some nice starting point for ESLint config file prepared by @mlewand https://github.com/mlewand/eslint-config-ckeditor4
Please, give your feedback if you also would like to see linting tool switch.