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

fix(typescript-estree): resolve path relative to tsconfigRootDir #1439

Merged
merged 6 commits into from Jan 13, 2020
Merged

fix(typescript-estree): resolve path relative to tsconfigRootDir #1439

merged 6 commits into from Jan 13, 2020

Conversation

armano2
Copy link
Member

@armano2 armano2 commented Jan 12, 2020

Regression fix introduced in #1424, extra.tsconfigRootDir was never used to resolve absolute file path

i found this when i'v tried to remove absolute paths from tests in #1002


files should be located relatively to tsconfigRootDir if provided

tsconfigRootDir

This option allows you to provide the root directory for relative tsconfig paths specified in the project option above.


This is affecting only users that was running eslint in non standard way e.g.

eslint ./some-folder/*.ts --config ./some-folder/eslint.config.js

@typescript-eslint

This comment has been minimized.

update tests to correctly provide paths
@armano2 armano2 changed the title fix(typescript-estree): tsconfigRootDir should be used for absolute path fix(typescript-estree): fix regression in path resolution Jan 13, 2020
@bradzacher bradzacher added the bug Something isn't working label Jan 13, 2020
@@ -35,7 +35,7 @@ function createProjectProgram(
const errorLines = [
'"parserOptions.project" has been set for @typescript-eslint/parser.',
`The file does not match your project config: ${path.relative(
process.cwd(),
extra.tsconfigRootDir || process.cwd(),
Copy link
Member Author

Choose a reason for hiding this comment

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

codecov complains due to this line,
tsconfigRootDir is always set if user provides it or not, with exception to empty string

@armano2 armano2 added the package: typescript-estree Issues related to @typescript-eslint/typescript-estree label Jan 13, 2020
@armano2 armano2 changed the title fix(typescript-estree): fix regression in path resolution fix(typescript-estree): fix path resolution relative to tsconfigRootDir Jan 13, 2020
@armano2 armano2 self-assigned this Jan 13, 2020
Copy link
Member

@bradzacher bradzacher left a comment

Choose a reason for hiding this comment

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

LGTM - thanks for this.

@bradzacher bradzacher changed the title fix(typescript-estree): fix path resolution relative to tsconfigRootDir fix(typescript-estree): resolve path relative to tsconfigRootDir Jan 13, 2020
@bradzacher bradzacher merged commit c709056 into typescript-eslint:master Jan 13, 2020
@armano2 armano2 deleted the tsconfig-root branch January 13, 2020 04:01
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working package: typescript-estree Issues related to @typescript-eslint/typescript-estree
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants