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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

markieo1
Copy link

@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
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.

1 participant