Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

lint command, eslint and additional linters #612

Closed
timkelty opened this issue Dec 13, 2017 · 9 comments
Closed

lint command, eslint and additional linters #612

timkelty opened this issue Dec 13, 2017 · 9 comments
Labels

Comments

@timkelty
Copy link
Contributor

Looking for advice on the best way to add a linters for additional resource types, (e.g. stylelint, htmllint).

@neutrinojs/eslint registers tasks: lint and eslintrc.

When factoring in linters for additional resource types, this can get confusing.

Should the lint command be renamed to eslint?
Or - is there some way to register additional calls to the lint command?

Ideally lint would call eslint, stylelint, or any other middlwares that have somehow registered lint commands.

@eliperelman
Copy link
Member

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
});

@timkelty
Copy link
Contributor Author

👍 I'll try it!

@timkelty
Copy link
Contributor Author

So I tried your suggestion and it seemed things were getting called recursively (getting Maximum call stack size exceeded).

@eliperelman
Copy link
Member

Could you share the code for it so I can try it out?

@timkelty
Copy link
Contributor Author

@timkelty
Copy link
Contributor Author

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?

@edmorley
Copy link
Member

@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?

@timkelty
Copy link
Contributor Author

@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.

@edmorley
Copy link
Member

edmorley commented Jul 1, 2018

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.

@edmorley edmorley closed this as completed Jul 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

3 participants