Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Types are missing ignore option #2223

Closed
ChristophP opened this issue Sep 16, 2024 · 5 comments · Fixed by #2224
Closed

Types are missing ignore option #2223

ChristophP opened this issue Sep 16, 2024 · 5 comments · Fixed by #2224

Comments

@ChristophP
Copy link
Contributor

The defined types are missing the ignore options so typescript complains about it
https://github.com/remy/nodemon/blob/main/index.d.ts#L105-L118

Expected behaviour

The types should include ignore

@remy
Copy link
Owner

remy commented Sep 16, 2024

I'm not a TS dev, so won't really know, off the top of my head, how this should be done. Assume it's not covered the existing types file?

@ChristophP
Copy link
Contributor Author

Hi @remy,

Assume it's not covered the existing types file?

Exactly.
Judging from this example in the docs https://github.com/remy/nodemon/blob/master/doc/sample-nodemon.md
ignore should be an array of strings but it's missing in the types file. Which looks like this

export interface NodemonConfig {
  /* restartable defaults to "rs" as a string the user enters */
  restartable?: false | String;
  colours?: Boolean;
  execMap?: { [key: string]: string };
  ignoreRoot?: string[];
  watch?: string[];
  stdin?: boolean;
  runOnChangeOnly?: boolean;
  verbose?: boolean;
  signal?: string;
  stdout?: boolean;
  watchOptions?: WatchOptions;
}

Simply adding a line to the structure like this should do the trick

export interface NodemonConfig {
  ...
  ignore?: string[];
  ...
}

@ChristophP
Copy link
Contributor Author

Would you accept a PR for this?

@remy
Copy link
Owner

remy commented Sep 17, 2024

Happy to take a PR, or I should be able to get it up today asit looks like a single line - but you might be in a better position to test it works the way you'd expect.

@ChristophP
Copy link
Contributor Author

Sure, I added this small fix. This does the trick as TypeScript now knows about the ignore option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants