Skip to content

Commit

Permalink
lint rule & fix: quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
amio committed Apr 9, 2019
1 parent dafde97 commit 1f35a65
Show file tree
Hide file tree
Showing 14 changed files with 19 additions and 18 deletions.
1 change: 1 addition & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ settings:
import/resolver:
typescript: {}
rules:
quotes: [2, 'single', { "allowTemplateLiterals": true }]
class-methods-use-this: 0
consistent-return: 0
func-names: 0
Expand Down
2 changes: 1 addition & 1 deletion src/commands/deploy/legacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ async function sync({
// Read scale and fail if we have both regions and scale
if (regions.length > 0 && Object.keys(scaleFromConfig).length > 0) {
error(
"Can't set both `regions` and `scale` options simultaneously",
'Can\'t set both `regions` and `scale` options simultaneously',
'regions-and-scale-at-once'
);
await exit(1);
Expand Down
2 changes: 1 addition & 1 deletion src/commands/dev/lib/dev-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export async function executeBuild(
): Promise<void> {
const { buildConfig, buildEntry } = asset;
if (!buildConfig || !buildEntry) {
throw new Error("Asset has not been built yet, can't rebuild");
throw new Error('Asset has not been built yet, can\'t rebuild');
}
const { cwd, env } = devServer;
const entrypoint = relative(cwd, buildEntry.fsPath);
Expand Down
2 changes: 1 addition & 1 deletion src/util/alias/deployment-should-downscale.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import deploymentIsAliased from './deployment-is-aliased';
import { Output } from '../output';
import Client from '../client';
import getScaleForDC from "../scale/get-scale-for-dc";
import getScaleForDC from '../scale/get-scale-for-dc';
import { Deployment } from '../../types';

export default async function deploymentShouldDownscale(
Expand Down
4 changes: 2 additions & 2 deletions src/util/alias/get-deployment-for-alias.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import chalk from 'chalk';

import getAppLastDeployment from '../deploy/get-app-last-deployment';
import getAppName from '../deploy/get-app-name';
import fetchDeploymentByIdOrHost from "../deploy/get-deployment-by-id-or-host";
import wait from "../output/wait";
import fetchDeploymentByIdOrHost from '../deploy/get-deployment-by-id-or-host';
import wait from '../output/wait';
import Client from '../client';
import { Output } from '../output';
import { User, Config } from '../../types';
Expand Down
4 changes: 2 additions & 2 deletions src/util/alias/get-inferred-targets.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Output } from '../output';
import * as ERRORS from "../errors-ts";
import * as ERRORS from '../errors-ts';
import { Config } from '../../types';
import cmd from "../output/cmd";
import cmd from '../output/cmd';

export default async function getInferredTargets(
output: Output,
Expand Down
6 changes: 3 additions & 3 deletions src/util/alias/get-rules-from-file.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import path from 'path';
import * as ERRORS from "../errors-ts";
import humanizePath from "../humanize-path";
import readJSONFile from "../read-json-file";
import * as ERRORS from '../errors-ts';
import humanizePath from '../humanize-path';
import readJSONFile from '../read-json-file';
import validatePathAliasRules from './validate-path-alias-rules';
import { PathRule } from '../../types';

Expand Down
2 changes: 1 addition & 1 deletion src/util/alias/get-targets-for-alias.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { NowError } from '../now-error';
import { Output } from '../output';
import getInferredTargets from './get-inferred-targets';
import toHost from "../to-host";
import toHost from '../to-host';
import { Config } from '../../types';

export default async function getTargetsForAlias(
Expand Down
2 changes: 1 addition & 1 deletion src/util/alias/validate-path-alias-rules.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { RulesFileValidationError } from "../errors-ts";
import { RulesFileValidationError } from '../errors-ts';
import { PathRule } from '../../types';

export default function validatePathAliasRules(
Expand Down
2 changes: 1 addition & 1 deletion src/util/config/get-default.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export const getDefaultAuthConfig = async existing => {

const config = {
_:
"This is your Now credentials file. DON'T SHARE! More: https://bit.ly/2qAK8bb"
'This is your Now credentials file. DON\'T SHARE! More: https://bit.ly/2qAK8bb'
};

if (existing) {
Expand Down
2 changes: 1 addition & 1 deletion src/util/deploy/get-app-name.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path from 'path';
import { NowError } from "../now-error";
import { NowError } from '../now-error';
import { Output } from '../output';
import { Config } from '../../types';
import readPackage from '../read-package';
Expand Down
2 changes: 1 addition & 1 deletion src/util/dns/parse-add-dns-record-args.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DNSRecordData } from "../../types";
import { DNSRecordData } from '../../types';

export default function parseAddArgs(
args: string[]
Expand Down
2 changes: 1 addition & 1 deletion src/util/read-metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ async function readMetaData(
const err = new Error(
'You have a `now` configuration field inside `package.json` ' +
'but configuration is also present in `now.json`! ' +
"Please ensure there's a single source of configuration by removing one."
'Please ensure there\'s a single source of configuration by removing one.'
);
err.code = 'config_prop_and_file';
throw err;
Expand Down
4 changes: 2 additions & 2 deletions test/unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ test('friendly error for malformed JSON', async t => {
t.is(err.name, 'JSONError');
t.is(
err.message,
"Unexpected token 'o' at 2:5 in test/fixtures/unit/json-syntax-error/package.json\n oops\n ^"
'Unexpected token \'o\' at 2:5 in test/fixtures/unit/json-syntax-error/package.json\n oops\n ^'
);
});

Expand Down Expand Up @@ -897,7 +897,7 @@ test('429 response error without retry header', async t => {
});

test('guess user\'s intention with custom didYouMean', async t => {
const examples = ["apollo","create-react-app","docz","gatsby","go","gridsome","html-minifier","mdx-deck","monorepo","nextjs","nextjs-news","nextjs-static","node-server","nodejs","nodejs-canvas-partyparrot","nodejs-coffee","nodejs-express","nodejs-hapi","nodejs-koa","nodejs-koa-ts","nodejs-pdfkit","nuxt-static","optipng","php-7","puppeteer-screenshot","python","redirect","serverless-ssr-reddit","static","vue","vue-ssr","vuepress"];
const examples = ['apollo','create-react-app','docz','gatsby','go','gridsome','html-minifier','mdx-deck','monorepo','nextjs','nextjs-news','nextjs-static','node-server','nodejs','nodejs-canvas-partyparrot','nodejs-coffee','nodejs-express','nodejs-hapi','nodejs-koa','nodejs-koa-ts','nodejs-pdfkit','nuxt-static','optipng','php-7','puppeteer-screenshot','python','redirect','serverless-ssr-reddit','static','vue','vue-ssr','vuepress'];

t.is(didYouMean('md', examples, 0.7), 'mdx-deck');
t.is(didYouMean('koa', examples, 0.7), 'nodejs-koa');
Expand Down

0 comments on commit 1f35a65

Please sign in to comment.