Skip to content

Commit

Permalink
Merge pull request #604 from sendilkumarn/fix-tslint-issues
Browse files Browse the repository at this point in the history
fix tslint warnings
  • Loading branch information
sendilkumarn committed Sep 22, 2018
2 parents 1e0fa65 + e425642 commit 1a8099c
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 31 deletions.
4 changes: 3 additions & 1 deletion packages/generators/add-generator.ts
Expand Up @@ -461,7 +461,9 @@ export default class AddGenerator extends Generator {
// Either we are adding directly at the property, else we're in a prop.theOne scenario
const actionMessage: string =
isDeepProp[1] === "other"
? `What do you want the key on ${action} to be? (press enter if you want it directly as a value on the property)`
? `What do you want the key on ${
action
} to be? (press enter if you want it directly as a value on the property)`
: `What do you want the value of ${isDeepProp[1]} to be?`;

this.prompt([
Expand Down
2 changes: 1 addition & 1 deletion packages/generators/remove-generator.ts
Expand Up @@ -69,7 +69,7 @@ export default class RemoveGenerator extends Generator {
])
.then(({ propType }: { propType: string }): Promise<{}> => {
if (!PROP_TYPES.has(propType)) {
console.log("Invalid webpack config prop");
console.error("Invalid webpack config prop");
return;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/make/index.ts
Expand Up @@ -6,5 +6,5 @@
*/

export default function make() {
return console.log("make me");
return;
}
10 changes: 5 additions & 5 deletions packages/migrate/index.ts
Expand Up @@ -178,7 +178,7 @@ function runMigration(currentConfigPath: string, outputConfigPath: string): Prom
},
]);
} else {
console.log(chalk.red("✖ Migration aborted"));
console.error(chalk.red("✖ Migration aborted"));
}
})
.then((answer: {
Expand All @@ -198,7 +198,7 @@ function runMigration(currentConfigPath: string, outputConfigPath: string): Prom
);

if (webpackOptionsValidationErrors.length) {
console.log(
console.error(
chalk.red(
"\n✖ Your configuration validation wasn't successful \n",
),
Expand All @@ -211,18 +211,18 @@ function runMigration(currentConfigPath: string, outputConfigPath: string): Prom
}
}

console.log(
console.info(
chalk.green(
`\n✔︎ New webpack config file is at ${outputConfigPath}.`,
),
);
console.log(
console.info(
chalk.green(
"✔︎ Heads up! Updating to the latest version could contain breaking changes.",
),
);

console.log(
console.info(
chalk.green(
"✔︎ Plugin and loader dependencies may need to be updated.",
),
Expand Down
Expand Up @@ -39,7 +39,7 @@ export default function(j: IJSCodeshift, ast: INode) {
j(path).remove();
}
} else {
console.log(`
console.error(`
${chalk.red("Please remove deprecated plugins manually. ")}
See ${chalk.underline(
"https://webpack.js.org/guides/migrating/",
Expand Down
10 changes: 5 additions & 5 deletions packages/serve/index.ts
Expand Up @@ -54,7 +54,7 @@ const getRootPathModule = (dep: string): string => path.resolve(process.cwd(), d
function serve() {
const packageJSONPath: string = getRootPathModule("package.json");
if (!packageJSONPath) {
console.log(
console.error(
"\n",
chalk.red("✖ Could not find your package.json file"),
"\n",
Expand All @@ -75,13 +75,13 @@ function serve() {
"node_modules/webpack-dev-server/bin/webpack-dev-server.js",
);
if (!WDSPath) {
console.log(
console.error(
"\n",
chalk.red(
"✖ Could not find the webpack-dev-server dependency in node_modules root path",
),
);
console.log(
console.info(
chalk.bold.green(" ✔︎"),
"Try this command:",
chalk.bold.green("rm -rf node_modules && npm install"),
Expand Down Expand Up @@ -158,12 +158,12 @@ function serve() {
});
});
} else {
console.log(chalk.bold.red("✖ Serve aborted due cancelling"));
console.error(chalk.bold.red("✖ Serve aborted due cancelling"));
process.exitCode = 1;
}
})
.catch((err: object) => {
console.log(chalk.red("✖ Serve aborted due to some errors"));
console.error(chalk.red("✖ Serve aborted due to some errors"));
console.error(err);
process.exitCode = 1;
});
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/recursive-parser.ts
Expand Up @@ -8,7 +8,7 @@ export default function recursiveTransform(
if (Array.isArray(value)) {
return utils.parseTopScope(j, ast, value, action);
}
console.log("Error in parsing top scope, Array required");
console.error("Error in parsing top scope, Array required");
return false;
} else if (key === "merge") {
if (typeof value === "string") {
Expand Down
14 changes: 7 additions & 7 deletions packages/utils/resolve-packages.ts
Expand Up @@ -58,8 +58,8 @@ export function resolvePackages(pkg: string[]): Function | void {
require.resolve(absolutePath);
packageLocations.push(absolutePath);
} catch (err) {
console.log(`Cannot find a generator at ${absolutePath}.`);
console.log("\nReason:\n");
console.error(`Cannot find a generator at ${absolutePath}.`);
console.error("\nReason:\n");
console.error(chalk.bold.red(err));
process.exitCode = 1;
}
Expand All @@ -75,16 +75,16 @@ export function resolvePackages(pkg: string[]): Function | void {
const globalPath: string = getPathToGlobalPackages();
packageLocations.push(path.resolve(globalPath, addon));
} catch (err) {
console.log("Package wasn't validated correctly..");
console.log("Submit an issue for", pkg, "if this persists");
console.log("\nReason: \n");
console.error("Package wasn't validated correctly..");
console.error("Submit an issue for", pkg, "if this persists");
console.error("\nReason: \n");
console.error(chalk.bold.red(err));
process.exitCode = 1;
}
})
.catch((err: string) => {
console.log("Package couldn't be installed, aborting..");
console.log("\nReason: \n");
console.error("Package couldn't be installed, aborting..");
console.error("\nReason: \n");
console.error(chalk.bold.red(err));
process.exitCode = 1;
})
Expand Down
10 changes: 1 addition & 9 deletions tslint.json
Expand Up @@ -13,15 +13,7 @@
"ban-types": [
false
],
"no-console": {
"severity": "warning"
},
"max-line-length": {
"options": {
"limit": 120
},
"severity": "warn"
}
"no-console": [true, "log"]
},
"rulesDirectory": [],
"linterOptions": {
Expand Down

0 comments on commit 1a8099c

Please sign in to comment.