ng-lint-staged
Advanced tools
Comparing version 7.0.0 to 12.0.0
@@ -30,3 +30,3 @@ #!/usr/bin/env node | ||
// strip cwd and leading path delimiter | ||
return `--files="${path.relative(process.cwd(), file)}"`; | ||
return `--lint-file-patterns="${path.relative(process.cwd(), file)}"`; | ||
}); | ||
@@ -33,0 +33,0 @@ const npm = spawn('npm', ['run', script, '--', ...scriptArgs, ...files], { |
{ | ||
"name": "ng-lint-staged", | ||
"version": "7.0.0", | ||
"version": "12.0.0", | ||
"description": "Shim to run lint-staged with ng-lint", | ||
@@ -5,0 +5,0 @@ "bin": { |
@@ -5,12 +5,22 @@ # ng-lint-staged | ||
Angular 7 provides the `--files` CLI option to lint certain files only instead of all project files. | ||
However, since `lint-staged` provides a regular list only, a tiny argument transformation is required. | ||
Angular 7 provides the `--files` CLI option to lint certain files only instead of all project files. However, since `lint-staged` provides a regular list only, a tiny argument transformation is required. | ||
This shim provides such a transformation. | ||
Since Angular 12, the CLI option has been renamed to `--lint-file-patterns`. Use version 12 of this package for Angular versions >= 12. See the versions table below. | ||
## Package versions | ||
| Angular Version | `ng-lint-staged` version | | ||
| --------------- | ------------------------ | | ||
| `>= 7 <= 11` | `^7.0.0` | | ||
| `>= 12` | `^12.0.0` | | ||
## Installation | ||
`npm install --save-dev ng-lint-staged` | ||
## Usage | ||
**Note** that a trailing `--` is required in the call to `ng-lint-staged` to inform it about the starting point of | ||
the files list. | ||
**Note** that a trailing `--` is required in the call to `ng-lint-staged` to inform it about the starting point of the files list. | ||
@@ -20,6 +30,3 @@ ```json | ||
"lint-staged": { | ||
"src/**/*.ts": [ | ||
"ng-lint-staged lint --fix --", | ||
"git add" | ||
] | ||
"src/**/*.ts": ["ng-lint-staged lint --fix --", "git add"] | ||
} | ||
@@ -29,3 +36,2 @@ } | ||
## License | ||
@@ -35,3 +41,3 @@ | ||
Copyright (c) 2019 elunic AG/William Hefter <wh@elunic.com> | ||
Copyright (c) 2019-2021 elunic AG/William Hefter <wh@elunic.com> | ||
@@ -38,0 +44,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4916
57