duhaime / eslint-plugin-frontmatter

Remove YAML frontmatter from `.js` files before calling ESLint
MIT License
0 stars 3 forks source link

Fix some edge cases in preprocess logic #3

Closed platinumazure closed 6 years ago

platinumazure commented 6 years ago

Added some new failing tests and fixed the code to ensure the tests pass. I also created a fixture directory to make it easier to add new cases.

platinumazure commented 6 years ago

When running an npm/yarn script, ./node_modules/.bin is temporarily inserted into your PATH at the beginning. So as long as mocha is installed locally, yarn test actually calls the local mocha, not a global one. Since you have mocha as a devDependency, everything should work just fine. :smile:

On Fri, Apr 6, 2018, 15:12 Douglas Duhaime notifications@github.com wrote:

@duhaime commented on this pull request.

@platinumazure https://github.com/platinumazure Thanks so much for this! My only question is why not call the mocha binary right from the node_modules? I prefer to avoid globally installing modules, so would rather revert to ./node_modules/mocha/bin/mocha ./tests/*.js in package.json. This reversion would also help others who prefer to avoid dependency installation at the system level. What do you think about that?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/duhaime/eslint-plugin-frontmatter/pull/3#pullrequestreview-110194430, or mute the thread https://github.com/notifications/unsubscribe-auth/AARWegvzlf57ANNeesDaWYXhx5JlNqDjks5tl8wcgaJpZM4TKY_W .

platinumazure commented 6 years ago

See https://yarnpkg.com/lang/en/docs/cli/run/ for more details.

duhaime commented 6 years ago

Ah, thanks @platinumazure I didn't know that! Thanks again for this PR!