Prettier: feature: read eslint config

Created on 6 Feb 2017  ·  3Comments  ·  Source: prettier/prettier

The existing config options can be inferred from an eslint config if one exists. There's an eslint js api for getting the config applied to a given file, and it follows extends and all that. It could be enabled by default or not, and overridable from the prettier args.

This allows prettier to be used without duplicating the style rules, and doesn't affect projects not using eslint.

locked-due-to-inactivity needs discussion

Most helpful comment

I believe it is better to disable all rules that overlap or conflict with prettier: https://github.com/lydell/eslint-config-prettier

All 3 comments

I believe it is better to disable all rules that overlap or conflict with prettier: https://github.com/lydell/eslint-config-prettier

Relevant (from the creator of ESLint):

I'd also strongly encourage you to avoid trying to read ESLint configuration. Our configuration system is fairly complex (on account of cascading and inheritance), and we don't have a good way to share that outside of ESLint. Also, rules and rule settings change, and you'd be left in a never-ending race to try to sync up.

https://github.com/jlongster/prettier/issues/40#issuecomment-272261328

Thanks for the link. Looks like this was already decided so closing this.

Was this page helpful?
0 / 5 - 0 ratings