One eslint plugin to rule them all
New Pattern Proposal: One eslint plugin to rule them all
Create one eslint plugin to host all of gitlab rules and config: https://eslint.org/docs/developer-guide/working-with-plugins#configs-in-plugins
Advantages of new pattern
- Easier to introduce new rules
- Less dependencies / repos to manage
- ???
Disadvantages of new pattern
- Could potentially end up with conflicts (different versions of dependencies needed by different rules)
- ???
What is the impact on our existing codebase?
We have to rename a few eslint rules (the old ones).
Reference implementation
- https://gitlab.com/gitlab-org/frontend/eslint-plugin
- What has been done: #55 (comment 294070193)
Original description
While this is not 100%-match repo for this issue, others are even worse :)
During previous FE call I've raised an idea of adding additional plugin for linting our Vue Jest tests and I have prototype for it starting with few rules:
- Raising error if
localVueused withoudlocalVue.useorlocalVue.directivecalls - Enforcing
nextTickinstead ofwrapper.vm.$nextTick() - Raising error if
syncoption pased toshallowMountormount
As my work on tests codebase progresses more (I hope) will raise.
Discussion on FE call suggested that instead of adding one more eslint plugin to merge all of them to something like eslint-plugin-gitlab.
I still think that keeping plugins separate & focused is easier to maintain, but people on the call were mostly suggesting to have one plugin. I would like to hear @mikegreiling and @ekigbo opinion, as main maintainers of our eslint heaven :)
I don't think this one should go through Frontend RFC process, since this does not affect daily frontender work, but is more like an implementation detail
If we decide to go with single plugin, I will be happy to handle merging existing things to single codebase
If no - I will be happy to create separate project (not sure if we make it very focused like eslint-plugin-vue-test-utils or a bit generic like eslint-plugin-gitlab-jest, since I'm going to suggest a few rules which are not Vue-specific
/cc @dennis @timzallmann for visibility