-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move away from Grunt. #21
Comments
There are some repos that only have grunt to setup the linting, so moving away from grunt would be helpful for those cases too. I'm thinking a bit more about lint-all and cases like #20 where there is a need to add support for new types of linting. I'm trying to understand the differences between lint-all if run directly through npm vs using each linter independently.
Please update and correct any of those thoughts, or add more. At the moment I'm thinking that lint-all would give us some convenience/consistency in setup, but at the trade-off of modularity and functioning within an IDE. For me, working with an IDE is a big benefit as it helps to catch errors while writing the code, instead of having to wait for linting to run after. Is there a way we can get the best of both worlds. For example ability to pull down common linters in a single step, but be able to add new ones on a per repo basis without having to update the lint-all code. Configuring through the standard lint configuration files instead of our own custom one, so that things work with linters in an IDE and providing a familiar location for modifying the configuration. Perhaps another path forward would be to work more directly with eslint and look for or make plugins that support all our linting needs through eslint itself. In that way we only need to do the configuration through eslint and can add the plugins as needed. Also configuration can be shared from a standard config like we do with eslint-config-fluid. See: eslint/eslint#13481 for updated config file coming to eslint. |
Another idea to consider is an https://github.com/wpaccessibility/create-wp-theme-auditor/ This npm capability is documented here: https://docs.npmjs.com/cli/init#description Additionally, I've found the "scripts": {
"lint:styles": "stylelint **/*.scss",
"lint:scripts": "eslint **/*.js",
"lint:markdown": "markdownlint **/*.md"
} They can be run in series with the following script if "scripts": {
"lint": "run-s lint:*"
} |
As discussed in the CSS and Sass linting pull, this ticket seems a good time to at least consider adding stylus linting. |
As @amb26 and I have frequently discussed, our reliance on Grunt for linting has created a few key pain points. For example, Grunt can only find plugins that are installed as a top-level dependency in the
node_modules
directory. Depending on how npm chooses to stash the dependencies offluid-grunt-lint-all
, downstream users may have to add a dev dependency on one or more Grunt plugins.We are also fighting other assumptions baked into Grunt. This package works around the globbing and includes/excludes used by Grunt.
A key thing to explore as an alternative is converting this package to work with
npx
, i. e. a newfluid-lint-all
package that has syntax for running all checks, running individual checks, and perhaps flags to control a few key things like which conifguration file(s) to use, whether to report failures as errors or not.This would also be a good opportunity to come up with a consistent means of configuring all plugins. Ideally we could use something like
fluid-glob
to consistently express includes and excludes without having to integrate multiple ways of expressing the same intent. We should also see if moving away from Grunt gives us better options in picking up configuration settings from configuration files like.eslintrc.json
, as we've discusssed in #16.The text was updated successfully, but these errors were encountered: