diff --git a/README.md b/README.md index 1cd061737..529449ba9 100644 --- a/README.md +++ b/README.md @@ -133,7 +133,7 @@ module.exports = { } ``` -### Example: Create your own globs +### Example: Use your own globs ```js // lintstaged.config.js @@ -146,6 +146,19 @@ module.exports = { } ``` +### Example: Use relative paths for commands + +```js +const path = require('path') +module.exports = { + '*.ts': absolutePaths => { + const cwd = process.cwd() + const relativePaths = absolutePaths.map(file => path.relative(cwd, file)) + return `ng lint myProjectName --files ${relativePaths.join(' ')}` + } +} +``` + ## What commands are supported? Supported are any executables installed locally or globally via `npm` as well as any executable from your $PATH.