Skip to content

Commit

Permalink
feat: add cjs and mjs to the prettier integration
Browse files Browse the repository at this point in the history
  • Loading branch information
allohamora committed Sep 22, 2024
1 parent 0496220 commit 586c345
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ describe('eslintMutation', () => {

describe('prettierMutation', () => {
test('should mutate config if prettier installed', async () => {
const ext = '*.{js,json,yml,md}';
const ext = '*.{js,cjs,mjs,json,yml,md}';
const actual = {};
prettierUtilsMocked.isPrettierInstalled.mockResolvedValueOnce(true);

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,6 @@
"eslint --fix",
"jest --findRelatedTests"
],
"*.{js,mjs,json,yml,md}": "prettier --write"
"*.{js,cjs,mjs,json,yml,md}": "prettier --write"
}
}
2 changes: 1 addition & 1 deletion src/categories/js/lint-staged/lint-staged.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const eslintMutation = (fileExtension: ScriptFileExtension) => async (con

export const prettierMutation = async (config: LintStagedConfig) => {
if (await isPrettierInstalled()) {
addOptionToLintStagedConfig(config, '*.{js,json,yml,md}', `${PRETTIER_CLI_NAME} --write`);
addOptionToLintStagedConfig(config, '*.{js,cjs,mjs,json,yml,md}', `${PRETTIER_CLI_NAME} --write`);
}
};

Expand Down

0 comments on commit 586c345

Please sign in to comment.