Upgrade to prettier 3.0 (#24)
This commit is contained in:
Родитель
7c744a3bc4
Коммит
e804a61c93
|
@ -14,7 +14,7 @@
|
||||||
"glob-stream": "^7.0.0",
|
"glob-stream": "^7.0.0",
|
||||||
"ignore": "^5.1.8",
|
"ignore": "^5.1.8",
|
||||||
"ora": "^5.3.0",
|
"ora": "^5.3.0",
|
||||||
"prettier": "^2.0.4",
|
"prettier": "^3.0.3",
|
||||||
"rxjs": "^6.6.3"
|
"rxjs": "^6.6.3"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
|
@ -1719,14 +1719,14 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/prettier": {
|
"node_modules/prettier": {
|
||||||
"version": "2.6.2",
|
"version": "3.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.2.tgz",
|
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz",
|
||||||
"integrity": "sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew==",
|
"integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==",
|
||||||
"bin": {
|
"bin": {
|
||||||
"prettier": "bin-prettier.js"
|
"prettier": "bin/prettier.cjs"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=10.13.0"
|
"node": ">=14"
|
||||||
},
|
},
|
||||||
"funding": {
|
"funding": {
|
||||||
"url": "https://github.com/prettier/prettier?sponsor=1"
|
"url": "https://github.com/prettier/prettier?sponsor=1"
|
||||||
|
@ -3524,9 +3524,9 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"prettier": {
|
"prettier": {
|
||||||
"version": "2.6.2",
|
"version": "3.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.2.tgz",
|
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz",
|
||||||
"integrity": "sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew=="
|
"integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg=="
|
||||||
},
|
},
|
||||||
"process-nextick-args": {
|
"process-nextick-args": {
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
|
|
|
@ -37,16 +37,16 @@
|
||||||
"glob-stream": "^7.0.0",
|
"glob-stream": "^7.0.0",
|
||||||
"ignore": "^5.1.8",
|
"ignore": "^5.1.8",
|
||||||
"ora": "^5.3.0",
|
"ora": "^5.3.0",
|
||||||
"prettier": "^2.0.4",
|
"prettier": "^3.0.3",
|
||||||
"rxjs": "^6.6.3"
|
"rxjs": "^6.6.3"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"prettier": "^2.0.0"
|
"prettier": "^3.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/glob-stream": "^6.1.0",
|
"@types/glob-stream": "^6.1.0",
|
||||||
"@types/node": "^14.14.22",
|
"@types/node": "^14.14.22",
|
||||||
"@types/prettier": "^2.1.6",
|
"@types/prettier": "^3.0.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^4.14.0",
|
"@typescript-eslint/eslint-plugin": "^4.14.0",
|
||||||
"@typescript-eslint/parser": "^4.14.0",
|
"@typescript-eslint/parser": "^4.14.0",
|
||||||
"eslint": "^7.18.0",
|
"eslint": "^7.18.0",
|
||||||
|
|
|
@ -15,7 +15,10 @@ export class ProgressReporter {
|
||||||
public failed = 0;
|
public failed = 0;
|
||||||
private spinner?: ora.Ora;
|
private spinner?: ora.Ora;
|
||||||
|
|
||||||
constructor(quiet: boolean, private readonly check: boolean) {
|
constructor(
|
||||||
|
quiet: boolean,
|
||||||
|
private readonly check: boolean,
|
||||||
|
) {
|
||||||
if (!quiet) {
|
if (!quiet) {
|
||||||
this.spinner = ora('Starting...').start();
|
this.spinner = ora('Starting...').start();
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@ function runFormatting(
|
||||||
const contents = await fs.readFile(file.path, 'utf-8');
|
const contents = await fs.readFile(file.path, 'utf-8');
|
||||||
let formatted: string;
|
let formatted: string;
|
||||||
try {
|
try {
|
||||||
formatted = prettier.format(contents, {
|
formatted = await prettier.format(contents, {
|
||||||
...(await prettier.resolveConfig(file.path)),
|
...(await prettier.resolveConfig(file.path)),
|
||||||
filepath: file.path,
|
filepath: file.path,
|
||||||
});
|
});
|
||||||
|
|
Загрузка…
Ссылка в новой задаче