diff --git a/package.json b/package.json index a204e9c0..7cf4f6bf 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "license-check": "jsgl --local ." }, "engines": { - "node": ">=6" + "node": ">=8" }, "keywords": [], "author": "Google Inc.", @@ -77,7 +77,7 @@ "typescript": "~3.3.0" }, "peerDependencies": { - "typescript": "^2.7.1 || ^3.0.0" + "typescript": "^3.0.0" }, "ava": { "require": [ diff --git a/src/cli.ts b/src/cli.ts index cc59a54b..d6cfb825 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -97,7 +97,7 @@ async function run(verb: string, files: string[]): Promise { // typescript module during init, since it might not exist. // See: https://github.com/google/ts-style/issues/48 if (verb === 'init') { - return await init(options); + return init(options); } const lint: VerbFilesFunction = require('./lint').lint; @@ -108,12 +108,9 @@ async function run(verb: string, files: string[]): Promise { const passFormat = await format(options, files); return passLint && passFormat; case 'fix': - return ( - (await lint(options, files, true)) && - (await format(options, files, true)) - ); + return (await lint(options, files, true)) && format(options, files, true); case 'clean': - return await clean(options); + return clean(options); default: usage(`Unknown verb: ${verb}`); return false; diff --git a/src/util.ts b/src/util.ts index 209cfbe4..6d48fa74 100644 --- a/src/util.ts +++ b/src/util.ts @@ -48,7 +48,7 @@ export async function getTSConfig( ): Promise { customReadFilep = customReadFilep || readFilep; const readArr = new Set(); - return await getBase('tsconfig.json', customReadFilep, readArr, rootDir); + return getBase('tsconfig.json', customReadFilep, readArr, rootDir); } /** diff --git a/tslint.json b/tslint.json index d2ebf632..0c0ef073 100644 --- a/tslint.json +++ b/tslint.json @@ -3,10 +3,18 @@ "array-type": [true, "array-simple"], "arrow-return-shorthand": true, "ban": [true, + {"name": ["it", "skip"]}, + {"name": ["it", "only"]}, + {"name": ["it", "async", "skip"]}, + {"name": ["it", "async", "only"]}, + {"name": ["describe", "skip"]}, + {"name": ["describe", "only"]}, {"name": "parseInt", "message": "tsstyle#type-coercion"}, {"name": "parseFloat", "message": "tsstyle#type-coercion"}, - {"name": "Array", "message": "tsstyle#array-constructor"} + {"name": "Array", "message": "tsstyle#array-constructor"}, + {"name": ["*", "innerText"], "message": "Use .textContent instead. tsstyle#browser-oddities"} ], + "ban-ts-ignore": true, "ban-types": [true, ["Object", "Use {} instead."], ["String", "Use 'string' instead."], @@ -18,6 +26,7 @@ "deprecation": true, "forin": true, "interface-name": [true, "never-prefix"], + "interface-over-type-literal": true, "jsdoc-format": true, "label-position": true, "member-access": [true, "no-public"], @@ -34,6 +43,8 @@ "no-namespace": [true, "allow-declarations"], "no-reference": true, "no-string-throw": true, + "no-return-await": true, + "no-unsafe-finally": true, "no-unused-expression": true, "no-var-keyword": true, "object-literal-shorthand": true,