Skip to content

Commit d3606eb

Browse files
committed
chore: tslint and attempt to make codacy happy :)
1 parent ae3d083 commit d3606eb

File tree

4 files changed

+25
-8
lines changed

4 files changed

+25
-8
lines changed

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"build": "cross-env NODE_ENV=development rimraf ./dist && tsc --build tsconfig.json",
1616
"start": "cross-env NODE_ENV=development npm run build && node ./dist/main.js",
1717
"coverage": "cross-env NODE_ENV=development nyc report --reporter=json > coverage/coverage.json",
18-
"test": "cross-env NODE_ENV=test echo TODO: Tests"
18+
"test": "cross-env NODE_ENV=test echo TODO: Tests",
19+
"lint": "cross-env NODE_ENV=development tslint -c tslint.json 'src/**/*.ts'"
1920
},
2021
"repository": {
2122
"type": "git",

src/clear.d.ts

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
declare module "clear" {
2+
const x: any;
3+
export = x;
4+
}

src/main.ts

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
#!/usr/bin/env node
22

3-
const log = console.log;
4-
const clear = require("clear");
5-
6-
import yargs from "yargs";
3+
const log: any = console.log;
74
import chalk, { Chalk } from "chalk";
5+
import clear from "clear";
86
import figlet from "figlet";
7+
import yargs from "yargs";
98

109
const error: Chalk = chalk.bold.red;
1110
const warning: Chalk = chalk.keyword("orange");
1211
const info: Chalk = chalk.green;
1312

1413
// if we want to clear console, call 'clear' below
15-
// clear();
14+
clear();
1615

1716
log(chalk.whiteBright(
18-
figlet.textSync("ever", { horizontalLayout: "default", font: "Graffiti" })
17+
figlet.textSync("ever", {
18+
font: "Graffiti",
19+
horizontalLayout: "default",
20+
}),
1921
));
2022

2123
log("");
@@ -26,4 +28,3 @@ process.on("unhandledRejection", (reason, p) => {
2628
log(error(`Unhandled Rejection at: ${p}, reason: ${reason}`));
2729
process.exit(1);
2830
});
29-

tslint.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"defaultSeverity": "error",
3+
"extends": [
4+
"tslint:recommended"
5+
],
6+
"jsRules": {},
7+
"rules": {
8+
"no-console": false
9+
},
10+
"rulesDirectory": []
11+
}

0 commit comments

Comments
 (0)