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')
|
import Typograf from 'typograf'
|
||||||
const fs = require('fs')
|
import { readFileSync, writeFile } from 'fs'
|
||||||
|
|
||||||
if (!process.argv[2]) {
|
if (!process.argv[2]) {
|
||||||
console.log('Usage:\n node typograf file [locale]')
|
console.log('Usage:\n node typograf file [locale]')
|
||||||
|
|
@ -10,7 +10,7 @@ const filePath =
|
||||||
`${process.cwd()}/${process.argv[2]}`
|
`${process.cwd()}/${process.argv[2]}`
|
||||||
|
|
||||||
const fileContent =
|
const fileContent =
|
||||||
fs.readFileSync(filePath).toString()
|
readFileSync(filePath).toString()
|
||||||
|
|
||||||
const locale =
|
const locale =
|
||||||
process.argv[3] || 'en-US'
|
process.argv[3] || 'en-US'
|
||||||
|
|
@ -31,7 +31,7 @@ tp.disableRule('*');[
|
||||||
].forEach(rule =>
|
].forEach(rule =>
|
||||||
tp.enableRule(rule))
|
tp.enableRule(rule))
|
||||||
|
|
||||||
void fs.writeFile(
|
void writeFile(
|
||||||
filePath,
|
filePath,
|
||||||
tp.execute(fileContent),
|
tp.execute(fileContent),
|
||||||
err => err
|
err => err
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue