Skip to content

Commit

Permalink
fix it after linting
Browse files Browse the repository at this point in the history
  • Loading branch information
hipstersmoothie committed Mar 29, 2019
1 parent 8d12c3f commit 829c218
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/Playroom/CodeMirror-JSX.js
@@ -1,4 +1,5 @@
/* eslint-disable new-cap */

import styles from './CodeMirror-JSX.less';

function matches(hint, typed, matchInMiddle) {
Expand Down Expand Up @@ -216,7 +217,9 @@ export default function getHints(cm, options) {
if (
!atName ||
!attrs.hasOwnProperty(atName[1]) ||
!(atValues = attrs[atName[1]].values)
!(atValues = Array.isArray(attrs[atName[1]])
? attrs[atName[1]]
: attrs[atName[1]].values)
) {
return;
}
Expand Down Expand Up @@ -271,7 +274,12 @@ export default function getHints(cm, options) {
const obj = {
list: result,
from: replaceToken
? CodeMirror.Pos(cur.line, tagStart === null ? token.start : tagStart)
? CodeMirror.Pos(
cur.line,
tagStart === null || typeof tagStart === 'undefined'
? token.start
: tagStart
)
: cur,
to: replaceToken ? CodeMirror.Pos(cur.line, token.end) : cur
};
Expand Down

0 comments on commit 829c218

Please sign in to comment.