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 absolute path for reading file contents #108

Merged
merged 2 commits into from
Dec 25, 2024
Merged

Conversation

markieo1
Copy link
Contributor

@markieo1 markieo1 commented Dec 13, 2024

The config generation breaks when specifiying a rootDir that is different than ..

Example code that breaks:

import vueTsEslintConfig from '@vue/eslint-config-typescript';
vueTsEslintConfig({rootDir: 'src'}) 

Output:

node:fs:441
    return binding.readFileUtf8(path, stringToFlags(options.flag));
                   ^
Uncaught:
Error: ENOENT: no such file or directory, open 'components/Foo.vue'
    at Object.readFileSync (node:fs:441:20)

This PR changes the sync to use absolute paths. This way a different rootDir can be specified without breaking.

@markieo1 markieo1 changed the title Add absolute option for finding files Add absolute path for reading file contents Dec 16, 2024
Copy link
Member

@haoqunjiang haoqunjiang left a comment

Choose a reason for hiding this comment

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

Thanks!

@haoqunjiang haoqunjiang merged commit 0d2e74a into vuejs:main Dec 25, 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