Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Don't overwrite parser if provided by user
Bug Repro Gist: https://gist.github.com/bradzacher/07d98abce83ed5a4094ccbfacca8b82f prettier-eslint overrides the parser with its own parser if it detects it's running on a typescript file. This was generally okay, because there was very little difference between the parser versions (though there may have been subtle bugs that users didn't notice). I was testing a config with the current `1.0.0-rc.2` of `eslint-plugin-typescript`, and noticed that it wasn't fixing an error I know has a fixer. When I ran `eslint --fix` manually, it worked fine. After a lot of digging, I finally setup the repro case and noticed that the config passed into eslint included prettier-eslint's local dependency, instead of eslint-plugin-typescript's. This matters now for two reasons: 1) As of eslint-plugin-typescript 1.0.0 ([1.0.0 release notes](https://github.com/bradzacher/eslint-plugin-typescript/releases/tag/1.0.0-rc.0)), we've moved the parser internally so we can better manage the dependency (too many bugs reported from people using an unsupported version of the parser). 2) The parser recently released a number of very breaking changes (I think it was the v20 release). This change fixes this by allowing the user specified parser to be used. While I haven't tested, I suspect that prettier-eslint might break if used on typescript vue files (if it even works with it?? I don't use vue...) eslint-plugin-vue uses its own parser as well, which would be clobbered by this setting.
- Loading branch information