fix(dev-infra): correctly detect prettier config (#41860)
This commit uses the correct property name (`prettier` vs `pretter`) to check whether prettier is enabled via the config. (It also fixes some typos in `dev-infra`.) PR Close #41860
This commit is contained in:
parent
3b7d4ebbd6
commit
fff2ca540f
|
@ -14,7 +14,7 @@ platform(
|
||||||
# frequently. There are rare cases where it needs to be updated. e.g. for a more recent Bash
|
# frequently. There are rare cases where it needs to be updated. e.g. for a more recent Bash
|
||||||
# version, or new system settings that are required for launching browsers. In order to do that,
|
# version, or new system settings that are required for launching browsers. In order to do that,
|
||||||
# we need to either see if the `rbe-ubuntu16-04-webtest` image can be updated, or if we need to
|
# we need to either see if the `rbe-ubuntu16-04-webtest` image can be updated, or if we need to
|
||||||
# build and publish our own image to the Google cloud image registry. Additionally, we set th
|
# build and publish our own image to the Google cloud image registry. Additionally, we set the
|
||||||
# `SYS_ADMIN` capability so that browsers can be launched with sandbox mode enabled. Related
|
# `SYS_ADMIN` capability so that browsers can be launched with sandbox mode enabled. Related
|
||||||
# information: https://developers.google.com/web/tools/puppeteer/troubleshooting#running_puppeteer_in_docker
|
# information: https://developers.google.com/web/tools/puppeteer/troubleshooting#running_puppeteer_in_docker
|
||||||
remote_execution_properties = """
|
remote_execution_properties = """
|
||||||
|
|
|
@ -24,11 +24,11 @@ export class Prettier extends Formatter {
|
||||||
defaultFileMatcher = ['**/*.{t,j}s'];
|
defaultFileMatcher = ['**/*.{t,j}s'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The configuration path of the pretter config, obtained during construction to prevent needing
|
* The configuration path of the prettier config, obtained during construction to prevent needing
|
||||||
* to discover it repeatedly for each execution.
|
* to discover it repeatedly for each execution.
|
||||||
*/
|
*/
|
||||||
private configPath =
|
private configPath =
|
||||||
this.config['pretter'] ? exec(`${this.binaryFilePath} --find-config-path .`).trim() : '';
|
this.config['prettier'] ? exec(`${this.binaryFilePath} --find-config-path .`).trim() : '';
|
||||||
|
|
||||||
actions = {
|
actions = {
|
||||||
check: {
|
check: {
|
||||||
|
|
|
@ -2480,10 +2480,10 @@ class Prettier extends Formatter {
|
||||||
this.binaryFilePath = path.join(this.git.baseDir, 'node_modules/.bin/prettier');
|
this.binaryFilePath = path.join(this.git.baseDir, 'node_modules/.bin/prettier');
|
||||||
this.defaultFileMatcher = ['**/*.{t,j}s'];
|
this.defaultFileMatcher = ['**/*.{t,j}s'];
|
||||||
/**
|
/**
|
||||||
* The configuration path of the pretter config, obtained during construction to prevent needing
|
* The configuration path of the prettier config, obtained during construction to prevent needing
|
||||||
* to discover it repeatedly for each execution.
|
* to discover it repeatedly for each execution.
|
||||||
*/
|
*/
|
||||||
this.configPath = this.config['pretter'] ? shelljs.exec(`${this.binaryFilePath} --find-config-path .`).trim() : '';
|
this.configPath = this.config['prettier'] ? shelljs.exec(`${this.binaryFilePath} --find-config-path .`).trim() : '';
|
||||||
this.actions = {
|
this.actions = {
|
||||||
check: {
|
check: {
|
||||||
commandFlags: `--config ${this.configPath} --check`,
|
commandFlags: `--config ${this.configPath} --check`,
|
||||||
|
|
|
@ -7,8 +7,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {ListChoiceOptions, prompt} from 'inquirer';
|
import {ListChoiceOptions, prompt} from 'inquirer';
|
||||||
import {spawnWithDebugOutput} from '../../utils/child-process';
|
|
||||||
|
|
||||||
|
import {spawnWithDebugOutput} from '../../utils/child-process';
|
||||||
import {GithubConfig} from '../../utils/config';
|
import {GithubConfig} from '../../utils/config';
|
||||||
import {debug, error, info, log, promptConfirm, red, yellow} from '../../utils/console';
|
import {debug, error, info, log, promptConfirm, red, yellow} from '../../utils/console';
|
||||||
import {GitClient} from '../../utils/git/index';
|
import {GitClient} from '../../utils/git/index';
|
||||||
|
|
Loading…
Reference in New Issue