Prettier + TSLint + ESLint
azdanov opened this issue · comments
I have been playing around with this idea for some time. Why? I miss some of the plugins and functionality of eslint in typescript (ay11, import, airbnb, unicorn with some other plugins and configs.)
Here's my gist with settings: https://gist.github.com/azdanov/7e74ed6ce41536b08277f4121a4f5218
And a working repo:
https://github.com/azdanov/tslint-eslint-crats
What is important:
typescript-eslint-parser
- main reason why this works.import/resolver
- helps with import statements.overrides
- make sure to run the typescript parser only on.ts
and.tsx
files.tslint.json
- modified for using prettier autofix.
Issues:
eslint --fix
not working.- https://github.com/eslint/typescript-eslint-parser#known-issues
wow... ok i would say that this is not a common usecase, but i understand why you want the eslint plugins. want to PR in a section under the Prettier + TSLint section? i dont use eslint so i can't really help unfortunately.
Sure thing. Will be sending one. 👍
I had always used eslint in my projects. But recently when i started using typescript and i ended up not using any lint tool but use typescript in strict mode.
Here is my thought: https://dev.to/gyandeeps/coding-with-typescript-prettier-and---1m1
Wanted to know your thoughts. thanks
yeah prettier + tslint is good for most people. but @azdanov has valid reasons to add in eslint plugins for his needs. happy to include it in this cheatsheet for people who may not know it is possible.
2019年官方推荐是用eslint而不是tslint了吧...https://dev.to/robertcoopercode/using-eslint-and-prettier-in-a-typescript-project-53jb