Aura linting doesn't support glob wildcard when run by an npm script
See original GitHub issueSummary
The following command works fine when entered in a terminal:
sfdx force:lightning:lint **/aura
However, the same command doesn’t pick up files when run in the context of an npm script like npm run lint:aura
. The **
glob prefix isn’t working in that context.
Steps To Reproduce:
- Clone the e-bikes sample app repo
git clone git@github.com:trailheadapps/ebikes-lwc.git
- Edit
package.json
and set thelint:aura
script tosfdx force:lightning:lint **/aura
- Install dependencies
npm install
- Run the Aura linting npm script
npm run lint:aura
Expected result
Script should run on 8 files:
'Search for "**/*.js" in folder "**/aura/"'
' -> Ignoring: **/node_modules/**,**/jsdoc/**,**/htdocs/**,**/invalidTest/**,**/purposelyInvalid/**,**/invalidTestData/**,**/validationTest/**,**/lintTest/**,**/target/**,**/parseError/**,**/*.junk.js,**/*_mock?.js'
Found 8 matching files.
Actual result
No files are linted:
'Search for "**/*.js" in folder "**/aura/"'
' -> Ignoring: **/node_modules/**,**/jsdoc/**,**/htdocs/**,**/invalidTest/**,**/purposelyInvalid/**,**/invalidTestData/**,**/validationTest/**,**/lintTest/**,**/target/**,**/parseError/**,**/*.junk.js,**/*_mock?.js'
▸ Did not find matching files.
Additional information
SFDX CLI Version: sfdx-cli/7.27.0-714f62f9c1 darwin-x64 node-v10.15.3
SFDX plugin Version
salesforcedx 47.0.7 (pre-release)
├─ force-language-services 47.0.2
└─ salesforce-alm 47.0.7
OS and version: MacOS Mojave
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
Why you should always quote your globs in NPM scripts.
NPM run-scripts don't use the shell of the user who runs the command. ... Windows command shell also doesn't support wildcard expansion.
Read more >Why same wildcards behave differently in shell and npm script?
run npm run test . But now only files like ./src/pah1/a.js are matched. I don't know why same wildcards behave differently.
Read more >npm-run-all
A CLI tool to run multiple npm-scripts in parallel or sequential. ⤴️ Motivation. Simplify. The official npm run-script command cannot run ...
Read more >Make the Most of Your DX Projects With Built-in Node.js Scripts :
In order to lint your Aura components and LWC, simply execute npm run lint . ESLint scans all of the JS files that...
Read more >Run a set of similar npm scripts with a wildcard | egghead.io
In this lesson we will run a set of scripts that are grouped together with a wildcard using the npm-run-all node package. Using...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We have this bug already filed.
@W-6746941 near the top of our backlog, we should be able to get this fixed soon.
@AdamTReineke I confirm that the issue is fixed with the current CLI version.