[Internal] Warn for missing brackets (#2151)

* Warn for missing braces

* Overlay, too
This commit is contained in:
Joe Haddad
2017-05-14 20:59:20 -04:00
committed by GitHub
parent 75fc094a5d
commit 9b228176f0
5 changed files with 15 additions and 5 deletions

View File

@@ -11,6 +11,7 @@
},
"rules": {
"no-console": "off",
"strict": ["error", "global"]
"strict": ["error", "global"],
"curly": "warn"
}
}

View File

@@ -82,7 +82,9 @@ function ansiHTML(txt) {
if (color != null) {
result += '<span style="color: #' + color + ';">' + part + '</span>';
} else {
if (fg != null) console.log('Missing color mapping: ', fg);
if (fg != null) {
console.log('Missing color mapping: ', fg);
}
result += '<span>' + part + '</span>';
}
if (_index < contentParts.length - 1) {

View File

@@ -1,3 +1,6 @@
{
"extends": "react-app"
"extends": "react-app",
"rules": {
"curly": "warn"
}
}

View File

@@ -17,7 +17,9 @@ async function map(
const files: string[] = [];
frames.forEach(frame => {
const { fileName } = frame;
if (fileName == null) return;
if (fileName == null) {
return;
}
if (files.indexOf(fileName) !== -1) {
return;
}

View File

@@ -67,7 +67,9 @@ async function unmap(
}))
.sort((a, b) => {
const s = Math.sign(a.seps - b.seps);
if (s !== 0) return s;
if (s !== 0) {
return s;
}
return Math.sign(a.penalties - b.penalties);
});
if (source.length < 1 || lineNumber == null) {