Skip to content

Commit 4fdffe4

Browse files
committed
fix: clean up import statements and formatting in CLI
1 parent dcde970 commit 4fdffe4

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

cli.mjs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env node --no-warnings
22

3+
import process from 'node:process'
4+
// eslint-disable-next-line antfu/no-import-dist
35
import { transformStyleToTailwindcss } from './dist/index.js'
46

57
const args = process.argv.slice(2)
@@ -27,7 +29,7 @@ Documentation: https://github.com/Simon-He95/transform-to-tailwindcss-core#readm
2729
}
2830

2931
function showVersion() {
30-
import('./package.json', { assert: { type: 'json' } })
32+
import('./package.json')
3133
.then(pkg => console.log(`v${pkg.default.version}`))
3234
.catch(() => console.log('Version not found'))
3335
}
@@ -54,15 +56,16 @@ if (!cssStyles) {
5456

5557
try {
5658
const [tailwindClasses, unconverted] = transformStyleToTailwindcss(cssStyles, isRem, isDebug)
57-
59+
5860
console.log('✅ Transformation completed!')
5961
console.log(`📝 Input: ${cssStyles}`)
6062
console.log(`🎨 Tailwind: ${tailwindClasses}`)
61-
63+
6264
if (unconverted.length > 0) {
6365
console.log(`⚠️ Unconverted: ${unconverted.join('; ')}`)
6466
}
65-
} catch (error) {
67+
}
68+
catch (error) {
6669
console.error('❌ Error during transformation:', error.message)
6770
process.exit(1)
6871
}

0 commit comments

Comments
 (0)