Я пытаюсь установить pre-commit git hooks для проекта angular5. Я использую хаски с ворсом. Красивые и стильные линтеры работают отлично. Но когда lint-staged встречается с 'ng lint', он просто выдает ошибку:
Project '/Users/sneha.vantamuri/Documents/customerportal/aviportal-ui/src/app/components/dashboard/dashboard.component.ts' could not befound in workspace.
Error: Project '/Users/sneha.vantamuri/Documents/customerportal/aviportal-ui/src/app/components/dashboard/dashboard.component.ts' couldnot be found in workspace.
at Workspace.getProject (/Users/sneha.vantamuri/Documents/customerportal/aviportal-ui/node_modules/@angular-devkit/core/src/workspace/workspace.js:83:19)
at Architect.getBuilderConfiguration (/Users/sneha.vantamuri/Documents/customerportal/aviportal-ui/node_modules/@angular-devkit/architect/src/architect.js:96:41)
at MergeMapSubscriber._loadWorkspaceAndArchitect.pipe.operators_1.concatMap [as project] (/Users/sneha.vantamuri/Documents/customerportal/aviportal-ui/node_modules/@angular/cli/models/architect-command.js:64:55)
at MergeMapSubscriber._tryNext (/Users/sneha.vantamuri/Documents/customerportal/aviportal-ui/node_modules/@angular/cli/node_modules/rxjs/internal/operators/mergeMap.js:69:27)
at MergeMapSubscriber._next (/Users/sneha.vantamuri/Documents/customerportal/aviportal-ui/node_modules/@angular/cli/node_modules/rxjs/internal/operators/mergeMap.js:59:18)
at MergeMapSubscriber.Subscriber.next (/Users/sneha.vantamuri/Documents/customerportal/aviportal-ui/node_modules/@angular/cli/node_modules/rxjs/internal/Subscriber.js:67:18)
at TapSubscriber._next (/Users/sneha.vantamuri/Documents/customerportal/aviportal-ui/node_modules/@angular/cli/node_modules/rxjs/internal/operators/tap.js:65:26)
at TapSubscriber.Subscriber.next (/Users/sneha.vantamuri/Documents/customerportal/aviportal-ui/node_modules/@angular/cli/node_modules/rxjs/internal/Subscriber.js:67:18)
at MergeMapSubscriber.notifyNext (/Users/sneha.vantamuri/Documents/customerportal/aviportal-ui/node_modules/@angular/cli/node_modules/rxjs/internal/operators/mergeMap.js:92:26)
at InnerSubscriber._next (/Users/sneha.vantamuri/Documents/customerportal/aviportal-ui/node_modules/@angular/cli/node_modules/rxjs/internal/InnerSubscriber.js:28:21)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! avi-portal-ui@0.0.0 lint: `ng lint "/Users/sneha.vantamuri/Documents/customerportal/aviportal-ui/src/app/components/dashboard/dashboard.component.ts"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the avi-portal-ui@0.0.0 lint script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
вот моя хриплая и пошаговая конфигурация в package.json
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.{ts,scss,json}": [
"npm run prettier:check",
"npm run stylelint",
"npm run lint",
"git add"
]
}
также:
"scripts":{
"lint": "ng lint",
"prettier:check": "prettier --config ./.prettierrc --check './src/**/*.{ts,scss,json}'",
"stylelint": "stylelint \"src/**/*.scss\"",
}
"npm run runterer: check",
"npm run stylelint",
Эти 2 команды работают правильно, но npm run lint имеет ошибку