-
Notifications
You must be signed in to change notification settings - Fork 377
Description
The npm script lint:js, used to lint JavaScript code in the Patternfly 4 packages, and defined in packages/patternfly-4, is currently broken:
"lint:js": "eslint --max-warnings 0 **/*.js",
The glob used to select files is picked up correctly in Windows environments, and running the script there results in around 1500 errors and warnings. See the attached lint output:
However, in Linux/OS X environments, this glob seems to mach no files, resulting in zero linter errors during the Travis build.
Wrapping the glob in quotes resolves this issue, and problems are reported correctly under Linux/OS X as well:
"lint:js": "eslint --max-warnings 0 \"**/*.js\"",
The ESLint docs give some more details on how to work with globs in ESLint:
Please note that when passing a glob as a parameter, it will be expanded by your shell. The results of the expansion can vary depending on your shell, and its configuration. If you want to use node glob syntax, you have to quote your parameter (using double quotes if you need it to run in Windows), as follows:
eslint "lib/**"