Skip to content

Commit

Permalink
feat: add stylelint to check styled-jsx css in js
Browse files Browse the repository at this point in the history
  • Loading branch information
ismay committed May 10, 2024
1 parent d2db46b commit 27a0752
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/commands/types/javascript.js
Expand Up @@ -3,6 +3,7 @@ const { callback: runCb } = require('@dhis2/cli-helpers-engine').exec
const { exit } = require('@dhis2/cli-helpers-engine')
const { eslint } = require('../../tools/eslint.js')
const { prettier } = require('../../tools/prettier.js')
const { stylelint } = require('../../tools/stylelint.js')
const { configured } = require('../../utils/config.js')
const { selectFiles } = require('../../utils/files.js')
const {
Expand Down Expand Up @@ -78,6 +79,17 @@ exports.handler = (argv, callback) => {
log.log('No Prettier configuration found')
}

if (configured('stylelint')) {
log.info('javascript > stylelint')
stylelint({
apply,
files: jsFiles,
callback: finalStatus,
})
} else {
log.log('No Prettier configuration found')
}

if (!callback) {
log.debug(sayFilesChecked('javascript', jsFiles.length, apply))
exit(finalStatus())
Expand Down

0 comments on commit 27a0752

Please sign in to comment.