Closed heyimalex closed 8 months ago
would love to see this merged if it passes tests. I have the same issue.
if anyone else ends up here, I ended up for now just using pnpm's built in patch
feature. another option if not using pnpm would be:
Thanks for contribution! Published with 2.3.2
Hey. My use case was to use exact file path like path/to/goodness-no/file.ts
, but looks like this change breaks it. Now exact matches doesn't work any more
@solomkinmv If you want to contribute, I think a fix would be:
const posixFilePath = getPosixFilePath(filePath);
const posixStrictPath = getPosixFilePath(absolutePathToStrictFiles);
return posixFilePath === posixStrictPath || posixFilePath.startsWith(posixStrictPath + path.posix.sep);
This breaks every file paths. So the README.md
is not accurate anymore:
{
"compilerOptions": {
...
"strict": false,
"plugins": [
{
"name": "typescript-strict-plugin",
"paths": [
"./src",
"/absolute/path/to/source/"
],
"exclude": [
"./src/tests",
"./src/fileToExclude.ts"
],
"excludePattern": [
"**/*.spec.ts"
]
}
]
}
}
Submitted a PR (https://github.com/allegro/typescript-strict-plugin/pull/86) to fix this. Thanks @heyimalex!
Noticed that
path/to/good
was matchingpath/to/goodness-no/file.ts
, so just the prefix and not the exact directory. I will maybe add tests this weekend.