-
Hey there, I was wondering if it was possible to define a preprocessor as JS object and include it directly in the ESLint config. In the Custom Processor documentation it is assumed that one has to create a separate npm module for that, which feels like a lot of extra work if one just wants to get a very small and basic processor to work. E.g. I'm looking to do something along the lines of this: // inside .eslintrc.js
const myCustomProcessor = { /* processor methods */ };
module.exports = {
parserOptions: {...},
// other stuff,
overrides: [
{
files: ["**/*.my.file.extension"],
processor: myCustomProcessor // not a string, but instead the Object defined above (or maybe in another file)
}
],
}; |
Beta Was this translation helpful? Give feedback.
Answered by
nzakas
Dec 12, 2023
Replies: 1 comment 1 reply
-
In eslintrc, the processor must be part of a plugin. There's no way around it. However, if you use the new config system, you can just provide an object as the value of |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Splines
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In eslintrc, the processor must be part of a plugin. There's no way around it.
However, if you use the new config system, you can just provide an object as the value of
processor
.