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

Use prettier settings in ts-lint #2583

Merged
merged 1 commit into from
Dec 17, 2019
Merged

Conversation

edwin0cheng
Copy link
Member

This PR add tslint-plugin-prettier extension in ts-lint, which "runs prettier rules as tslint rules." and remove quotemark from ts-lint and let prettier to handle it.

And also fix #2515

@edwin0cheng
Copy link
Member Author

edwin0cheng commented Dec 17, 2019

What happened before this PR?

We used "tslint-config-prettier" as extension of ts-lint , which basically just try to turn off all conflict tslint rules. However, it do not enable prettier rules as tslint rules. Turn out this may have some conflicts which make ts-lint overwrite prettier result in some rare cases. And that's why we need tslint-plugin-prettier in this PR and let the prettier decided which formatting rules should be used in tslint.

cc @lnicola

@lnicola
Copy link
Member

lnicola commented Dec 17, 2019

Thanks for the explanation. rust-analyzer was my first run-in with the npm ecosystem and it seems quite... complex.

Do we still need the prettier script here?

@edwin0cheng
Copy link
Member Author

edwin0cheng commented Dec 17, 2019

rust-analyzer was my first run-in with the npm ecosystem and it seems quite... complex.

This is my third projects related to npm ecosystem, and it is one of the reason why I learn rust. 😆

Do we still need the prettier script here?

Maybe, but out of this PR scope I think ?

@matklad
Copy link
Member

matklad commented Dec 17, 2019

bors r+

Yeah, npm stuff became pretty complex... One day we should try to minize the number of tools and deps on the npm side

bors bot added a commit that referenced this pull request Dec 17, 2019
2583: Use prettier settings in ts-lint r=matklad a=edwin0cheng

This PR add `tslint-plugin-prettier` extension in ts-lint, which "runs prettier rules as tslint rules." and remove  `quotemark` from ts-lint and let prettier to handle it. 

And also fix #2515

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
@bors
Copy link
Contributor

bors bot commented Dec 17, 2019

Build succeeded

  • Rust
  • TypeScript

@bors bors bot merged commit da29b7f into rust-lang:master Dec 17, 2019
@edwin0cheng edwin0cheng deleted the fix-ts-prettier branch December 18, 2019 02:35
fasterthanlime pushed a commit to fasterthanlime/rust-analyzer that referenced this pull request Nov 25, 2022
initial josh subtree sync

This demonstrates what a josh-based rustup would look like with my patched josh. To create it I did
```
git fetch http://localhost:8000/rust-lang/rust.git:start=75dd959a3a40eb5b4574f8d2e23aa6efbeb33573[:prefix=src/tools/miri]:/src/tools/miri.git master
git merge FETCH_HEAD
./rustup-toolchain HEAD && ./miri fmt
git commit -am rustup
```
Unlike the [previous attempt](rust-lang/miri#2554), this does not add a new root commit to the repo.

Once we merge this, we committed to using josh for subtree syncing, and in particular a version of josh that includes josh-project/josh#961 (or something compatible).
RalfJung pushed a commit to RalfJung/rust-analyzer that referenced this pull request Apr 20, 2024
initial josh subtree sync

This demonstrates what a josh-based rustup would look like with my patched josh. To create it I did
```
git fetch http://localhost:8000/rust-lang/rust.git:start=75dd959a3a40eb5b4574f8d2e23aa6efbeb33573[:prefix=src/tools/miri]:/src/tools/miri.git master
git merge FETCH_HEAD
./rustup-toolchain HEAD && ./miri fmt
git commit -am rustup
```
Unlike the [previous attempt](rust-lang/miri#2554), this does not add a new root commit to the repo.

Once we merge this, we committed to using josh for subtree syncing, and in particular a version of josh that includes josh-project/josh#961 (or something compatible).
RalfJung pushed a commit to RalfJung/rust-analyzer that referenced this pull request Apr 27, 2024
initial josh subtree sync

This demonstrates what a josh-based rustup would look like with my patched josh. To create it I did
```
git fetch http://localhost:8000/rust-lang/rust.git:start=75dd959a3a40eb5b4574f8d2e23aa6efbeb33573[:prefix=src/tools/miri]:/src/tools/miri.git master
git merge FETCH_HEAD
./rustup-toolchain HEAD && ./miri fmt
git commit -am rustup
```
Unlike the [previous attempt](rust-lang/miri#2554), this does not add a new root commit to the repo.

Once we merge this, we committed to using josh for subtree syncing, and in particular a version of josh that includes josh-project/josh#961 (or something compatible).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

npm run fix does not format everything
3 participants