Add missing flow type to babel-cli for consistency (#10692)
This commit is contained in:
parent
67ea7f4b4d
commit
1d1101eb7c
@ -145,7 +145,7 @@ export default async function({
|
||||
if (cliOptions.watch) {
|
||||
const chokidar = util.requireChokidar();
|
||||
|
||||
filenames.forEach(function(filenameOrDir) {
|
||||
filenames.forEach(function(filenameOrDir: string): void {
|
||||
const watcher = chokidar.watch(filenameOrDir, {
|
||||
persistent: true,
|
||||
ignoreInitial: true,
|
||||
@ -155,8 +155,8 @@ export default async function({
|
||||
},
|
||||
});
|
||||
|
||||
["add", "change"].forEach(function(type) {
|
||||
watcher.on(type, function(filename) {
|
||||
["add", "change"].forEach(function(type: string): void {
|
||||
watcher.on(type, function(filename: string): void {
|
||||
handleFile(
|
||||
filename,
|
||||
filename === filenameOrDir
|
||||
|
||||
@ -223,7 +223,7 @@ export default async function({
|
||||
pollInterval: 10,
|
||||
},
|
||||
})
|
||||
.on("all", function(type: string, filename: string) {
|
||||
.on("all", function(type: string, filename: string): void {
|
||||
if (!util.isCompilableExtension(filename, cliOptions.extensions)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -320,7 +320,10 @@ function booleanify(val: any): boolean | any {
|
||||
return val;
|
||||
}
|
||||
|
||||
function collect(value, previousValue): Array<string> {
|
||||
function collect(
|
||||
value: string | any,
|
||||
previousValue: Array<string>,
|
||||
): Array<string> {
|
||||
// If the user passed the option with no value, like "babel file.js --presets", do nothing.
|
||||
if (typeof value !== "string") return previousValue;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user