Skip to content
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

Fixes location reporting in simple-unless rule #2940

Conversation

judithhinlung
Copy link
Collaborator

Background

This PR fixes #2906, a bug in the simple-unless rule in which the same value is reported for start and end line locations.

  {{#unless this.foo}}
    'Bingo!'
  {{else}}
    'Bogus!'
  {{/unless}}

**Before**:
  {
    "column": 0,
    "endColumn": 0,
    "endLine": 3,
    "filePath": "layout.hbs",
    "isFixable": true,
    "line": 3,
    "message": "Using an {{else}} block with {{unless}} should be avoided.",
    "rule": "simple-unless",
    "severity": 2,
    "source": "{{else}}",
  }

**After**:
  {
    "column": 20,
    "endColumn": 0,
    "endLine": 3,
    "filePath": "layout.hbs",
    "isFixable": true,
    "line": 1,
    "message": "Using an {{else}} block with {{unless}} should be avoided.",
    "rule": "simple-unless",
    "severity": 2,
    "source": "{{else}}",
  }


### Testing
Test Suites: 149 passed, 149 total
Tests:       5 skipped, 8540 passed, 8545 total
Snapshots:   1109 passed, 1109 total
Time:        130.081 s
Ran all test suites.
✨  Done in 140.24s.

@lin-ll lin-ll added the bug label Jul 18, 2023
@lin-ll lin-ll merged commit 4945c83 into ember-template-lint:master Jul 18, 2023
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Simple-unless Reports Same Value for Start and End Location
2 participants