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
Issue setting up monorepo #124
Comments
I guess we should use something like eslint-plugin-flowtype-errors/src/index.js Lines 33 to 44 in d765ab2
Or instead, just let eslint-plugin-flowtype-errors/src/index.js Lines 70 to 87 in d765ab2
The second error you mentioned ( |
I'm using ESLint@5.2.0. I've reproduced the error with a minimal setup here. Open the root git folder in Atom with default linting settings and you should be able to reproduce it as well. I've only tried with Atom - but it wouldn't surprise me if it's the same with other editors. |
When you get the error The problem probably is that something changed with eslint@5 and we don't support it yet. Edit: I can't reproduce it on the command line... |
I'm thinking out loud now. Eslint itself supports recursive .eslintrc setups. Which is why it works great in monorepos. Flow does not however support it for .flowconfig. If it did it would be simple - one single flow process would be able to handle an entire monorepo (with a quick look I guess that's how this plugin works). Would it be possible to spawn one flow process per .flowconfig instead? That's how for example Flow IDE (an Atom plugin) seems to deal with it. For example: start by looking for a .flowconfig in the root directory. If it's not found look one or two levels recursively down and start one flow process per .flowconfig. |
I think the opposite would work better: starting on the folder a file is, work up-wards with something like If we work down-wards, we would need to walk every folder or have information about your monorepo folder structure, and that means more configuration to setup... @amilajack Any ideias? |
Looking upwards from the actual file obviously sounds like a better idea @jdmota :) |
I'm using flowtype-errors in a monorepo setup, with this folder structure:
It's working great from the command line and everything else in ESLint works great in Atom as well. But for some reason flowtype-errors gets confused regarding where the flow setup is.
Without configuration I get this error:
Flow returned an error: Could not find a .flowconfig in /Users/robert/Code/MyProject or any of its parent directories. See "flow init --help" for more info (code: 12) (flowtype-errors/show-errors)
Which indicates that it's looking for a .flowconfig in the root of the monorepo.
If I add this configuration to my .eslintrc settings:
'flowtype-errors': { 'flowDir': './moduleA' },
I get this error instead, which still feels like it's confused about the directory structure:
Invalid position given by 'flowtype-errors/show-errors'. See the description for details. Click the URL to open a new issue!
I'm not sure whether it's caused by this plugin or the Atom linter. Any ideas? :)
The text was updated successfully, but these errors were encountered: