Closed timkelty closed 6 years ago
You could re-declare the lint
command, and call its previous output. We are considering doing this for the WebExtensions linting.
const { lint } = neutrino.commands;
neutrino.register('lint', (...args) => {
lint(...args);
// do your thing
});
👍 I'll try it!
So I tried your suggestion and it seemed things were getting called recursively (getting Maximum call stack size exceeded).
Could you share the code for it so I can try it out?
@eliperelman here's an example: https://github.com/timkelty/neutrino-dev/blob/stylelint-lint-command/packages/stylelint/index.js#L38-L49
I think it would be nice to figure this out for 9.x.
It seems to me that the lint
command could be renamed to eslint
, and then provide a way for multiple middlewares to hook into a shared lint
command?
Thoughts @mozilla-neutrino/core-contributors?
@timkelty Do you mean having a command category (lint
) and type (eg eslint
) whereby either just the individual type can be run, or the whole category?
@edmorley that's what I was getting at, and it might be nice, but I'm not sure how helpful it would be.
I think the most immediate clarification would be to rename the lint
command to eslint
.
After #852 this issue no longer exists, since there is no lint
command. Instead individual eslintrc
and stylelintrc
output handlers are registered by their respective presets.
Looking for advice on the best way to add a linters for additional resource types, (e.g.
stylelint
,htmllint
).@neutrinojs/eslint
registers tasks:lint
andeslintrc
.When factoring in linters for additional resource types, this can get confusing.
Should the
lint
command be renamed toeslint
? Or - is there some way to register additional calls to thelint
command?Ideally
lint
would calleslint
,stylelint
, or any other middlwares that have somehow registered lint commands.