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 tsconfigRootDir definition to eslint config #15

Closed
wants to merge 1 commit into from

Conversation

shortc
Copy link

@shortc shortc commented Nov 7, 2024

On my current project I am using the epicweb eslint configuration. My main editor of choice is Helix and without tsconfigRootDir defined the following error is thrown by the vscode-eslint LSP for every tsx file that I open: Parsing error: [/complete/filepath/index.tsx] was not found by the project service. Consider either including it in the tsconfig.json or including it in allowDefaultProject

Here is the typescript-eslint doc page that I pulled this from: https://typescript-eslint.io/getting-started/typed-linting/

@shortc shortc force-pushed the tsconfig-root-dir branch 2 times, most recently from d184906 to 5790f98 Compare November 7, 2024 02:44
@@ -132,6 +132,7 @@ export const config = [
parser: (await import('typescript-eslint')).parser,
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't this resolve to ./node_modules/@epic-web/config? I don't think that's where we want to configure this root dir to 🤔

Copy link
Author

Choose a reason for hiding this comment

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

Ahh okay, I was thinking it would behave differently and resolve to the directory of my eslint.config.js since the epicweb config is spread into our flat eslint config.

After testing and editing the project's epicweb config node module eslint config file, the vscode-eslint LSP used in Helix is still happy when given /Users/[username]/[[path_to_project]/[project]/node_modules/@epic-web/config as the tsconfigDir value for some reason.

Anyways, I'll go ahead and close this PR. Sorry for wasting your time!

Copy link
Member

Choose a reason for hiding this comment

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

No worries :)

@shortc shortc closed this Nov 7, 2024
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.

2 participants