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

Cannot disable object-literal-sort-keys when extending tslint:recommended #3772

Closed
bdc34 opened this Issue Mar 12, 2018 · 1 comment

Comments

Projects
None yet
1 participant
@bdc34
Copy link

bdc34 commented Mar 12, 2018

Bug Report

  • TSLint version: 5.9.1
  • TypeScript version: 2.7.1
  • Running TSLint via: CLI

TypeScript code being linted

export const testState = {
  "user": {
    "is_moderator": true,
    "moderated_archives": [    ],
    "username": "rrrrr",
    "is_admin": false,
    "name": "rrrrr",
    "moderated_categories": [
    ],
  },
  "num_submissions_with_actionable_proposals": 6,
  "last_queue_view": "2018-02-09 13:58 EST",
  "publish_times": {
    "submitted": "2018-02-11 20:00 EST",
    "next": "2018-02-12 20:00 EST",
  },
  "current_time": "2018-02-09 13:59 EST",
  "queue": []
}

with tslint.json configuration:

{
    "extends": ["tslint:recommended"],
    "rules": {
        "object-literal-sort-keys": false    
    }
}

Actual behavior

bdc34 @bdc34-laptop: modui-typescript$ cat tslint2.json
{
"extends": ["tslint:recommended"],
"rules": {
"object-literal-sort-keys": false
}
}bdc34 @bdc34-laptop: modui-typescript$ ./node_modules/.bin/tslint --config ./tslint2.json -p ./ | grep 'is not sorted'
ERROR: /home/bdc34/src/arxiv-submit/modui-typescript/src/model/testData.js[9, 5]: The key 'is_admin' is not sorted alphabetically
ERROR: /home/bdc34/src/arxiv-submit/modui-typescript/src/model/testData.js[24, 3]: The key 'num_submissions_with_actionable_proposals' is not sorted alphabetically
ERROR: /home/bdc34/src/arxiv-submit/modui-typescript/src/model/testData.js[28, 5]: The key 'next' is not sorted alphabetically
ERROR: /home/bdc34/src/arxiv-submit/modui-typescript/src/model/testData.js[35, 7]: The key 'doi' is not sorted alphabetically

Expected behavior

No errors for literal keys out of order.

@bdc34

This comment has been minimized.

Copy link

bdc34 commented Mar 13, 2018

Sorry, I see that I needed JsRules:

"jsRules":{
    "object-literal-sort-keys": false,
}    

@bdc34 bdc34 closed this Mar 13, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment