leo-buneev / eslint-plugin-md

Allows you to lint markdown code in your *.md files.
16 stars 5 forks source link

Fix broken require of .remarkrc.js #10

Open timoxley opened 3 years ago

timoxley commented 3 years ago

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.