Ran
|
Jobs
7
|
Files
68
|
Run time
4min
|
Badge
Embed ▾
README BADGES
|
travis-ci
<a href="https://github.com/yannickcr/eslint-plugin-react/commit/<a class=hub.com/yannickcr/eslint-plugin-react/commit/0766d11bac45b04562c7d10d4037753eababded8">0766d11ba<a href="https://github.com/yannickcr/eslint-plugin-react/commit/0766d11bac45b04562c7d10d4037753eababded8">">Fix error caused by templates in ConditionalExpressions (jsx-indent) Template strings are constructed differently from other tokens in espree. Other tokens are created by the Token class and are thus Token class objects. They look like this: ``` Token { type: &#39;String&#39;, value: &#39;&quot;bar&quot;&#39;, start: 44, end: 49, loc: SourceLocation { start: Position { line: 4, column: 11 }, end: Position { line: 4, column: 16 } }, range: [ 44, 49 ] } ``` Template tokens, however, are constructed differently and end up as plain JavaScript objects, which look like this: ``` { type: &#39;Template&#39;, value: &#39;`bar`&#39;, loc: { start: Position { line: 4, column: 11 }, end: Position { line: 4, column: 16 } }, range: [ 44, 49 ] } ``` See: [espree's token-translator.js](https://github.com/eslint/espree/blob/</a><a class="double-link" href="https://github.com/yannickcr/eslint-plugin-react/commit/<a class="double-link" href="https://github.com/yannickcr/eslint-plugin-react/commit/58f75be6b89d8904b6366ed368045cb02c4a4e33">58f75be6b</a>">58f75be6b</a><a href="https://github.com/yannickcr/eslint-plugin-react/commit/0766d11bac45b04562c7d10d4037753eababded8">/lib/token-translator.js#L43) As a result of this different construction, the `start` and `end` properties are not present on the template token object. To correct this I've changed to using the `range` property, which I infer to be more proper given the method it is being passed into is called `getNodeByRangeIndex`. I also think we can safely rely on `range` being present on all token types. Fixes #1061
1 of 1 new or added line in 1 file covered. (100.0%)
3156 of 3261 relevant lines covered (96.78%)
1138.36 hits per line
ID | Job ID | Ran | Files | Coverage | |
---|---|---|---|---|---|
1 | 1572.1 | 68 |
96.78 |
Travis Job 1572.1 | |
2 | 1572.2 | 68 |
96.78 |
Travis Job 1572.2 | |
3 | 1572.3 | 68 |
96.78 |
Travis Job 1572.3 | |
4 | 1572.4 | 68 |
96.78 |
Travis Job 1572.4 | |
5 | 1572.5 | 68 |
96.78 |
Travis Job 1572.5 | |
6 | 1572.6 | 68 |
96.78 |
Travis Job 1572.6 | |
7 | 1572.7 | 68 |
96.78 |
Travis Job 1572.7 |
Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line |
---|