Improve @babel/types with env.BABEL_TYPES_8_BREAKING (#10917)

Co-authored-by: Justin Ridgewell <justin@ridgewell.name>
This commit is contained in:
Nicolò Ribaudo
2020-01-11 10:34:30 +01:00
committed by GitHub
parent 405c1aaad8
commit e7b80a2cb9
14 changed files with 514 additions and 194 deletions

View File

@@ -101,8 +101,12 @@ Object.keys(types.BUILDER_KEYS)
}
if (defaultValue !== null || types.NODE_FIELDS[key][field].optional) {
fieldDescription.push(
" (default: `" + util.inspect(defaultValue) + "`)"
" (default: `" + util.inspect(defaultValue) + "`"
);
if (types.BUILDER_KEYS[key].indexOf(field) < 0) {
fieldDescription.push(", excluded from builder function");
}
fieldDescription.push(")");
} else {
fieldDescription.push(" (required)");
}