Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

[new-rule-option] [object-literal-sort-key] Add shorthand-first option #3607

Merged

Conversation

brunolemos
Copy link
Contributor

@brunolemos brunolemos commented Dec 23, 2017

Fix #3606

Similar to PR #2831 but different implementation and focused only on shorthand-first

PR checklist

Overview of change:

Is there anything you'd like reviewers to focus on?

CHANGELOG.md entry:

[new-rule-option] [object-literal-sort-key] Add shorthand-first option

@palantirtech
Copy link
Member

Thanks for your interest in palantir/tslint, @brunolemos! Before we can accept your pull request, you need to sign our contributor license agreement - just visit https://cla.palantir.com/ and follow the instructions. Once you sign, I'll automatically update this pull request.

Fix palantir#3606 (Conflict between object-shorthand-properties-first and object-literal-sort-key)
@brunolemos brunolemos force-pushed the object-literal-sort-key-shorthand-first branch from f2640a2 to 7b1223e Compare December 23, 2017 21:46
@brunolemos
Copy link
Contributor Author

@ajafff any thing I should do before merge? thanks

@ajafff ajafff merged commit 88d6a14 into palantir:master Jan 5, 2018
@ajafff
Copy link
Contributor

ajafff commented Jan 5, 2018

Thanks @brunolemos

@brunolemos
Copy link
Contributor Author

@ajafff awesome, thanks 🙌

@brunolemos
Copy link
Contributor Author

brunolemos commented Jan 6, 2018

Just tested on a real project, works great.

In case someone get here, depending on your extends you may need to add these two rules to tslint.json to avoid duplicated error report:

"object-literal-sort-keys": [true, "shorthand-first"],
"object-shorthand-properties-first": false,

brunolemos added a commit to brunolemos/tslint-config-airbnb that referenced this pull request Jan 15, 2018
…-sort-key #

`shorthand-first` is available since tslint v5.9.0.
See: palantir/tslint#3606 and palantir/tslint#3607
HyphnKnight pushed a commit to HyphnKnight/tslint that referenced this pull request Apr 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Conflict between object-shorthand-properties-first and object-literal-sort-key
4 participants