Skip to content

Commit ec2b5fb

Browse files
chore: minor cleanup
1 parent 30d2a8e commit ec2b5fb

14 files changed

+68
-43
lines changed

.editorconfig

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,3 @@ indent_size = 2
77
charset = utf-8
88
trim_trailing_whitespace = true
99
insert_final_newline = true
10-
11-
[*.md]
12-
trim_trailing_whitespace = false

.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
],
3131
"sourceType": "module"
3232
},
33-
"ignorePatterns": ["build/", "coverage/", "lib/", "**/*.js"],
33+
"ignorePatterns": ["/build/", "/coverage/", "/lib/", "/**/*.cjs", "/**/*.js"],
3434
"rules": {
3535
"@typescript-eslint/explicit-module-boundary-types": "off",
3636
"@typescript-eslint/no-unnecessary-condition": "off",

.gitignore

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
.DS_Store
2-
thumbs.db
3-
*.log
4-
.nyc_output/
5-
node_modules/
6-
/build/
71
/lib/
2+
/build/
83
/coverage/
9-
js_out/
4+
5+
.nyc_output/
6+
node_modules/
7+
8+
*.log
9+
10+
.DS_Store
11+
thumbs.db

.lintstagedrc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
{
2-
"./**/*.{json,yml}": [
3-
"prettier --write"
4-
],
5-
"./**/*.md": [
2+
"./**/*.{md,json,jsonc,yml}": [
63
"prettier --write"
74
],
85
"./**/*.ts": [

.prettierignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
CHANGELOG.md
1+
/CHANGELOG.md
2+
/lib/
3+
/build/

.vscode/settings.json

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,35 @@
33
".nyc_output": true,
44
"coverage": true,
55
"cz-adapter/index.js": true,
6+
"ava.config.cjs": true,
7+
"rollup.config.cjs": true
68
},
79
"files.trimTrailingWhitespace": true,
810
"search.exclude": {
911
"**/.git/": true,
1012
"**/.nyc_output/": true,
11-
"**/yarn.lock": true,
1213
".vscode/": true,
1314
"build/": true,
1415
"lib/": true,
16+
"ava.config.cjs": true,
17+
"rollup.config.cjs": true,
18+
"yarn.lock": true
1519
},
1620
"typescript.tsdk": "./node_modules/typescript/lib",
21+
"files.associations": {
22+
".markdownlint.json": "jsonc",
23+
".markdownlintignore": "ignore"
24+
},
1725
"[json]": {
1826
"editor.defaultFormatter": "vscode.json-language-features",
19-
"editor.formatOnSave": false,
27+
"editor.formatOnSave": true
2028
},
2129
"[jsonc]": {
2230
"editor.defaultFormatter": "vscode.json-language-features",
23-
"editor.formatOnSave": false,
31+
"editor.formatOnSave": true
2432
},
2533
"[typescript]": {
2634
"editor.defaultFormatter": "esbenp.prettier-vscode",
27-
"editor.formatOnSave": true,
28-
},
35+
"editor.formatOnSave": true
36+
}
2937
}

ava.config.cjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
require("ts-node").register({
2+
compilerOptions: {
3+
module: "CommonJS",
4+
},
5+
});
6+
7+
module.exports = require("./ava.config.ts").default;

ava.config.js renamed to ava.config.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
// @ts-check
2-
31
/**
42
* Get the intended boolean value from the given string.
53
*/
6-
function getBoolean(value) {
4+
function getBoolean(value: unknown) {
75
if (value === undefined) {
86
return false;
97
}

cz-adapter/options.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ const types = {
4949
};
5050

5151
const defaults: {
52-
readonly defaultType?: string;
53-
readonly defaultScope?: string;
54-
readonly defaultSubject?: string;
55-
readonly defaultBody?: string;
56-
readonly defaultIssues?: string;
52+
readonly defaultType: string | undefined;
53+
readonly defaultScope: string | undefined;
54+
readonly defaultSubject: string | undefined;
55+
readonly defaultBody: string | undefined;
56+
readonly defaultIssues: string | undefined;
5757
} = {
5858
defaultType: process.env.CZ_TYPE,
5959
defaultScope: process.env.CZ_SCOPE,

rollup.config.cjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
require("ts-node").register({
2+
compilerOptions: {
3+
module: "CommonJS",
4+
},
5+
});
6+
7+
module.exports = require("./rollup.config.ts");

rollup.config.js renamed to rollup.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/**
22
* Rollup Config.
33
*/
4-
// @ts-check
54

65
import rollupPluginCommonjs from "@rollup/plugin-commonjs";
76
import rollupPluginJSON from "@rollup/plugin-json";

src/rules/prefer-tacit.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ function getCallDescriptors(
160160
// Unless user specifies they want it.
161161
(typeof options.assumeTypes === "object" &&
162162
!options.assumeTypes.allowFixer)
163-
? undefined
163+
? null
164164
: (fixer) => fixer.replaceText(node, calleeName),
165165
},
166166
];

tests/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"skipLibCheck": true,
77
"declaration": false,
88
// Turn off strict checks to make debugging nicer.
9-
"strict": false
9+
"strict": false,
10+
"exactOptionalPropertyTypes": false
1011
}
1112
}

tsconfig.base.json

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,26 @@
11
{
22
"compilerOptions": {
33
"allowSyntheticDefaultImports": true,
4+
"allowUnreachableCode": false,
5+
"allowUnusedLabels": false,
46
"esModuleInterop": true,
7+
"exactOptionalPropertyTypes": true,
58
"forceConsistentCasingInFileNames": true,
69
"importHelpers": false,
7-
"lib": [
8-
"ESNext"
9-
],
10+
"lib": ["ESNext"],
11+
"module": "ESNext",
12+
"moduleResolution": "node",
13+
"newLine": "LF",
14+
"noEmitOnError": true,
15+
"noImplicitReturns": true,
16+
"noUnusedLocals": false,
17+
"noUnusedParameters": false,
18+
"pretty": true,
19+
"resolveJsonModule": true,
20+
"sourceMap": false,
21+
"strict": true,
22+
"alwaysStrict": true,
23+
"target": "ES2018",
1024
"baseUrl": ".",
1125
"paths": {
1226
"~/*": ["./*"],
@@ -18,13 +32,6 @@
1832
"~/util/*": ["src/util/*"],
1933
"~/conditional-imports/*": ["src/util/conditional-imports/*"],
2034
"~/tests/*": ["tests/*"]
21-
},
22-
"module": "ESNext",
23-
"moduleResolution": "node",
24-
"newLine": "LF",
25-
"noEmitOnError": true,
26-
"resolveJsonModule": true,
27-
"strict": true,
28-
"target": "ES2018"
35+
}
2936
}
3037
}

0 commit comments

Comments
 (0)