Skip to content

Commit 3228033

Browse files
committedApr 9, 2020
style: 🎨 Prettier 2.0
1 parent aefa669 commit 3228033

File tree

5 files changed

+21
-18
lines changed

5 files changed

+21
-18
lines changed
 

‎.eslintrc.js

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ module.exports = {
2424
sourceType: "module", // Allows for the use of imports
2525
project: "./tsconfig.json",
2626
impliedStrict: true,
27+
createDefaultProgram: true,
2728
},
2829
rules: {
2930
"prettier/prettier": "warn",

‎src/cli.ts

+7-5
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,17 @@ export class Cli {
4545
} else {
4646
errors.push(`Expecting a commit message like:`)
4747
errors.push(
48-
` ${chalk.blue("type" + chalk.bold("(scope):")) +
49-
chalk.dim(" description")}`
48+
` ${
49+
chalk.blue("type" + chalk.bold("(scope):")) +
50+
chalk.dim(" description")
51+
}`
5052
)
5153
}
5254
if (errors.length) {
5355
errors.push("Get help at https://www.conventionalcommits.org/")
5456
}
5557

56-
errors.forEach(e => console.error(chalk.red("✖"), e))
58+
errors.forEach((e) => console.error(chalk.red("✖"), e))
5759
if (errors.length) process.exit(1)
5860
}
5961

@@ -191,7 +193,7 @@ export class Cli {
191193
})
192194

193195
let firstLine = true
194-
rl.on("line", line => {
196+
rl.on("line", (line) => {
195197
try {
196198
console.log(
197199
this.format(line, opts.format, opts.commit && firstLine, opts.log)
@@ -209,7 +211,7 @@ export class Cli {
209211
}
210212

211213
export function run(argv = process.argv) {
212-
Cli.create(argv).then(cli => cli.run())
214+
Cli.create(argv).then((cli) => cli.run())
213215
}
214216

215217
if (module === require.main) {

‎src/config-options-ti.ts

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
/**
22
* This module was automatically generated by `ts-interface-builder`
33
*/
4-
import * as t from "ts-interface-checker";
4+
import * as t from "ts-interface-checker"
55
// tslint:disable:object-literal-key-quotes
66

77
export const TDevmoji = t.iface([], {
8-
"code": "string",
9-
"emoji": t.opt("string"),
10-
"gitmoji": t.opt("string"),
11-
"description": t.opt("string"),
12-
});
8+
code: "string",
9+
emoji: t.opt("string"),
10+
gitmoji: t.opt("string"),
11+
description: t.opt("string"),
12+
})
1313

1414
export const ConfigOptions = t.iface([], {
15-
"types": t.array("string"),
16-
"devmoji": t.array("TDevmoji"),
17-
});
15+
types: t.array("string"),
16+
devmoji: t.array("TDevmoji"),
17+
})
1818

1919
const exportedTypeSuite: t.ITypeSuite = {
2020
TDevmoji,
2121
ConfigOptions,
22-
};
23-
export default exportedTypeSuite;
22+
}
23+
export default exportedTypeSuite

‎src/conventional-commits.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export class ConventionalCommits {
3939
}
4040

4141
const ret: string[] = []
42-
input.map(code => {
42+
input.map((code) => {
4343
if (code) {
4444
const emoji = this.devmoji.get(code)
4545
if (!ret.includes(emoji)) ret.push(emoji)

‎src/devmoji.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export class Devmoji {
2929
}
3030

3131
demojify(text: string): string {
32-
return text.replace(this.unicodeRegex, s => {
32+
return text.replace(this.unicodeRegex, (s) => {
3333
const ret = github.getCode(s)
3434
if (ret) return github.wrap(ret)
3535
return s

0 commit comments

Comments
 (0)
Please sign in to comment.