Skip to content

Commit

Permalink
feat!: prefer single quotes if possible (#475)
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoe authored Mar 31, 2020
1 parent f9b20a6 commit 39a2705
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 19 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"prefer-const": "error",
"eol-last": "error",
"prefer-arrow-callback": "error",
"no-trailing-spaces": "error"
"no-trailing-spaces": "error",
"quotes": ["warn", "single", { "avoidEscape": true }]
},
"overrides": [
{
Expand Down
4 changes: 2 additions & 2 deletions src/clean.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export async function clean(options: Options): Promise<boolean> {
if (outDir === '.') {
options.logger.error(
`${chalk.red('ERROR:')} ${chalk.gray('compilerOptions.outDir')} ` +
`cannot use the value '.'. That would delete all of our sources.`
'cannot use the value ".". That would delete all of our sources.'
);
return false;
}
Expand All @@ -45,7 +45,7 @@ export async function clean(options: Options): Promise<boolean> {
options.logger.error(
`${chalk.red('ERROR:')} The ${chalk.gray('clean')} command` +
` requires ${chalk.gray('compilerOptions.outDir')} to be defined in ` +
`tsconfig.json.`
'tsconfig.json.'
);
return false;
}
Expand Down
8 changes: 4 additions & 4 deletions src/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ export async function addScripts(
let edits = false;
const pkgManager = getPkgManagerCommand(options.yarn);
const scripts: Bag<string> = {
check: `gts check`,
check: 'gts check',
clean: 'gts clean',
compile: `tsc`,
fix: `gts fix`,
compile: 'tsc',
fix: 'gts fix',
prepare: `${pkgManager} run compile`,
pretest: `${pkgManager} run compile`,
posttest: `${pkgManager} run check`,
Expand Down Expand Up @@ -285,7 +285,7 @@ export async function init(options: Options): Promise<boolean> {
}
const generate = await query(
`${chalk.bold('package.json')} does not exist.`,
`Generate`,
'Generate',
true,
options
);
Expand Down
24 changes: 12 additions & 12 deletions test/test-init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ describe('init', () => {

it('addScripts should not edit existing scripts on no', async () => {
const SCRIPTS = {
check: `fake check`,
check: 'fake check',
clean: 'fake clean',
compile: `fake tsc`,
fix: `fake fix`,
prepare: `fake run compile`,
pretest: `fake run compile`,
posttest: `fake run check`,
compile: 'fake tsc',
fix: 'fake fix',
prepare: 'fake run compile',
pretest: 'fake run compile',
posttest: 'fake run check',
};
const pkg: PackageJson = {
...MINIMAL_PACKAGE_JSON,
Expand All @@ -103,13 +103,13 @@ describe('init', () => {

it('addScripts should edit existing scripts on yes', async () => {
const SCRIPTS = {
check: `fake check`,
check: 'fake check',
clean: 'fake clean',
compile: `fake tsc`,
fix: `fake fix`,
prepare: `fake run compile`,
pretest: `fake run compile`,
posttest: `fake run check`,
compile: 'fake tsc',
fix: 'fake fix',
prepare: 'fake run compile',
pretest: 'fake run compile',
posttest: 'fake run check',
};
const pkg: PackageJson = {
...MINIMAL_PACKAGE_JSON,
Expand Down

0 comments on commit 39a2705

Please sign in to comment.