Skip to content

Firestore: Add "max-line-length" and "ordered-imports" tslint rules. #1238

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

Merged
merged 3 commits into from
Sep 21, 2018

Conversation

mikelehen
Copy link
Contributor

This enforces a maximum line length (of 100) and import ordering via tslint rules and fixes all violations.

The line length violations were fixed manually. Prettier already targets a line length of 80 for code (but this isn't a strict limit) so mostly I just split string literals and long comments, but I did have to rename one variable to get prettier not to exceed the line length. :-/

The import ordering violations were fixed automatically via yarn lint:fix.

If it's easier, you can review the two commits separately, but there's really no overlap.

Copy link

@gsoltis gsoltis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely LGTM for the import organization stuff.

I'm less excited about the line length change than I was hoping to be. Re-wrapping comments is good. Having to split string literals and rename variables seems to me to be less obviously good. That being said, we can always // tslint:disable for cases where it makes sense, so maybe this is the right tradeoff.

@gsoltis gsoltis assigned mikelehen and unassigned gsoltis Sep 21, 2018
@mikelehen mikelehen assigned Feiyang1 and unassigned mikelehen Sep 21, 2018
@mikelehen
Copy link
Contributor Author

Fei, can you approve this for the .vscode/settings.json file (https://github.com/firebase/firebase-js-sdk/pull/1238/files#diff-5b46cfda0ddaed371f52aa24ea2b0b2a)? I don't think anybody else relies on those settings (I created the file in the first place).

@mikelehen mikelehen changed the title Add "max-line-length" and "ordered-imports" tslint rules. Firestore: Add "max-line-length" and "ordered-imports" tslint rules. Sep 21, 2018
@mikelehen mikelehen merged commit 3dd9bcf into master Sep 21, 2018
@mikelehen mikelehen deleted the mikelehen/tslint-line-length-import-order branch September 21, 2018 18:02
@firebase firebase locked and limited conversation to collaborators Oct 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants