Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TSLint - Disable alphabetical ordering of members

How can I disable alphabetical ordering of members in object literal syntax?

Example:

function receiveLogin(user) {
  return {
    type: LOGIN_SUCCESS,
    isFetching: false,
    isAuthenticated: true,
    id_token: user.id_token,
  };
}

I want to have the type as the first item.

like image 732
alisabzevari Avatar asked Sep 15 '16 13:09

alisabzevari


1 Answers

You should have "object-literal-sort-keys": false in your tslint.json rules.

Example:

{
  "extends": "tslint:latest",
  "rules": {
    "object-literal-sort-keys": false
  }
}
like image 165
haz111 Avatar answered Oct 01 '22 15:10

haz111