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

build: custom lint rules not working locally #28187

Merged
merged 1 commit into from
Nov 27, 2023

Conversation

crisbeto
Copy link
Member

We have some custom lint rules that only apply to specific files. Currently the filtering is implemented by opting in specific files through a glob pattern. We do so by converting the absolute SourceFile.fileName to a relative one and checking it against the pattern.

The problem is that in some recent version either the OS or TypeScript started returning lower-cased paths in SourceFile.fileName while process.cwd() which we resolve the path against is case-sensitive. This ends up producing an invalid path which doesn't get covered by the lint rules.

These changes fix the issue by having custom rules apply to all files and using the glob pattern to exclude some of them.

We have some custom lint rules that only apply to specific files. Currently the filtering is implemented by opting in specific files through a glob pattern. We do so by converting the absolute `SourceFile.fileName` to a relative one and checking it against the pattern.

The problem is that in some recent version either the OS or TypeScript started returning lower-cased paths in `SourceFile.fileName` while `process.cwd()` which we resolve the path against is case-sensitive. This ends up producing an invalid path which doesn't get covered by the lint rules.

These changes fix the issue by having custom rules apply to all files and using the glob pattern to _exclude_ some of them.
@crisbeto crisbeto added P4 A relatively minor issue that is not relevant to core functions target: patch This PR is targeted for the next patch release labels Nov 25, 2023
@angular-robot angular-robot bot added the area: build & ci Related the build and CI infrastructure of the project label Nov 25, 2023
@crisbeto crisbeto removed the request for review from josephperrott November 27, 2023 13:15
@crisbeto crisbeto added action: merge The PR is ready for merge by the caretaker target: minor This PR is targeted for the next minor release and removed target: patch This PR is targeted for the next patch release labels Nov 27, 2023
@crisbeto crisbeto merged commit 6411dad into angular:main Nov 27, 2023
31 of 33 checks passed
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Dec 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker area: build & ci Related the build and CI infrastructure of the project P4 A relatively minor issue that is not relevant to core functions target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants