diff --git a/package.json b/package.json index ac40a772f..190e6a87f 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "test:update": "NODE_OPTIONS=--max_old_space_size=4096 cross-env TZ=UTC jest --updateSnapshot", "lint": "eslint --cache --ext .js,.jsx,.ts,.tsx", "lint:fix": "eslint --cache --ext .js,.jsx,.ts,.tsx --fix --format=pretty", - "prettier": "prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"", + "prettier": "prettier --write \"**/*.{js,jsx,ts,tsx,less,md,json}\"", "tsc": "tsc --noEmit", "tsc:clean": "tsc --build --clean", "locale:remove-useless": "ts-node scripts/remove-useless-locale.ts" diff --git a/packages/codemod/bin/cli.js b/packages/codemod/bin/cli.js index 71c000215..399d2bb91 100644 --- a/packages/codemod/bin/cli.js +++ b/packages/codemod/bin/cli.js @@ -8,7 +8,6 @@ const _ = require('lodash'); const chalk = require('chalk'); const isGitClean = require('is-git-clean'); const updateCheck = require('update-check'); -const findUp = require('find-up'); const semver = require('semver'); const { run: jscodeshift } = require('jscodeshift/src/Runner'); const execa = require('execa'); @@ -286,7 +285,7 @@ async function bootstrap() { console.log('[Prettier] format files running...'); try { const isDir = isDirectory.sync(dir); - const path = isDir ? '**/*.{js,jsx,tsx,ts,d.ts}' : dir; + const path = isDir ? path.join(dir, '**/*.{js,jsx,ts,tsx,d.ts}') : dir; const npxCommand = commandExistsSync('tnpx') ? 'tnpx' : 'npx'; await execa(npxCommand, ['prettier', '--write', path], { stdio: 'inherit' }); console.log('\n[Prettier] format files completed!\n');