Better support for multiple processors
See original GitHub issueThe version of ESLint you are using. v5.8.0
The problem you want to solve.
I’m currently using two plugins to lint vue
codeblocks in markdown files – eslint-plugin-markdown and eslint-plugin-vue – and they both have processors of their own that only apply to certain file extensions: eslint-plugin-markdown and eslint-plugin-vue. The problem is that the vue processor doesn’t get applied to the Vue codeblocks in the markdown due to the file extension being md
.
Your take on the correct solution to problem. Wildcard extension support or the ability to add/mutate the effective filename of each src outputted by the preprocessor so that an extension can be appended (eg. the codeblock type).
Are you willing to submit a pull request to implement this change? Yes
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:15 (13 by maintainers)
Top GitHub Comments
This is the current interface. We cannot chain the preprocess because the input type and the output type are different. I think that the enhancement that changes the output type solves this issue.
Then we can chain the preprocess. For example:
eslint-plugin-markdown
’s processor returnseslint
checks the virtual files whether it should lint or not by the filename. (by--ext
option and input glob patterns?)eslint
gives proper processors the virtual files. Soeslint-plugin-vue
can handle the<template><div>Hello</div></template>
.Then,
eslint
gives rules the last code and filename.eslint
gives processors the result messages to postprocess those in the reversed order of the preprocessing.🎉 After today’s TSC meeting, this is now accepted based on the RFC: https://github.com/eslint/rfcs/tree/master/designs/2018-processors-improvements