azz / eslint-plugin-monorepo

ESLint Plugin for monorepos
MIT License
75 stars 12 forks source link

Don't error on a non-monorepo project #2

Closed Haroenv closed 6 years ago

Haroenv commented 6 years ago
Error while loading rule 'monorepo/no-internal-import': unable to find monorepo packages
Error: Error while loading rule 'monorepo/no-internal-import': unable to find monorepo packages
    at exports.default (/Users/haroen/git/eslint-config-algolia/node_modules/eslint-plugin-monorepo/lib/get-packages.js:44:9)
    at Object.create (/Users/haroen/git/eslint-config-algolia/node_modules/eslint-plugin-monorepo/lib/rules/no-internal-import.js:32:44)
    at Object.keys.forEach.ruleId (/Users/haroen/git/eslint-config-algolia/node_modules/eslint/lib/linter.js:925:44)
    at Array.forEach (<anonymous>)
    at Linter._verifyWithoutProcessors (/Users/haroen/git/eslint-config-algolia/node_modules/eslint/lib/linter.js:865:35)
    at preprocess.map.textBlock (/Users/haroen/git/eslint-config-algolia/node_modules/eslint/lib/linter.js:994:35)
    at Array.map (<anonymous>)
    at Linter.verify (/Users/haroen/git/eslint-config-algolia/node_modules/eslint/lib/linter.js:993:42)
    at Linter.verifyAndFix (/Users/haroen/git/eslint-config-algolia/node_modules/eslint/lib/linter.js:1085:29)
    at processText (/Users/haroen/git/eslint-config-algolia/node_modules/eslint/lib/cli-engine.js:179:32)

I get this when running the linting in a project that doesn't have a monorepo because I want to put it in a sharable config. It would be nice if the plugin would just bail out in case there's no monorepo

azz commented 6 years ago

Cool. Can do.

azz commented 6 years ago

Released in https://github.com/azz/eslint-plugin-monorepo/releases/tag/v0.1.0

I'll probably bump to 1.0.0 soon, just wanted to get it in shape before guaranteeing no breaking changes.

Haroenv commented 6 years ago

Awesome