Skip to content

Commit 69f6722

Browse files
committed
style: introduce plugin:@typescript-eslint/strict
1 parent 26e9c37 commit 69f6722

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

.eslintrc.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@
99
"airbnb-base",
1010
"eslint:recommended",
1111
"plugin:@typescript-eslint/recommended",
12+
"plugin:@typescript-eslint/strict",
1213
"prettier",
1314
"plugin:prettier/recommended"
1415
],
1516
"parser": "@typescript-eslint/parser",
1617
"parserOptions": {
18+
"project": "tsconfig.json",
1719
"ecmaVersion": "latest",
1820
"sourceType": "module"
1921
},

src/action/generate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function parseQueryAndParams(
1717
params?: readonly (string | object | number | boolean)[],
1818
): string {
1919
let _sql = sql;
20-
if (params && params.length) {
20+
if (params?.length) {
2121
params.forEach((value) => {
2222
if (typeof value === 'string') {
2323
_sql = _sql.replace('?', `"${value}"`);

src/util/cli.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export async function askPasswordIfNeeded(options: {
2828
readonly password?: string;
2929
}): Promise<string> {
3030
if (options.type === 'sqlite' || options.password)
31-
return options.password || '';
31+
return options.password ?? '';
3232
return new Promise<string>((resolve) => {
3333
let muted = false;
3434
const rl = readline.createInterface({
@@ -140,9 +140,9 @@ export function registerCommand(
140140

141141
const command = program.command(commandName).description(description);
142142
args.forEach((key) => command.addArgument(_args[key]()));
143-
Object.entries(options)
144-
.filter(([, value]) => value)
145-
.forEach(([key]) => command.addOption(_options[key as OptionKeys]()));
143+
Object.keys(options).forEach((key) =>
144+
command.addOption(_options[key as OptionKeys]()),
145+
);
146146
command.action(action);
147147
return program;
148148
}

0 commit comments

Comments
 (0)