Skip to content
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

Improve errors handling in config resolution #90

Closed
medikoo opened this issue Jun 1, 2017 · 3 comments
Closed

Improve errors handling in config resolution #90

medikoo opened this issue Jun 1, 2017 · 3 comments

Comments

@medikoo
Copy link
Sponsor

medikoo commented Jun 1, 2017

I'm using this in context of VSCode (via prettier-eslint-code), at some point eslint config resolution stopped working (empty config was resolved internally)

The problem lies here: src/index.js#L206-L209 Whatever error occurs during config resolution it just without backing reason states that no config could be found, and resolves with empty one.

It'll be way better if eventual errors are recognized, and are either rethrown or accurate actions are taken to errors that are understood.

In my case it appeared that some other VSCode extension crashed and it was its error that prevented proper config resolution, if package would just rethrow this error, then on my end the cause would be immediately exposed.

@kentcdodds
Copy link
Member

Ah yes! Happy to accept a pull request to make that better 👍

@interactivellama
Copy link

I'm dealing this too, makes me wonder if the quick fix is to run eslint first for code quality and let it error out if the config is bad, then run prettier-eslint.

What's the suggested behavior/API for this? It will ignore eslint and go on with prettier by itself UNLESS there is an explicit config setting? If there is an eslint config settings file and it's invalid then error out?

Just adding some details/questions.

Current lint scripts:

"lint:docs": "./node_modules/.bin/prettylint \"*.md\"",
"lint:fix": "./node_modules/.bin/prettier-eslint --write \"**/*.{js,jsx}\" && ./node_modules/.bin/prettylint \"*.json\" --fix",
"lint:quality": "./node_modules/.bin/eslint \"**/*.{js,jsx,json}\" --max-warnings=0",
"lint:style": "./node_modules/.bin/prettier-eslint --list-different \"**/*.{js,jsx}\" && ./node_modules/.bin/prettylint \"*.json\"",

interactivellama added a commit to interactivellama/design-system-react that referenced this issue Feb 14, 2018
Prettier-eslint will just run prettier and not fail if no eslint config exists (or is invalid).

prettier/prettier-eslint#90
@github-actions
Copy link
Contributor

Stale issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants