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

object-literal-sort-keys doesn't flag errors on Windows starting in version 5.8.0 #3426

Closed
interpfister opened this issue Oct 31, 2017 · 2 comments · Fixed by #3427
Closed

Comments

@interpfister
Copy link

interpfister commented Oct 31, 2017

Bug Report

  • TSLint version: 5.8.0
  • TypeScript version:2.5.3
  • Running TSLint via: CLI and VSCode

TypeScript code being linted

  const key = {
    accountType: '3B',
    uid: '456',
    isEditable: true,
  };

with tslint.json configuration:

{ "object-literal-sort-keys": true }

Actual behavior

No error

Expected behavior

The key 'isEditable' is not sorted alphabetically

Downgrading to version 5.7.0 fixes the issue. This code succeeds on a Mac with 5.8.0. It's possible there's something else at play besides Mac vs. Windows here but that's the only difference we've been able to find. Sticking with 5.7.0 for now.

@interpfister interpfister changed the title object-literal-sort-keys doesn't work on Windows starting in version 5.8.0 object-literal-sort-keys doesn't flag errors on Windows starting in version 5.8.0 Oct 31, 2017
@ajafff
Copy link
Contributor

ajafff commented Oct 31, 2017

#3191 added the ability to group your properties by a blank line.
This probably introduced a bug where \r\n is treated as two line breaks on windows.

@ajafff
Copy link
Contributor

ajafff commented Oct 31, 2017

#3427 will fix this

adidahiya pushed a commit that referenced this issue Oct 31, 2017
[bugfix] `object-literal-sort-keys` fixed regression that effectively disabled the rule with `\r\n` line breaks
Fixes: #3426
GaryB432 added a commit to GaryB432/busy-bishop that referenced this issue Dec 9, 2017
HyphnKnight pushed a commit to HyphnKnight/tslint that referenced this issue Apr 9, 2018
…antir#3427)

[bugfix] `object-literal-sort-keys` fixed regression that effectively disabled the rule with `\r\n` line breaks
Fixes: palantir#3426
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants