Skip to content

Commit

Permalink
fix: solve build types errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgecasar committed Jan 12, 2024
1 parent 46ed2e3 commit bf3de52
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lint-staged.config.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
'*.{js,cjs,mjs,jsx,ts,tsx}': ['prettier --write', 'eslint --fix'],
'*.{js,cjs,mjs,jsx,ts,tsx}': ['prettier --write', 'eslint --fix', () => 'npm run types:check'],
'*.{md,html,css}': ['prettier --write'],
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"format:fix": "prettier --write .",
"prepare": "npx husky install",
"types": "tsc --build --pretty",
"types:check": "tsc --pretty -p tsconfig.checkOnly.json",
"types:check": "tsc --pretty",
"prepublishOnly": "npm run types",
"release": "npx semantic-release",
"reset": "rm -rf .apimockrc && rm -rf .api-mock-runner",
Expand Down
9 changes: 4 additions & 5 deletions src/helpers/colours.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
* @param {string} color - The desired color to paint the text.
* @returns {string} - The painted text.
*/
function paintText(text, color) {
return color + text + colours.reset;
export function paintText(text, color) {
return `${color}${text}${colours.reset}`;
}

const colours = {
export const colours = Object.freeze({
reset: '\x1b[0m',
bright: '\x1b[1m',
dim: '\x1b[2m',
Expand Down Expand Up @@ -40,5 +40,4 @@ const colours = {
gray: '\x1b[100m',
crimson: '\x1b[48m',
},
};
export { colours, paintText };
});
8 changes: 4 additions & 4 deletions src/services/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ export class MockRunnerError extends Error {
type = colours.fg.cyan;
}
Logger.error(
`Error of level ${paintText(this.level, type)}, type ${paintText(this.code, colours.fg.gray)} over ${paintText(
this.emitter,
colours.fg.blue
)}`
`Error of level ${paintText(this.level.toString(), type)}, type ${paintText(
this.code.toString(),
colours.fg.gray
)} over ${paintText(this.emitter, colours.fg.blue)}`
);
Logger.info(`${this.stack}`);
}
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "@os3/tsconfig",
"compilerOptions": {
"outDir": "./dist-types",
"rootDir": "."
"rootDir": "./src"
},
"include": ["src"],
"exclude": ["dist-types", "node_modules", "test"]
Expand Down

0 comments on commit bf3de52

Please # to comment.