mirror of
https://github.com/He4eT/oddsquat.git
synced 2026-05-04 20:37:22 +00:00
tools: typograf: use es-modules
This commit is contained in:
parent
61156c55a2
commit
d819ddb655
1 changed files with 4 additions and 4 deletions
|
|
@ -1,5 +1,5 @@
|
|||
const Typograf = require('typograf')
|
||||
const fs = require('fs')
|
||||
import Typograf from 'typograf'
|
||||
import { readFileSync, writeFile } from 'fs'
|
||||
|
||||
if (!process.argv[2]) {
|
||||
console.log('Usage:\n node typograf file [locale]')
|
||||
|
|
@ -10,7 +10,7 @@ const filePath =
|
|||
`${process.cwd()}/${process.argv[2]}`
|
||||
|
||||
const fileContent =
|
||||
fs.readFileSync(filePath).toString()
|
||||
readFileSync(filePath).toString()
|
||||
|
||||
const locale =
|
||||
process.argv[3] || 'en-US'
|
||||
|
|
@ -31,7 +31,7 @@ tp.disableRule('*');[
|
|||
].forEach(rule =>
|
||||
tp.enableRule(rule))
|
||||
|
||||
void fs.writeFile(
|
||||
void writeFile(
|
||||
filePath,
|
||||
tp.execute(fileContent),
|
||||
err => err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue