taskworld / eslint-plugin-local

module.exports = require('../../.eslintplugin')
MIT License
35 stars 8 forks source link

Why does it import 2 levels up, why not just ./.eslintplugin ? #1

Closed abstractpoint closed 5 years ago

abstractpoint commented 5 years ago

Wondering about this because I am running eslint in the root of my project, so it's not possible to go up 2 dirs.

dtinth commented 5 years ago

The plugin is intended to be installed inside ./node_modules/eslint-plugin-local. It uses ../.. to get back to the project root.

image

abstractpoint commented 5 years ago

Thanks for answering. I'm having an interesting issue with this failing when modules are installed in another node_modules directory outside the project. This can happen when installing globally or when using lerna tool for example.

Maybe utilising this could be better? https://www.npmjs.com/package/app-root-path I'd be happy to go a PR.

abstractpoint commented 5 years ago

Actually I realised that isn't going to solve my problem , as it still gives the module location and not the path where config is. Thanks, I will keep thinking.

dtinth commented 5 years ago

Sorry, I forgot to answer.

Zzzen commented 9 months ago

Not working with pnpm

maxime1992 commented 4 months ago

I had the same issue as @dtinth as we use a monorepo and it wasn't working. But it turns out that NX does support that very well in a testable way too and it's all well typed with typescript in case anyone else struggle on a monorepo.