Skip to content

Commit

Permalink
rename flag ignored->ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
romanlamsal committed Oct 6, 2022
1 parent bd0927b commit c5eb83d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -99,9 +99,9 @@ All imported files are watched except from the following directories:

#### Ignore files from being watched

If you wish to exclude files from being watched, you can pass `--ignored` multiple times:
If you wish to exclude files from being watched, you can pass `--ignore` multiple times:
```sh
tsx watch --ignored ./ignore-me.js --ignored ./ignore-me-too.js ./file.ts
tsx watch --ignore ./ignore-me.js --ignore ./ignore-me-too.js ./file.ts
```

This flag is passed to [chokidar](https://github.com/paulmillr/chokidar) thus glob patterns also work here.
Expand Down
6 changes: 3 additions & 3 deletions src/watch/index.ts
Expand Up @@ -27,7 +27,7 @@ const flags = {
description: 'Clearing the screen on rerun',
default: true,
},
ignored: {
ignore: {
type: [String],
description: 'Paths & globs to exclude from being watched',
default: [],
Expand All @@ -52,7 +52,7 @@ export const watchCommand = command({
noCache: argv.flags.noCache,
tsconfigPath: argv.flags.tsconfig,
clearScreen: argv.flags.clearScreen,
ignored: argv.flags.ignored,
ignore: argv.flags.ignore,
ipc: true,
};

Expand Down Expand Up @@ -130,7 +130,7 @@ export const watchCommand = command({
// Distribution files
'**/dist/**',

...options.ignored,
...options.ignore,
],
ignorePermissionErrors: true,
},
Expand Down
4 changes: 2 additions & 2 deletions tests/specs/watch.ts
Expand Up @@ -164,8 +164,8 @@ export default testSuite(async ({ describe }, fixturePath: string) => {
args: [
'watch',
'--clear-screen=false',
`--ignored=${path.join(fixtures.path, ignoredFilenames[0])}`,
`--ignored=${path.join(fixtures.path, ignoredFilenames[1])}`,
`--ignore=${path.join(fixtures.path, ignoredFilenames[0])}`,
`--ignore=${path.join(fixtures.path, ignoredFilenames[1])}`,
path.join(fixtures.path, includedFilename),
],
});
Expand Down

0 comments on commit c5eb83d

Please sign in to comment.