Skip to content

Commit

Permalink
Update Stylelint config from .cjs to .mjs
Browse files Browse the repository at this point in the history
  • Loading branch information
karlhorky committed Oct 30, 2023
1 parent 7129cdb commit 989b200
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/checks/stylelintConfigIsValid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,23 @@ export default async function stylelintConfigIsValid() {

try {
stylelintConfigMatches =
(await fs.readFile('./stylelint.config.cjs', 'utf-8')).trim() ===
(await fs.readFile('./stylelint.config.mjs', 'utf-8')).trim() ===
`/** @type { import('stylelint').Config } */
const config = {
extends: ['stylelint-config-upleveled'],
};
module.exports = config;`;
export default config;`;
} catch (error) {
throw new Error(
`Error reading your stylelint.config.cjs file - please delete the file if it exists and reinstall the config using the instructions on https://www.npmjs.com/package/eslint-config-upleveled
`Error reading your stylelint.config.mjs file - please delete the file if it exists and reinstall the config using the instructions on https://www.npmjs.com/package/eslint-config-upleveled
`,
);
}

if (!stylelintConfigMatches) {
throw new Error(
`Your stylelint.config.cjs file does not match the configuration file template - please delete the file and reinstall the config using the instructions on https://www.npmjs.com/package/eslint-config-upleveled
`Your stylelint.config.mjs file does not match the configuration file template - please delete the file and reinstall the config using the instructions on https://www.npmjs.com/package/eslint-config-upleveled
`,
);
}
Expand Down

0 comments on commit 989b200

Please sign in to comment.