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

Add exclude to config #48

Merged
merged 3 commits into from
Sep 4, 2023
Merged

Conversation

MikeKalinowski
Copy link
Contributor

This PR partially solves issue #39 by adding option to exclude files. To fully resolve that issue, option to create paths with globs is needed.

This PR addresses three places where file paths are checked. Please take a look if I haven't missed anything. Addressed places are:

  • IDE check and cli tsc-strict use isFileStrict.ts to decide which files to check
  • cli update-strict-comments checks files at few different stages. This implementation checks them during first search for the files (index.ts -> findStrictFiles). So files that are excluded will not later go through the process of adding/removing comments.

The priority of checks according to new isFileStrict.ts will be:

  1. ts strict ignore comment
  2. ts strict comment
  3. exclude
  4. include
    To give an example, if file is both in include and exclude, it will be excluded. If it has @ts-strict and exclude, it will be included.

configExclude?: string[];
}

export function isFileExcludedByPath({
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is heavily based on check for 'paths' in isFileStrictByPath.ts, but there is a small difference in guard clause

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me know if you want me to merge them into one function

@a7madgamal
Copy link

I could really use this! I wanted to open an issue so finding a PR ready is fantastic!
how can I help or what's missing here?

@kamkry kamkry merged commit 4754a71 into allegro:master Sep 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants