mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-05-20 06:04:07 +08:00
[Internal] Warn for missing brackets (#2151)
* Warn for missing braces * Overlay, too
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
},
|
||||
"rules": {
|
||||
"no-console": "off",
|
||||
"strict": ["error", "global"]
|
||||
"strict": ["error", "global"],
|
||||
"curly": "warn"
|
||||
}
|
||||
}
|
||||
|
||||
4
packages/react-dev-utils/ansiHTML.js
vendored
4
packages/react-dev-utils/ansiHTML.js
vendored
@@ -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) {
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
{
|
||||
"extends": "react-app"
|
||||
"extends": "react-app",
|
||||
"rules": {
|
||||
"curly": "warn"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user