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 broken require of .remarkrc.js #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

timoxley
Copy link

Currently the plugin errors if you create a '.remarkrc.js' file: Cannot find module './.remarkrc.js'
The issue is that require resolves relative to the current file, while fs.exists resolves relative to cwd. The require wasn't reading the same path as the fs.exists, instead it was trying to read the file relative to this file i.e. ./node_modules/eslint-plugin-md/lib/rules/.remarkrc.js.

Currently the plugin errors if you create a '.remarkrc.js' file: `Cannot find module './.remarkrc.js'`
The issue is that `require` resolves relative to the current file, while `fs.exists` resolves relative to cwd. The `require` wasn't reading the same path as the `fs.exists`, instead it was trying to read the file relative to this file i.e. `./node_modules/eslint-plugin-md/lib/rules/.remarkrc.js`.
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.

None yet

1 participant