Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: prefer single quotes if possible, raising warning #475

Merged
merged 1 commit into from
Mar 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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