-
Notifications
You must be signed in to change notification settings - Fork 58
Allow linting configs to be defined in package.json #250
Comments
Yes please! Because dev-lib provides the config files which invokes those tools anyway it does seem like overkill to run 3 differing linters for JS. If we just pick our preferred linter in |
To do this we'd need a way for our Bash script to read the |
If its a single key e.g. LINT_JS_TYPE=$(grep -m1 js_linter package.json | awk '{$1=""; print $0 }' | sed -e 's/\(^ *\)//' -e 's/[",]//g') |
Yeah, so for ESLint it would be whether or not if php -r 'exit( array_key_exists( "eslintConfig", json_decode( file_get_contents( "package.json" ), true ) ) ? 0 : 1 );'; then
eslint
fi Just tried that out and it works! So we'd just need to take that condition in addition to whether or not |
Could we just look for |
@rheinardkorf this is what we'd need to check for:
http://eslint.org/docs/user-guide/configuring#configuration-file-formats |
Currently dev-lib looks for the presence of
.eslintrc
,.jshintrc
, and other such files in order to determine whether or not it should invoke those tools. However, increasingly the configurations for these tools can be defined inpackage.json
. Therefore, dev-lib should also look at thepackage.json
to determine whether or no a linting tool should be used.The text was updated successfully, but these errors were encountered: