Skip to content

Commit

Permalink
chore: minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
RebeccaStevens committed Oct 17, 2021
1 parent 7d37de5 commit 9a15a60
Show file tree
Hide file tree
Showing 14 changed files with 68 additions and 43 deletions.
3 changes: 0 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,3 @@ indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
],
"sourceType": "module"
},
"ignorePatterns": ["build/", "coverage/", "lib/", "**/*.js"],
"ignorePatterns": ["/build/", "/coverage/", "/lib/", "/**/*.cjs", "/**/*.js"],
"rules": {
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-unnecessary-condition": "off",
Expand Down
16 changes: 9 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
.DS_Store
thumbs.db
*.log
.nyc_output/
node_modules/
/build/
/lib/
/build/
/coverage/
js_out/

.nyc_output/
node_modules/

*.log

.DS_Store
thumbs.db
5 changes: 1 addition & 4 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{
"./**/*.{json,yml}": [
"prettier --write"
],
"./**/*.md": [
"./**/*.{md,json,jsonc,yml}": [
"prettier --write"
],
"./**/*.ts": [
Expand Down
4 changes: 3 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
CHANGELOG.md
/CHANGELOG.md
/lib/
/build/
18 changes: 13 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,35 @@
".nyc_output": true,
"coverage": true,
"cz-adapter/index.js": true,
"ava.config.cjs": true,
"rollup.config.cjs": true
},
"files.trimTrailingWhitespace": true,
"search.exclude": {
"**/.git/": true,
"**/.nyc_output/": true,
"**/yarn.lock": true,
".vscode/": true,
"build/": true,
"lib/": true,
"ava.config.cjs": true,
"rollup.config.cjs": true,
"yarn.lock": true
},
"typescript.tsdk": "./node_modules/typescript/lib",
"files.associations": {
".markdownlint.json": "jsonc",
".markdownlintignore": "ignore"
},
"[json]": {
"editor.defaultFormatter": "vscode.json-language-features",
"editor.formatOnSave": false,
"editor.formatOnSave": true
},
"[jsonc]": {
"editor.defaultFormatter": "vscode.json-language-features",
"editor.formatOnSave": false,
"editor.formatOnSave": true
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
},
"editor.formatOnSave": true
}
}
7 changes: 7 additions & 0 deletions ava.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require("ts-node").register({
compilerOptions: {
module: "CommonJS",
},
});

module.exports = require("./ava.config.ts").default;
4 changes: 1 addition & 3 deletions ava.config.js → ava.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
// @ts-check

/**
* Get the intended boolean value from the given string.
*/
function getBoolean(value) {
function getBoolean(value: unknown) {
if (value === undefined) {
return false;
}
Expand Down
10 changes: 5 additions & 5 deletions cz-adapter/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ const types = {
};

const defaults: {
readonly defaultType?: string;
readonly defaultScope?: string;
readonly defaultSubject?: string;
readonly defaultBody?: string;
readonly defaultIssues?: string;
readonly defaultType: string | undefined;
readonly defaultScope: string | undefined;
readonly defaultSubject: string | undefined;
readonly defaultBody: string | undefined;
readonly defaultIssues: string | undefined;
} = {
defaultType: process.env.CZ_TYPE,
defaultScope: process.env.CZ_SCOPE,
Expand Down
7 changes: 7 additions & 0 deletions rollup.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require("ts-node").register({
compilerOptions: {
module: "CommonJS",
},
});

module.exports = require("./rollup.config.ts");
1 change: 0 additions & 1 deletion rollup.config.js → rollup.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* Rollup Config.
*/
// @ts-check

import rollupPluginCommonjs from "@rollup/plugin-commonjs";
import rollupPluginJSON from "@rollup/plugin-json";
Expand Down
2 changes: 1 addition & 1 deletion src/rules/prefer-tacit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ function getCallDescriptors(
// Unless user specifies they want it.
(typeof options.assumeTypes === "object" &&
!options.assumeTypes.allowFixer)
? undefined
? null
: (fixer) => fixer.replaceText(node, calleeName),
},
];
Expand Down
3 changes: 2 additions & 1 deletion tests/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"skipLibCheck": true,
"declaration": false,
// Turn off strict checks to make debugging nicer.
"strict": false
"strict": false,
"exactOptionalPropertyTypes": false
}
}
29 changes: 18 additions & 11 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,26 @@
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"esModuleInterop": true,
"exactOptionalPropertyTypes": true,
"forceConsistentCasingInFileNames": true,
"importHelpers": false,
"lib": [
"ESNext"
],
"lib": ["ESNext"],
"module": "ESNext",
"moduleResolution": "node",
"newLine": "LF",
"noEmitOnError": true,
"noImplicitReturns": true,
"noUnusedLocals": false,
"noUnusedParameters": false,
"pretty": true,
"resolveJsonModule": true,
"sourceMap": false,
"strict": true,
"alwaysStrict": true,
"target": "ES2018",
"baseUrl": ".",
"paths": {
"~/*": ["./*"],
Expand All @@ -18,13 +32,6 @@
"~/util/*": ["src/util/*"],
"~/conditional-imports/*": ["src/util/conditional-imports/*"],
"~/tests/*": ["tests/*"]
},
"module": "ESNext",
"moduleResolution": "node",
"newLine": "LF",
"noEmitOnError": true,
"resolveJsonModule": true,
"strict": true,
"target": "ES2018"
}
}
}

0 comments on commit 9a15a60

Please sign in to comment.