From 4edf0d71ef0a8a3370165e804dd693033d6207bc Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Wed, 15 May 2019 21:27:03 -0700 Subject: [PATCH] chore: Add documentation validation tool (#531) --- .prettierignore | 1 + azure-pipelines.yml | 4 + package.json | 1 + packages/eslint-plugin/README.md | 90 ++++++------- packages/eslint-plugin/package.json | 10 +- packages/eslint-plugin/src/configs/all.json | 5 + .../src/configs/recommended.json | 1 + .../src/rules/adjacent-overload-signatures.ts | 1 - .../eslint-plugin/src/rules/array-type.ts | 1 - .../eslint-plugin/src/rules/await-thenable.ts | 1 - .../eslint-plugin/src/rules/ban-ts-ignore.ts | 3 +- packages/eslint-plugin/src/rules/ban-types.ts | 1 - .../src/rules/class-name-casing.ts | 1 - .../rules/explicit-member-accessibility.ts | 1 - .../src/rules/func-call-spacing.ts | 2 +- packages/eslint-plugin/src/rules/indent.ts | 1 - .../src/rules/interface-name-prefix.ts | 1 - .../eslint-plugin/src/rules/member-naming.ts | 2 +- .../src/rules/member-ordering.ts | 1 - .../rules/no-angle-bracket-type-assertion.ts | 1 - .../src/rules/no-empty-interface.ts | 1 - .../src/rules/no-explicit-any.ts | 1 - .../src/rules/no-extra-parens.ts | 2 +- .../src/rules/no-extraneous-class.ts | 1 - .../src/rules/no-for-in-array.ts | 1 - .../src/rules/no-inferrable-types.ts | 3 +- .../src/rules/no-magic-numbers.ts | 7 +- .../eslint-plugin/src/rules/no-misused-new.ts | 3 +- .../eslint-plugin/src/rules/no-namespace.ts | 1 - .../src/rules/no-non-null-assertion.ts | 1 - .../rules/no-object-literal-type-assertion.ts | 1 - .../src/rules/no-parameter-properties.ts | 3 +- .../src/rules/no-require-imports.ts | 3 +- .../eslint-plugin/src/rules/no-this-alias.ts | 1 - .../src/rules/no-triple-slash-reference.ts | 1 - .../eslint-plugin/src/rules/no-type-alias.ts | 1 - .../src/rules/no-unnecessary-qualifier.ts | 3 +- .../rules/no-unnecessary-type-assertion.ts | 1 - .../eslint-plugin/src/rules/no-unused-vars.ts | 1 - .../src/rules/no-var-requires.ts | 1 - .../eslint-plugin/src/rules/prefer-for-of.ts | 3 +- .../src/rules/prefer-function-type.ts | 1 - .../src/rules/prefer-interface.ts | 1 - .../src/rules/prefer-namespace-keyword.ts | 3 +- .../src/rules/prefer-regexp-exec.ts | 2 +- .../rules/prefer-string-starts-ends-with.ts | 2 +- .../src/rules/promise-function-async.ts | 3 +- .../src/rules/restrict-plus-operands.ts | 3 +- .../src/rules/type-annotation-spacing.ts | 1 - .../eslint-plugin/src/rules/unbound-method.ts | 3 +- .../src/rules/unified-signatures.ts | 3 +- .../eslint-plugin/tools/generate-configs.ts | 34 ++++- .../validate-docs/check-for-rule-docs.ts | 27 ++++ .../tools/validate-docs/index.ts | 34 +++++ .../eslint-plugin/tools/validate-docs/log.ts | 20 +++ .../tools/validate-docs/parse-readme.ts | 29 +++++ .../validate-docs/validate-table-rules.ts | 123 ++++++++++++++++++ .../validate-docs/validate-table-structure.ts | 48 +++++++ .../src/eslint-utils/RuleCreator.ts | 7 +- yarn.lock | 73 ++--------- 60 files changed, 405 insertions(+), 181 deletions(-) create mode 100644 packages/eslint-plugin/tools/validate-docs/check-for-rule-docs.ts create mode 100644 packages/eslint-plugin/tools/validate-docs/index.ts create mode 100644 packages/eslint-plugin/tools/validate-docs/log.ts create mode 100644 packages/eslint-plugin/tools/validate-docs/parse-readme.ts create mode 100644 packages/eslint-plugin/tools/validate-docs/validate-table-rules.ts create mode 100644 packages/eslint-plugin/tools/validate-docs/validate-table-structure.ts diff --git a/.prettierignore b/.prettierignore index 755a2771d25..2b05b38a1ee 100644 --- a/.prettierignore +++ b/.prettierignore @@ -7,3 +7,4 @@ **/.nyc_output packages/eslint-plugin-tslint/tests/test-tslint-rules-directory/alwaysFailRule.js .github +packages/eslint-plugin/src/configs/*.json diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 911aa93bb3c..8dcbd9ea422 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -31,6 +31,10 @@ jobs: yarn lint displayName: 'Run linting' + - script: | + yarn docs:check + displayName: 'Validate documentation' + - script: | yarn test displayName: 'Run unit tests' diff --git a/package.json b/package.json index 8d9760c2c25..a8ac88c3719 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "build": "lerna run build", "clean": "lerna clean && lerna run clean", "cz": "git-cz", + "docs:check": "lerna run docs:check", "generate-contributors": "yarn ts-node ./tools/generate-contributors.ts && yarn all-contributors generate", "format": "prettier --write \"./**/*.{ts,js,json,md}\"", "format-check": "prettier --list-different \"./**/*.{ts,js,json,md}\"", diff --git a/packages/eslint-plugin/README.md b/packages/eslint-plugin/README.md index 24ada799b9a..18dc3a6e6cd 100644 --- a/packages/eslint-plugin/README.md +++ b/packages/eslint-plugin/README.md @@ -110,59 +110,59 @@ Then you should add `airbnb` (or `airbnb-base`) to your `extends` section of `.e | Name | Description | :heavy_check_mark: | :wrench: | :thought_balloon: | | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | -------- | ----------------- | -| [`@typescript-eslint/adjacent-overload-signatures`](./docs/rules/adjacent-overload-signatures.md) | Require that member overloads be consecutive (`adjacent-overload-signatures` from TSLint) | :heavy_check_mark: | | | -| [`@typescript-eslint/array-type`](./docs/rules/array-type.md) | Requires using either `T[]` or `Array` for arrays (`array-type` from TSLint) | :heavy_check_mark: | :wrench: | | -| [`@typescript-eslint/await-thenable`](./docs/rules/await-thenable.md) | Disallow awaiting a value that is not a Promise (`await-promise` from TSLint) | | | :thought_balloon: | -| [`@typescript-eslint/ban-ts-ignore`](./docs/rules/ban-ts-ignore.md) | Bans “// @ts-ignore” comments from being used (`ban-ts-ignore` from TSLint) | | | | -| [`@typescript-eslint/ban-types`](./docs/rules/ban-types.md) | Enforces that types will not to be used (`ban-types` from TSLint) | :heavy_check_mark: | :wrench: | | +| [`@typescript-eslint/adjacent-overload-signatures`](./docs/rules/adjacent-overload-signatures.md) | Require that member overloads be consecutive | :heavy_check_mark: | | | +| [`@typescript-eslint/array-type`](./docs/rules/array-type.md) | Requires using either `T[]` or `Array` for arrays | :heavy_check_mark: | :wrench: | | +| [`@typescript-eslint/await-thenable`](./docs/rules/await-thenable.md) | Disallows awaiting a value that is not a Thenable | | | :thought_balloon: | +| [`@typescript-eslint/ban-ts-ignore`](./docs/rules/ban-ts-ignore.md) | Bans “// @ts-ignore” comments from being used | | | | +| [`@typescript-eslint/ban-types`](./docs/rules/ban-types.md) | Enforces that types will not to be used | :heavy_check_mark: | :wrench: | | | [`@typescript-eslint/camelcase`](./docs/rules/camelcase.md) | Enforce camelCase naming convention | :heavy_check_mark: | | | -| [`@typescript-eslint/class-name-casing`](./docs/rules/class-name-casing.md) | Require PascalCased class and interface names (`class-name` from TSLint) | :heavy_check_mark: | | | +| [`@typescript-eslint/class-name-casing`](./docs/rules/class-name-casing.md) | Require PascalCased class and interface names | :heavy_check_mark: | | | | [`@typescript-eslint/explicit-function-return-type`](./docs/rules/explicit-function-return-type.md) | Require explicit return types on functions and class methods | :heavy_check_mark: | | | -| [`@typescript-eslint/explicit-member-accessibility`](./docs/rules/explicit-member-accessibility.md) | Require explicit accessibility modifiers on class properties and methods (`member-access` from TSLint) | :heavy_check_mark: | | | -| [`@typescript-eslint/func-call-spacing`](./docs/rules/func-call-spacing.md) | Spacing between function identifiers and their invocations | | :wrench: | | +| [`@typescript-eslint/explicit-member-accessibility`](./docs/rules/explicit-member-accessibility.md) | Require explicit accessibility modifiers on class properties and methods | :heavy_check_mark: | | | +| [`@typescript-eslint/func-call-spacing`](./docs/rules/func-call-spacing.md) | Require or disallow spacing between function identifiers and their invocations | | :wrench: | | | [`@typescript-eslint/generic-type-naming`](./docs/rules/generic-type-naming.md) | Enforces naming of generic type variables | | | | -| [`@typescript-eslint/indent`](./docs/rules/indent.md) | Enforce consistent indentation (`indent` from TSLint) | :heavy_check_mark: | :wrench: | | -| [`@typescript-eslint/interface-name-prefix`](./docs/rules/interface-name-prefix.md) | Require that interface names be prefixed with `I` (`interface-name` from TSLint) | :heavy_check_mark: | | | +| [`@typescript-eslint/indent`](./docs/rules/indent.md) | Enforce consistent indentation | :heavy_check_mark: | :wrench: | | +| [`@typescript-eslint/interface-name-prefix`](./docs/rules/interface-name-prefix.md) | Require that interface names be prefixed with `I` | :heavy_check_mark: | | | | [`@typescript-eslint/member-delimiter-style`](./docs/rules/member-delimiter-style.md) | Require a specific member delimiter style for interfaces and type literals | :heavy_check_mark: | :wrench: | | -| [`@typescript-eslint/member-naming`](./docs/rules/member-naming.md) | Enforces naming conventions for class members by visibility. | | | | -| [`@typescript-eslint/member-ordering`](./docs/rules/member-ordering.md) | Require a consistent member declaration order (`member-ordering` from TSLint) | | | | -| [`@typescript-eslint/no-angle-bracket-type-assertion`](./docs/rules/no-angle-bracket-type-assertion.md) | Enforces the use of `as Type` assertions instead of `` assertions (`no-angle-bracket-type-assertion` from TSLint) | :heavy_check_mark: | | | +| [`@typescript-eslint/member-naming`](./docs/rules/member-naming.md) | Enforces naming conventions for class members by visibility | | | | +| [`@typescript-eslint/member-ordering`](./docs/rules/member-ordering.md) | Require a consistent member declaration order | | | | +| [`@typescript-eslint/no-angle-bracket-type-assertion`](./docs/rules/no-angle-bracket-type-assertion.md) | Enforces the use of `as Type` assertions instead of `` assertions | :heavy_check_mark: | | | | [`@typescript-eslint/no-array-constructor`](./docs/rules/no-array-constructor.md) | Disallow generic `Array` constructors | :heavy_check_mark: | :wrench: | | -| [`@typescript-eslint/no-empty-interface`](./docs/rules/no-empty-interface.md) | Disallow the declaration of empty interfaces (`no-empty-interface` from TSLint) | :heavy_check_mark: | | | -| [`@typescript-eslint/no-explicit-any`](./docs/rules/no-explicit-any.md) | Disallow usage of the `any` type (`no-any` from TSLint) | :heavy_check_mark: | | | +| [`@typescript-eslint/no-empty-interface`](./docs/rules/no-empty-interface.md) | Disallow the declaration of empty interfaces | :heavy_check_mark: | | | +| [`@typescript-eslint/no-explicit-any`](./docs/rules/no-explicit-any.md) | Disallow usage of the `any` type | :heavy_check_mark: | | | | [`@typescript-eslint/no-extra-parens`](./docs/rules/no-extra-parens.md) | Disallow unnecessary parentheses | | :wrench: | | -| [`@typescript-eslint/no-extraneous-class`](./docs/rules/no-extraneous-class.md) | Forbids the use of classes as namespaces (`no-unnecessary-class` from TSLint) | | | | -| [`@typescript-eslint/no-for-in-array`](./docs/rules/no-for-in-array.md) | Disallow iterating over an array with a for-in loop (`no-for-in-array` from TSLint) | | | :thought_balloon: | -| [`@typescript-eslint/no-inferrable-types`](./docs/rules/no-inferrable-types.md) | Disallows explicit type declarations for variables or parameters initialized to a number, string, or boolean. (`no-inferrable-types` from TSLint) | :heavy_check_mark: | :wrench: | | -| [`@typescript-eslint/no-magic-numbers`](./docs/rules/no-magic-numbers.md) | Disallows magic numbers. | :heavy_check_mark: | | -| [`@typescript-eslint/no-misused-new`](./docs/rules/no-misused-new.md) | Enforce valid definition of `new` and `constructor`. (`no-misused-new` from TSLint) | :heavy_check_mark: | | | -| [`@typescript-eslint/no-namespace`](./docs/rules/no-namespace.md) | Disallow the use of custom TypeScript modules and namespaces (`no-namespace` from TSLint) | :heavy_check_mark: | | | -| [`@typescript-eslint/no-non-null-assertion`](./docs/rules/no-non-null-assertion.md) | Disallows non-null assertions using the `!` postfix operator (`no-non-null-assertion` from TSLint) | :heavy_check_mark: | | | -| [`@typescript-eslint/no-object-literal-type-assertion`](./docs/rules/no-object-literal-type-assertion.md) | Forbids an object literal to appear in a type assertion expression (`no-object-literal-type-assertion` from TSLint) | :heavy_check_mark: | | | -| [`@typescript-eslint/no-parameter-properties`](./docs/rules/no-parameter-properties.md) | Disallow the use of parameter properties in class constructors. (`no-parameter-properties` from TSLint) | :heavy_check_mark: | | | -| [`@typescript-eslint/no-require-imports`](./docs/rules/no-require-imports.md) | Disallows invocation of `require()` (`no-require-imports` from TSLint) | | | | -| [`@typescript-eslint/no-this-alias`](./docs/rules/no-this-alias.md) | Disallow aliasing `this` (`no-this-assignment` from TSLint) | | | | -| [`@typescript-eslint/no-triple-slash-reference`](./docs/rules/no-triple-slash-reference.md) | Disallow `/// ` comments (`no-reference` from TSLint) | :heavy_check_mark: | | | -| [`@typescript-eslint/no-type-alias`](./docs/rules/no-type-alias.md) | Disallow the use of type aliases (`interface-over-type-literal` from TSLint) | | | | -| [`@typescript-eslint/no-unnecessary-qualifier`](./docs/rules/no-unnecessary-qualifier.md) | Warns when a namespace qualifier is unnecessary (`no-unnecessary-qualifier` from TSLint) | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-unnecessary-type-assertion`](./docs/rules/no-unnecessary-type-assertion.md) | Warns if a type assertion does not change the type of an expression (`no-unnecessary-type-assertion` from TSLint) | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-unused-vars`](./docs/rules/no-unused-vars.md) | Disallow unused variables (`no-unused-variable` from TSLint) | :heavy_check_mark: | | | +| [`@typescript-eslint/no-extraneous-class`](./docs/rules/no-extraneous-class.md) | Forbids the use of classes as namespaces | | | | +| [`@typescript-eslint/no-for-in-array`](./docs/rules/no-for-in-array.md) | Disallow iterating over an array with a for-in loop | | | :thought_balloon: | +| [`@typescript-eslint/no-inferrable-types`](./docs/rules/no-inferrable-types.md) | Disallows explicit type declarations for variables or parameters initialized to a number, string, or boolean | :heavy_check_mark: | :wrench: | | +| [`@typescript-eslint/no-magic-numbers`](./docs/rules/no-magic-numbers.md) | Disallows magic numbers | | | | +| [`@typescript-eslint/no-misused-new`](./docs/rules/no-misused-new.md) | Enforce valid definition of `new` and `constructor` | :heavy_check_mark: | | | +| [`@typescript-eslint/no-namespace`](./docs/rules/no-namespace.md) | Disallow the use of custom TypeScript modules and namespaces | :heavy_check_mark: | | | +| [`@typescript-eslint/no-non-null-assertion`](./docs/rules/no-non-null-assertion.md) | Disallows non-null assertions using the `!` postfix operator | :heavy_check_mark: | | | +| [`@typescript-eslint/no-object-literal-type-assertion`](./docs/rules/no-object-literal-type-assertion.md) | Forbids an object literal to appear in a type assertion expression | :heavy_check_mark: | | | +| [`@typescript-eslint/no-parameter-properties`](./docs/rules/no-parameter-properties.md) | Disallow the use of parameter properties in class constructors | :heavy_check_mark: | | | +| [`@typescript-eslint/no-require-imports`](./docs/rules/no-require-imports.md) | Disallows invocation of `require()` | | | | +| [`@typescript-eslint/no-this-alias`](./docs/rules/no-this-alias.md) | Disallow aliasing `this` | | | | +| [`@typescript-eslint/no-triple-slash-reference`](./docs/rules/no-triple-slash-reference.md) | Disallow `/// ` comments | :heavy_check_mark: | | | +| [`@typescript-eslint/no-type-alias`](./docs/rules/no-type-alias.md) | Disallow the use of type aliases | | | | +| [`@typescript-eslint/no-unnecessary-qualifier`](./docs/rules/no-unnecessary-qualifier.md) | Warns when a namespace qualifier is unnecessary | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/no-unnecessary-type-assertion`](./docs/rules/no-unnecessary-type-assertion.md) | Warns if a type assertion does not change the type of an expression | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/no-unused-vars`](./docs/rules/no-unused-vars.md) | Disallow unused variables | :heavy_check_mark: | | | | [`@typescript-eslint/no-use-before-define`](./docs/rules/no-use-before-define.md) | Disallow the use of variables before they are defined | :heavy_check_mark: | | | | [`@typescript-eslint/no-useless-constructor`](./docs/rules/no-useless-constructor.md) | Disallow unnecessary constructors | | | | -| [`@typescript-eslint/no-var-requires`](./docs/rules/no-var-requires.md) | Disallows the use of require statements except in import statements (`no-var-requires` from TSLint) | :heavy_check_mark: | | | -| [`@typescript-eslint/prefer-for-of`](./docs/rules/prefer-for-of.md) | Prefer a ‘for-of’ loop over a standard ‘for’ loop if the index is only used to access the array being iterated. | | | | -| [`@typescript-eslint/prefer-function-type`](./docs/rules/prefer-function-type.md) | Use function types instead of interfaces with call signatures (`callable-types` from TSLint) | | :wrench: | | -| [`@typescript-eslint/prefer-includes`](./docs/rules/prefer-includes.md) | Enforce `includes` method over `indexOf` method. | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-interface`](./docs/rules/prefer-interface.md) | Prefer an interface declaration over a type literal (type T = { ... }) (`interface-over-type-literal` from TSLint) | :heavy_check_mark: | :wrench: | | -| [`@typescript-eslint/prefer-namespace-keyword`](./docs/rules/prefer-namespace-keyword.md) | Require the use of the `namespace` keyword instead of the `module` keyword to declare custom TypeScript modules. (`no-internal-module` from TSLint) | :heavy_check_mark: | :wrench: | | -| [`@typescript-eslint/prefer-string-starts-ends-with`](./docs/rules/prefer-string-starts-ends-with.md) | Enforce the use of `String#startsWith` and `String#endsWith` instead of other equivalent methods of checking substrings | | :wrench: | | -| [`@typescript-eslint/promise-function-async`](./docs/rules/promise-function-async.md) | Requires any function or method that returns a Promise to be marked async. (`promise-function-async` from TSLint) | | | :thought_balloon: | -| [`@typescript-eslint/require-array-sort-compare`](./docs/rules/require-array-sort-compare.md) | Enforce giving `compare` argument to `Array#sort` | | | | -| [`@typescript-eslint/restrict-plus-operands`](./docs/rules/restrict-plus-operands.md) | When adding two variables, operands must both be of type number or of type string. (`restrict-plus-operands` from TSLint) | | | :thought_balloon: | +| [`@typescript-eslint/no-var-requires`](./docs/rules/no-var-requires.md) | Disallows the use of require statements except in import statements | :heavy_check_mark: | | | +| [`@typescript-eslint/prefer-for-of`](./docs/rules/prefer-for-of.md) | Prefer a ‘for-of’ loop over a standard ‘for’ loop if the index is only used to access the array being iterated | | | | +| [`@typescript-eslint/prefer-function-type`](./docs/rules/prefer-function-type.md) | Use function types instead of interfaces with call signatures | | :wrench: | | +| [`@typescript-eslint/prefer-includes`](./docs/rules/prefer-includes.md) | Enforce `includes` method over `indexOf` method | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/prefer-interface`](./docs/rules/prefer-interface.md) | Prefer an interface declaration over a type literal (type T = { ... }) | :heavy_check_mark: | :wrench: | | +| [`@typescript-eslint/prefer-namespace-keyword`](./docs/rules/prefer-namespace-keyword.md) | Require the use of the `namespace` keyword instead of the `module` keyword to declare custom TypeScript modules | :heavy_check_mark: | :wrench: | | +| [`@typescript-eslint/prefer-regexp-exec`](./docs/rules/prefer-regexp-exec.md) | Prefer RegExp#exec() over String#match() if no global flag is provided | | | :thought_balloon: | +| [`@typescript-eslint/prefer-string-starts-ends-with`](./docs/rules/prefer-string-starts-ends-with.md) | Enforce the use of `String#startsWith` and `String#endsWith` instead of other equivalent methods of checking substrings | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/promise-function-async`](./docs/rules/promise-function-async.md) | Requires any function or method that returns a Promise to be marked async | | | :thought_balloon: | +| [`@typescript-eslint/require-array-sort-compare`](./docs/rules/require-array-sort-compare.md) | Enforce giving `compare` argument to `Array#sort` | | | :thought_balloon: | +| [`@typescript-eslint/restrict-plus-operands`](./docs/rules/restrict-plus-operands.md) | When adding two variables, operands must both be of type number or of type string | | | :thought_balloon: | | [`@typescript-eslint/semi`](./docs/rules/semi.md) | Require or disallow semicolons instead of ASI | | :wrench: | | -| [`@typescript-eslint/type-annotation-spacing`](./docs/rules/type-annotation-spacing.md) | Require consistent spacing around type annotations (`typedef-whitespace` from TSLint) | :heavy_check_mark: | :wrench: | | -| [`@typescript-eslint/unbound-method`](./docs/rules/unbound-method.md) | Enforces unbound methods are called with their expected scope. (`no-unbound-method` from TSLint) | | | :thought_balloon: | -| [`@typescript-eslint/prefer-regexp-exec`](./docs/rules/prefer-regexp-exec.md) | Enforce to use `RegExp#exec` over `String#match` | | | :thought_balloon: | -| [`@typescript-eslint/unified-signatures`](./docs/rules/unified-signatures.md) | Warns for any two overloads that could be unified into one. (`unified-signatures` from TSLint) | | | | +| [`@typescript-eslint/type-annotation-spacing`](./docs/rules/type-annotation-spacing.md) | Require consistent spacing around type annotations | :heavy_check_mark: | :wrench: | | +| [`@typescript-eslint/unbound-method`](./docs/rules/unbound-method.md) | Enforces unbound methods are called with their expected scope | | | :thought_balloon: | +| [`@typescript-eslint/unified-signatures`](./docs/rules/unified-signatures.md) | Warns for any two overloads that could be unified into one by using a union or an optional/rest parameter | | | | diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index a52aacc2352..bbefaa09b00 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -28,12 +28,12 @@ "build": "tsc -p tsconfig.build.json", "clean": "rimraf dist/", "docs": "eslint-docs", - "docs:check": "eslint-docs check", - "test": "jest --coverage", - "generate:configs": "ts-node --files tools/generate-configs.ts", + "docs:check": "ts-node --files ./tools/validate-docs/index.ts", "format": "prettier --write \"./**/*.{ts,js,json,md}\" --ignore-path ../../.prettierignore", + "generate:configs": "ts-node --files tools/generate-configs.ts", "prebuild": "npm run clean", "recommended:update": "ts-node tools/update-recommended.ts", + "test": "jest --coverage", "typecheck": "tsc --noEmit" }, "dependencies": { @@ -44,7 +44,9 @@ "tsutils": "^3.7.0" }, "devDependencies": { - "eslint-docs": "^0.2.6" + "@types/marked": "^0.6.5", + "chalk": "^2.4.2", + "marked": "^0.6.2" }, "peerDependencies": { "@typescript-eslint/parser": "1.9.0", diff --git a/packages/eslint-plugin/src/configs/all.json b/packages/eslint-plugin/src/configs/all.json index fa36e3d876c..cc2f9778671 100644 --- a/packages/eslint-plugin/src/configs/all.json +++ b/packages/eslint-plugin/src/configs/all.json @@ -11,6 +11,7 @@ "@typescript-eslint/class-name-casing": "error", "@typescript-eslint/explicit-function-return-type": "error", "@typescript-eslint/explicit-member-accessibility": "error", + "func-call-spacing": "off", "@typescript-eslint/func-call-spacing": "error", "@typescript-eslint/generic-type-naming": "error", "indent": "off", @@ -24,10 +25,12 @@ "@typescript-eslint/no-array-constructor": "error", "@typescript-eslint/no-empty-interface": "error", "@typescript-eslint/no-explicit-any": "error", + "no-extra-parens": "off", "@typescript-eslint/no-extra-parens": "error", "@typescript-eslint/no-extraneous-class": "error", "@typescript-eslint/no-for-in-array": "error", "@typescript-eslint/no-inferrable-types": "error", + "no-magic-numbers": "off", "@typescript-eslint/no-magic-numbers": "error", "@typescript-eslint/no-misused-new": "error", "@typescript-eslint/no-namespace": "error", @@ -42,6 +45,7 @@ "@typescript-eslint/no-unnecessary-type-assertion": "error", "no-unused-vars": "off", "@typescript-eslint/no-unused-vars": "error", + "no-use-before-define": "off", "@typescript-eslint/no-use-before-define": "error", "no-useless-constructor": "off", "@typescript-eslint/no-useless-constructor": "error", @@ -56,6 +60,7 @@ "@typescript-eslint/promise-function-async": "error", "@typescript-eslint/require-array-sort-compare": "error", "@typescript-eslint/restrict-plus-operands": "error", + "semi": "off", "@typescript-eslint/semi": "error", "@typescript-eslint/type-annotation-spacing": "error", "@typescript-eslint/unbound-method": "error", diff --git a/packages/eslint-plugin/src/configs/recommended.json b/packages/eslint-plugin/src/configs/recommended.json index 12edb521fe8..d26fd25d01c 100644 --- a/packages/eslint-plugin/src/configs/recommended.json +++ b/packages/eslint-plugin/src/configs/recommended.json @@ -27,6 +27,7 @@ "@typescript-eslint/no-triple-slash-reference": "error", "no-unused-vars": "off", "@typescript-eslint/no-unused-vars": "warn", + "no-use-before-define": "off", "@typescript-eslint/no-use-before-define": "error", "@typescript-eslint/no-var-requires": "error", "@typescript-eslint/prefer-interface": "error", diff --git a/packages/eslint-plugin/src/rules/adjacent-overload-signatures.ts b/packages/eslint-plugin/src/rules/adjacent-overload-signatures.ts index 80c8b131587..b2f22b8a0aa 100644 --- a/packages/eslint-plugin/src/rules/adjacent-overload-signatures.ts +++ b/packages/eslint-plugin/src/rules/adjacent-overload-signatures.ts @@ -19,7 +19,6 @@ export default util.createRule({ docs: { description: 'Require that member overloads be consecutive', category: 'Best Practices', - tslintName: 'adjacent-overload-signatures', recommended: 'error', }, schema: [], diff --git a/packages/eslint-plugin/src/rules/array-type.ts b/packages/eslint-plugin/src/rules/array-type.ts index 62ace5d4317..12b425fdd54 100644 --- a/packages/eslint-plugin/src/rules/array-type.ts +++ b/packages/eslint-plugin/src/rules/array-type.ts @@ -85,7 +85,6 @@ export default util.createRule({ type: 'suggestion', docs: { description: 'Requires using either `T[]` or `Array` for arrays', - tslintRuleName: 'array-type', category: 'Stylistic Issues', recommended: 'error', }, diff --git a/packages/eslint-plugin/src/rules/await-thenable.ts b/packages/eslint-plugin/src/rules/await-thenable.ts index f9981920fab..7a5db98db9c 100644 --- a/packages/eslint-plugin/src/rules/await-thenable.ts +++ b/packages/eslint-plugin/src/rules/await-thenable.ts @@ -10,7 +10,6 @@ export default util.createRule({ description: 'Disallows awaiting a value that is not a Thenable', category: 'Best Practices', recommended: false, - tslintName: 'await-thenable', }, messages: { await: 'Unexpected `await` of a non-Promise (non-"Thenable") value.', diff --git a/packages/eslint-plugin/src/rules/ban-ts-ignore.ts b/packages/eslint-plugin/src/rules/ban-ts-ignore.ts index 661031a03f7..87af895627d 100644 --- a/packages/eslint-plugin/src/rules/ban-ts-ignore.ts +++ b/packages/eslint-plugin/src/rules/ban-ts-ignore.ts @@ -5,8 +5,7 @@ export default util.createRule({ meta: { type: 'problem', docs: { - description: 'Bans “// @ts-ignore” comments from being used.', - tslintRuleName: 'ban-ts-ignore', + description: 'Bans “// @ts-ignore” comments from being used', category: 'Best Practices', recommended: false, }, diff --git a/packages/eslint-plugin/src/rules/ban-types.ts b/packages/eslint-plugin/src/rules/ban-types.ts index 25c0a08f3ab..059f7302024 100644 --- a/packages/eslint-plugin/src/rules/ban-types.ts +++ b/packages/eslint-plugin/src/rules/ban-types.ts @@ -26,7 +26,6 @@ export default util.createRule({ type: 'suggestion', docs: { description: 'Enforces that types will not to be used', - tslintRuleName: 'ban-types', category: 'Best Practices', recommended: 'error', }, diff --git a/packages/eslint-plugin/src/rules/class-name-casing.ts b/packages/eslint-plugin/src/rules/class-name-casing.ts index 829f29f24b8..1c76edd118b 100644 --- a/packages/eslint-plugin/src/rules/class-name-casing.ts +++ b/packages/eslint-plugin/src/rules/class-name-casing.ts @@ -10,7 +10,6 @@ export default util.createRule({ type: 'suggestion', docs: { description: 'Require PascalCased class and interface names', - tslintRuleName: 'class-name', category: 'Best Practices', recommended: 'error', }, diff --git a/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts b/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts index d760f18ea94..4fea64e99eb 100644 --- a/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts +++ b/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts @@ -33,7 +33,6 @@ export default util.createRule({ docs: { description: 'Require explicit accessibility modifiers on class properties and methods', - tslintRuleName: 'member-access', category: 'Best Practices', recommended: 'error', }, diff --git a/packages/eslint-plugin/src/rules/func-call-spacing.ts b/packages/eslint-plugin/src/rules/func-call-spacing.ts index fd395887480..b6420781654 100644 --- a/packages/eslint-plugin/src/rules/func-call-spacing.ts +++ b/packages/eslint-plugin/src/rules/func-call-spacing.ts @@ -16,7 +16,7 @@ export default util.createRule({ type: 'layout', docs: { description: - 'require or disallow spacing between function identifiers and their invocations', + 'Require or disallow spacing between function identifiers and their invocations', category: 'Stylistic Issues', recommended: false, }, diff --git a/packages/eslint-plugin/src/rules/indent.ts b/packages/eslint-plugin/src/rules/indent.ts index 6a7a5c31e13..6b2a83066dd 100644 --- a/packages/eslint-plugin/src/rules/indent.ts +++ b/packages/eslint-plugin/src/rules/indent.ts @@ -88,7 +88,6 @@ export default util.createRule({ type: 'layout', docs: { description: 'Enforce consistent indentation', - tslintRuleName: 'indent', category: 'Stylistic Issues', recommended: 'error', }, diff --git a/packages/eslint-plugin/src/rules/interface-name-prefix.ts b/packages/eslint-plugin/src/rules/interface-name-prefix.ts index b9c3b91a052..1af78f79a53 100644 --- a/packages/eslint-plugin/src/rules/interface-name-prefix.ts +++ b/packages/eslint-plugin/src/rules/interface-name-prefix.ts @@ -9,7 +9,6 @@ export default util.createRule({ type: 'suggestion', docs: { description: 'Require that interface names be prefixed with `I`', - tslintRuleName: 'interface-name', category: 'Stylistic Issues', recommended: 'error', }, diff --git a/packages/eslint-plugin/src/rules/member-naming.ts b/packages/eslint-plugin/src/rules/member-naming.ts index 7c221360c0c..9995b6cf1e3 100644 --- a/packages/eslint-plugin/src/rules/member-naming.ts +++ b/packages/eslint-plugin/src/rules/member-naming.ts @@ -16,7 +16,7 @@ export default util.createRule({ type: 'suggestion', docs: { description: - 'Enforces naming conventions for class members by visibility.', + 'Enforces naming conventions for class members by visibility', category: 'Stylistic Issues', recommended: false, }, diff --git a/packages/eslint-plugin/src/rules/member-ordering.ts b/packages/eslint-plugin/src/rules/member-ordering.ts index ffcc6985073..25dd2f79ca1 100644 --- a/packages/eslint-plugin/src/rules/member-ordering.ts +++ b/packages/eslint-plugin/src/rules/member-ordering.ts @@ -46,7 +46,6 @@ export default util.createRule({ type: 'suggestion', docs: { description: 'Require a consistent member declaration order', - tslintRuleName: 'member-ordering', category: 'Stylistic Issues', recommended: false, }, diff --git a/packages/eslint-plugin/src/rules/no-angle-bracket-type-assertion.ts b/packages/eslint-plugin/src/rules/no-angle-bracket-type-assertion.ts index 630847ff57a..82848a07196 100644 --- a/packages/eslint-plugin/src/rules/no-angle-bracket-type-assertion.ts +++ b/packages/eslint-plugin/src/rules/no-angle-bracket-type-assertion.ts @@ -7,7 +7,6 @@ export default util.createRule({ docs: { description: 'Enforces the use of `as Type` assertions instead of `` assertions', - tslintRuleName: 'no-angle-bracket-type-assertion', category: 'Stylistic Issues', recommended: 'error', }, diff --git a/packages/eslint-plugin/src/rules/no-empty-interface.ts b/packages/eslint-plugin/src/rules/no-empty-interface.ts index 3bf4d72a622..277e9ebb313 100644 --- a/packages/eslint-plugin/src/rules/no-empty-interface.ts +++ b/packages/eslint-plugin/src/rules/no-empty-interface.ts @@ -13,7 +13,6 @@ export default util.createRule({ type: 'suggestion', docs: { description: 'Disallow the declaration of empty interfaces', - tslintRuleName: 'no-empty-interface', category: 'Best Practices', recommended: 'error', }, diff --git a/packages/eslint-plugin/src/rules/no-explicit-any.ts b/packages/eslint-plugin/src/rules/no-explicit-any.ts index 7b27ee0bcd8..541b0acb1df 100644 --- a/packages/eslint-plugin/src/rules/no-explicit-any.ts +++ b/packages/eslint-plugin/src/rules/no-explicit-any.ts @@ -6,7 +6,6 @@ export default util.createRule({ type: 'suggestion', docs: { description: 'Disallow usage of the `any` type', - tslintRuleName: 'no-any', category: 'Best Practices', recommended: 'warn', }, diff --git a/packages/eslint-plugin/src/rules/no-extra-parens.ts b/packages/eslint-plugin/src/rules/no-extra-parens.ts index 1b12e38e6ec..8f94fc1fa9d 100644 --- a/packages/eslint-plugin/src/rules/no-extra-parens.ts +++ b/packages/eslint-plugin/src/rules/no-extra-parens.ts @@ -14,7 +14,7 @@ export default util.createRule({ meta: { type: 'layout', docs: { - description: 'disallow unnecessary parentheses', + description: 'Disallow unnecessary parentheses', category: 'Possible Errors', recommended: false, }, diff --git a/packages/eslint-plugin/src/rules/no-extraneous-class.ts b/packages/eslint-plugin/src/rules/no-extraneous-class.ts index b0917b5ae72..29928b6709d 100644 --- a/packages/eslint-plugin/src/rules/no-extraneous-class.ts +++ b/packages/eslint-plugin/src/rules/no-extraneous-class.ts @@ -19,7 +19,6 @@ export default util.createRule({ type: 'suggestion', docs: { description: 'Forbids the use of classes as namespaces', - tslintRuleName: 'no-unnecessary-class', category: 'Best Practices', recommended: false, }, diff --git a/packages/eslint-plugin/src/rules/no-for-in-array.ts b/packages/eslint-plugin/src/rules/no-for-in-array.ts index b61bc7ca9df..970c621887e 100644 --- a/packages/eslint-plugin/src/rules/no-for-in-array.ts +++ b/packages/eslint-plugin/src/rules/no-for-in-array.ts @@ -8,7 +8,6 @@ export default util.createRule({ description: 'Disallow iterating over an array with a for-in loop', category: 'Best Practices', recommended: false, - tslintName: 'no-for-in-array', }, messages: { forInViolation: diff --git a/packages/eslint-plugin/src/rules/no-inferrable-types.ts b/packages/eslint-plugin/src/rules/no-inferrable-types.ts index 3546cd1112d..e9db74cab3f 100644 --- a/packages/eslint-plugin/src/rules/no-inferrable-types.ts +++ b/packages/eslint-plugin/src/rules/no-inferrable-types.ts @@ -18,8 +18,7 @@ export default util.createRule({ type: 'suggestion', docs: { description: - 'Disallows explicit type declarations for variables or parameters initialized to a number, string, or boolean.', - tslintRuleName: 'no-inferrable-types', + 'Disallows explicit type declarations for variables or parameters initialized to a number, string, or boolean', category: 'Best Practices', recommended: 'error', }, diff --git a/packages/eslint-plugin/src/rules/no-magic-numbers.ts b/packages/eslint-plugin/src/rules/no-magic-numbers.ts index 49689213992..f298bfd68f2 100644 --- a/packages/eslint-plugin/src/rules/no-magic-numbers.ts +++ b/packages/eslint-plugin/src/rules/no-magic-numbers.ts @@ -1,8 +1,3 @@ -/** - * @fileoverview Rule to flag statements that use magic numbers (adapted from https://github.com/danielstjules/buddy.js) - * @author Scott O'Hara - */ - import { TSESTree, AST_NODE_TYPES, @@ -21,7 +16,7 @@ export default util.createRule({ meta: { type: 'suggestion', docs: { - description: 'Disallow magic numbers', + description: 'Disallows magic numbers', category: 'Best Practices', recommended: false, }, diff --git a/packages/eslint-plugin/src/rules/no-misused-new.ts b/packages/eslint-plugin/src/rules/no-misused-new.ts index 56c5eb5f296..aa9d0cb366c 100644 --- a/packages/eslint-plugin/src/rules/no-misused-new.ts +++ b/packages/eslint-plugin/src/rules/no-misused-new.ts @@ -9,8 +9,7 @@ export default util.createRule({ meta: { type: 'problem', docs: { - description: 'Enforce valid definition of `new` and `constructor`.', - tslintRuleName: 'no-misused-new', + description: 'Enforce valid definition of `new` and `constructor`', category: 'Best Practices', recommended: 'error', }, diff --git a/packages/eslint-plugin/src/rules/no-namespace.ts b/packages/eslint-plugin/src/rules/no-namespace.ts index 2ab66102dd4..930b3067eba 100644 --- a/packages/eslint-plugin/src/rules/no-namespace.ts +++ b/packages/eslint-plugin/src/rules/no-namespace.ts @@ -19,7 +19,6 @@ export default util.createRule({ docs: { description: 'Disallow the use of custom TypeScript modules and namespaces', - tslintRuleName: 'no-namespace', category: 'Best Practices', recommended: 'error', }, diff --git a/packages/eslint-plugin/src/rules/no-non-null-assertion.ts b/packages/eslint-plugin/src/rules/no-non-null-assertion.ts index 58c0667cf1c..6ed336e4d2d 100644 --- a/packages/eslint-plugin/src/rules/no-non-null-assertion.ts +++ b/packages/eslint-plugin/src/rules/no-non-null-assertion.ts @@ -7,7 +7,6 @@ export default util.createRule({ docs: { description: 'Disallows non-null assertions using the `!` postfix operator', - tslintRuleName: 'no-non-null-assertion', category: 'Stylistic Issues', recommended: 'error', }, diff --git a/packages/eslint-plugin/src/rules/no-object-literal-type-assertion.ts b/packages/eslint-plugin/src/rules/no-object-literal-type-assertion.ts index d946c879257..f4089655337 100644 --- a/packages/eslint-plugin/src/rules/no-object-literal-type-assertion.ts +++ b/packages/eslint-plugin/src/rules/no-object-literal-type-assertion.ts @@ -18,7 +18,6 @@ export default util.createRule({ docs: { description: 'Forbids an object literal to appear in a type assertion expression', - tslintRuleName: 'no-object-literal-type-assertion', category: 'Stylistic Issues', recommended: 'error', }, diff --git a/packages/eslint-plugin/src/rules/no-parameter-properties.ts b/packages/eslint-plugin/src/rules/no-parameter-properties.ts index 6d1ffa80870..2ef515b721f 100644 --- a/packages/eslint-plugin/src/rules/no-parameter-properties.ts +++ b/packages/eslint-plugin/src/rules/no-parameter-properties.ts @@ -25,8 +25,7 @@ export default util.createRule({ type: 'problem', docs: { description: - 'Disallow the use of parameter properties in class constructors.', - tslintRuleName: 'no-parameter-properties', + 'Disallow the use of parameter properties in class constructors', category: 'Stylistic Issues', recommended: 'error', }, diff --git a/packages/eslint-plugin/src/rules/no-require-imports.ts b/packages/eslint-plugin/src/rules/no-require-imports.ts index 8bed451ccb7..afb0b4a3848 100644 --- a/packages/eslint-plugin/src/rules/no-require-imports.ts +++ b/packages/eslint-plugin/src/rules/no-require-imports.ts @@ -6,8 +6,7 @@ export default util.createRule({ meta: { type: 'problem', docs: { - description: 'Disallows invocation of `require()`.', - tslintName: 'no-require-imports', + description: 'Disallows invocation of `require()`', category: 'Best Practices', recommended: false, }, diff --git a/packages/eslint-plugin/src/rules/no-this-alias.ts b/packages/eslint-plugin/src/rules/no-this-alias.ts index 30201acf6a0..6b913539903 100644 --- a/packages/eslint-plugin/src/rules/no-this-alias.ts +++ b/packages/eslint-plugin/src/rules/no-this-alias.ts @@ -18,7 +18,6 @@ export default util.createRule({ type: 'suggestion', docs: { description: 'Disallow aliasing `this`', - tslintRuleName: 'no-this-assignment', category: 'Best Practices', recommended: false, }, diff --git a/packages/eslint-plugin/src/rules/no-triple-slash-reference.ts b/packages/eslint-plugin/src/rules/no-triple-slash-reference.ts index 6f596cd03d7..c7780a99bf3 100644 --- a/packages/eslint-plugin/src/rules/no-triple-slash-reference.ts +++ b/packages/eslint-plugin/src/rules/no-triple-slash-reference.ts @@ -6,7 +6,6 @@ export default util.createRule({ type: 'suggestion', docs: { description: 'Disallow `/// ` comments', - tslintRuleName: 'no-reference', category: 'Best Practices', recommended: 'error', }, diff --git a/packages/eslint-plugin/src/rules/no-type-alias.ts b/packages/eslint-plugin/src/rules/no-type-alias.ts index b4a4274c274..92249006455 100644 --- a/packages/eslint-plugin/src/rules/no-type-alias.ts +++ b/packages/eslint-plugin/src/rules/no-type-alias.ts @@ -36,7 +36,6 @@ export default util.createRule({ type: 'suggestion', docs: { description: 'Disallow the use of type aliases', - tslintRuleName: 'interface-over-type-literal', category: 'Stylistic Issues', recommended: false, }, diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-qualifier.ts b/packages/eslint-plugin/src/rules/no-unnecessary-qualifier.ts index f382e7262e0..23a98cb9bef 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-qualifier.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-qualifier.ts @@ -8,9 +8,8 @@ export default util.createRule({ meta: { docs: { category: 'Best Practices', - description: 'Warns when a namespace qualifier is unnecessary.', + description: 'Warns when a namespace qualifier is unnecessary', recommended: false, - tslintName: 'no-unnecessary-qualifier', }, fixable: 'code', messages: { diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-type-assertion.ts b/packages/eslint-plugin/src/rules/no-unnecessary-type-assertion.ts index c98b619eab4..765fd308653 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-type-assertion.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-type-assertion.ts @@ -28,7 +28,6 @@ export default util.createRule({ 'Warns if a type assertion does not change the type of an expression', category: 'Best Practices', recommended: false, - tslintRuleName: 'no-unnecessary-type-assertion', }, fixable: 'code', messages: { diff --git a/packages/eslint-plugin/src/rules/no-unused-vars.ts b/packages/eslint-plugin/src/rules/no-unused-vars.ts index 9fc32f6fc1c..46084af3a6b 100644 --- a/packages/eslint-plugin/src/rules/no-unused-vars.ts +++ b/packages/eslint-plugin/src/rules/no-unused-vars.ts @@ -11,7 +11,6 @@ export default util.createRule({ type: 'problem', docs: { description: 'Disallow unused variables', - tslintRuleName: 'no-unused-variable', category: 'Variables', recommended: 'warn', }, diff --git a/packages/eslint-plugin/src/rules/no-var-requires.ts b/packages/eslint-plugin/src/rules/no-var-requires.ts index a8acccd8af9..8d8e714c4f5 100644 --- a/packages/eslint-plugin/src/rules/no-var-requires.ts +++ b/packages/eslint-plugin/src/rules/no-var-requires.ts @@ -11,7 +11,6 @@ export default util.createRule({ docs: { description: 'Disallows the use of require statements except in import statements', - tslintRuleName: 'no-var-requires', category: 'Best Practices', recommended: 'error', }, diff --git a/packages/eslint-plugin/src/rules/prefer-for-of.ts b/packages/eslint-plugin/src/rules/prefer-for-of.ts index 8e829b48e9c..19551a91166 100644 --- a/packages/eslint-plugin/src/rules/prefer-for-of.ts +++ b/packages/eslint-plugin/src/rules/prefer-for-of.ts @@ -11,10 +11,9 @@ export default util.createRule({ type: 'suggestion', docs: { description: - 'Prefer a ‘for-of’ loop over a standard ‘for’ loop if the index is only used to access the array being iterated.', + 'Prefer a ‘for-of’ loop over a standard ‘for’ loop if the index is only used to access the array being iterated', category: 'Stylistic Issues', recommended: false, - tslintName: 'prefer-for-of', }, messages: { preferForOf: diff --git a/packages/eslint-plugin/src/rules/prefer-function-type.ts b/packages/eslint-plugin/src/rules/prefer-function-type.ts index 95f1a8ee3ca..f375b1bb8f2 100644 --- a/packages/eslint-plugin/src/rules/prefer-function-type.ts +++ b/packages/eslint-plugin/src/rules/prefer-function-type.ts @@ -13,7 +13,6 @@ export default util.createRule({ 'Use function types instead of interfaces with call signatures', category: 'Best Practices', recommended: false, - tslintName: 'callable-types', }, fixable: 'code', messages: { diff --git a/packages/eslint-plugin/src/rules/prefer-interface.ts b/packages/eslint-plugin/src/rules/prefer-interface.ts index 6efbf62d6a6..3197d579540 100644 --- a/packages/eslint-plugin/src/rules/prefer-interface.ts +++ b/packages/eslint-plugin/src/rules/prefer-interface.ts @@ -8,7 +8,6 @@ export default util.createRule({ docs: { description: 'Prefer an interface declaration over a type literal (type T = { ... })', - tslintRuleName: 'interface-over-type-literal', category: 'Stylistic Issues', recommended: 'error', }, diff --git a/packages/eslint-plugin/src/rules/prefer-namespace-keyword.ts b/packages/eslint-plugin/src/rules/prefer-namespace-keyword.ts index 9d60e0eed4f..6059a731a94 100644 --- a/packages/eslint-plugin/src/rules/prefer-namespace-keyword.ts +++ b/packages/eslint-plugin/src/rules/prefer-namespace-keyword.ts @@ -10,8 +10,7 @@ export default util.createRule({ type: 'suggestion', docs: { description: - 'Require the use of the `namespace` keyword instead of the `module` keyword to declare custom TypeScript modules.', - tslintRuleName: 'no-internal-module', + 'Require the use of the `namespace` keyword instead of the `module` keyword to declare custom TypeScript modules', category: 'Best Practices', recommended: 'error', }, diff --git a/packages/eslint-plugin/src/rules/prefer-regexp-exec.ts b/packages/eslint-plugin/src/rules/prefer-regexp-exec.ts index ea4e6742d05..ffcf5aef975 100644 --- a/packages/eslint-plugin/src/rules/prefer-regexp-exec.ts +++ b/packages/eslint-plugin/src/rules/prefer-regexp-exec.ts @@ -10,7 +10,7 @@ export default createRule({ type: 'suggestion', docs: { description: - 'Prefer RegExp#exec() over String#match() if no global flag is provided.', + 'Prefer RegExp#exec() over String#match() if no global flag is provided', category: 'Best Practices', recommended: false, }, diff --git a/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts b/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts index ce45e860068..67b341a8e50 100644 --- a/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts +++ b/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts @@ -18,7 +18,7 @@ export default createRule({ type: 'suggestion', docs: { description: - 'enforce the use of `String#startsWith` and `String#endsWith` instead of other equivalent methods of checking substrings', + 'Enforce the use of `String#startsWith` and `String#endsWith` instead of other equivalent methods of checking substrings', category: 'Best Practices', recommended: false, }, diff --git a/packages/eslint-plugin/src/rules/promise-function-async.ts b/packages/eslint-plugin/src/rules/promise-function-async.ts index ef041758630..885580c493f 100644 --- a/packages/eslint-plugin/src/rules/promise-function-async.ts +++ b/packages/eslint-plugin/src/rules/promise-function-async.ts @@ -18,8 +18,7 @@ export default util.createRule({ type: 'suggestion', docs: { description: - 'Requires any function or method that returns a Promise to be marked async.', - tslintName: 'promise-function-async', + 'Requires any function or method that returns a Promise to be marked async', category: 'Best Practices', recommended: false, }, diff --git a/packages/eslint-plugin/src/rules/restrict-plus-operands.ts b/packages/eslint-plugin/src/rules/restrict-plus-operands.ts index 9a3a42c8f32..6d68d5f7dfc 100644 --- a/packages/eslint-plugin/src/rules/restrict-plus-operands.ts +++ b/packages/eslint-plugin/src/rules/restrict-plus-operands.ts @@ -8,8 +8,7 @@ export default util.createRule({ type: 'problem', docs: { description: - 'When adding two variables, operands must both be of type number or of type string.', - tslintName: 'restrict-plus-operands', + 'When adding two variables, operands must both be of type number or of type string', category: 'Best Practices', recommended: false, }, diff --git a/packages/eslint-plugin/src/rules/type-annotation-spacing.ts b/packages/eslint-plugin/src/rules/type-annotation-spacing.ts index 19ef206119f..e270c0f7fec 100644 --- a/packages/eslint-plugin/src/rules/type-annotation-spacing.ts +++ b/packages/eslint-plugin/src/rules/type-annotation-spacing.ts @@ -38,7 +38,6 @@ export default util.createRule({ type: 'layout', docs: { description: 'Require consistent spacing around type annotations', - tslintRuleName: 'typedef-whitespace', category: 'Stylistic Issues', recommended: 'error', }, diff --git a/packages/eslint-plugin/src/rules/unbound-method.ts b/packages/eslint-plugin/src/rules/unbound-method.ts index cb9e388370e..88892b63417 100644 --- a/packages/eslint-plugin/src/rules/unbound-method.ts +++ b/packages/eslint-plugin/src/rules/unbound-method.ts @@ -24,8 +24,7 @@ export default util.createRule({ docs: { category: 'Best Practices', description: - 'Enforces unbound methods are called with their expected scope.', - tslintName: 'no-unbound-method', + 'Enforces unbound methods are called with their expected scope', recommended: false, }, messages: { diff --git a/packages/eslint-plugin/src/rules/unified-signatures.ts b/packages/eslint-plugin/src/rules/unified-signatures.ts index d4ea472be5e..04695fcc302 100644 --- a/packages/eslint-plugin/src/rules/unified-signatures.ts +++ b/packages/eslint-plugin/src/rules/unified-signatures.ts @@ -53,10 +53,9 @@ export default util.createRule({ meta: { docs: { description: - 'Warns for any two overloads that could be unified into one by using a union or an optional/rest parameter.', + 'Warns for any two overloads that could be unified into one by using a union or an optional/rest parameter', category: 'Variables', recommended: false, - tslintName: 'unified-signatures', }, type: 'suggestion', messages: { diff --git a/packages/eslint-plugin/tools/generate-configs.ts b/packages/eslint-plugin/tools/generate-configs.ts index 9809adc05c7..322c4aedae1 100644 --- a/packages/eslint-plugin/tools/generate-configs.ts +++ b/packages/eslint-plugin/tools/generate-configs.ts @@ -1,6 +1,7 @@ /* eslint-disable no-console */ import { TSESLint } from '@typescript-eslint/experimental-utils'; +import chalk from 'chalk'; import fs from 'fs'; import path from 'path'; import rules from '../src/rules'; @@ -17,14 +18,19 @@ interface LinterConfig extends TSESLint.Linter.Config { } const RULE_NAME_PREFIX = '@typescript-eslint/'; -const MAX_RULE_NAME_LENGTH = 32 + RULE_NAME_PREFIX.length; +const MAX_RULE_NAME_LENGTH = 32; const DEFAULT_RULE_SETTING = 'warn'; const BASE_RULES_TO_BE_OVERRIDDEN = new Set([ 'camelcase', + 'func-call-spacing', 'indent', 'no-array-constructor', + 'no-extra-parens', + 'no-magic-numbers', 'no-unused-vars', + 'no-use-before-define', 'no-useless-constructor', + 'semi', ]); const ruleEntries = Object.entries(rules); @@ -58,10 +64,22 @@ const reducer = ( : recommendation; if (BASE_RULES_TO_BE_OVERRIDDEN.has(key)) { - console.log(key.padEnd(MAX_RULE_NAME_LENGTH), '=', 'off'); + console.log( + key + .padStart(RULE_NAME_PREFIX.length + key.length) + .padEnd(RULE_NAME_PREFIX.length + MAX_RULE_NAME_LENGTH), + '=', + chalk.green('off'), + ); config[key] = 'off'; } - console.log(ruleName.padEnd(MAX_RULE_NAME_LENGTH), '=', usedSetting); + console.log( + `${chalk.dim(RULE_NAME_PREFIX)}${key.padEnd(MAX_RULE_NAME_LENGTH)}`, + '=', + usedSetting === 'error' + ? chalk.red(usedSetting) + : chalk.yellow(usedSetting), + ); config[ruleName] = usedSetting; return config; @@ -83,7 +101,10 @@ const baseConfig: LinterConfig = { }; writeConfig(baseConfig, path.resolve(__dirname, '../src/configs/base.json')); -console.log('------------------------- all.json -------------------------'); +console.log(); +console.log( + '---------------------------------- all.json ----------------------------------', +); const allConfig: LinterConfig = { extends: './configs/base.json', rules: ruleEntries.reduce( @@ -94,7 +115,10 @@ const allConfig: LinterConfig = { }; writeConfig(allConfig, path.resolve(__dirname, '../src/configs/all.json')); -console.log('--------------------- recommended.json ---------------------'); +console.log(); +console.log( + '------------------------------ recommended.json ------------------------------', +); const recommendedConfig: LinterConfig = { extends: './configs/base.json', rules: ruleEntries diff --git a/packages/eslint-plugin/tools/validate-docs/check-for-rule-docs.ts b/packages/eslint-plugin/tools/validate-docs/check-for-rule-docs.ts new file mode 100644 index 00000000000..be97971186c --- /dev/null +++ b/packages/eslint-plugin/tools/validate-docs/check-for-rule-docs.ts @@ -0,0 +1,27 @@ +import { TSESLint } from '@typescript-eslint/experimental-utils'; +import fs from 'fs'; +import path from 'path'; +import { logRule } from './log'; + +function checkForRuleDocs( + rules: Record>, +): boolean { + const ruleDocs = new Set( + fs.readdirSync(path.resolve(__dirname, '../../docs/rules')), + ); + + let hasErrors = false; + Object.keys(rules).forEach(ruleName => { + const ruleHasDoc = ruleDocs.has(`${ruleName}.md`); + hasErrors = hasErrors || !ruleHasDoc; + logRule( + ruleHasDoc, + ruleName, + `Couldn't find file docs/rules/${ruleName}.md`, + ); + }); + + return hasErrors; +} + +export { checkForRuleDocs }; diff --git a/packages/eslint-plugin/tools/validate-docs/index.ts b/packages/eslint-plugin/tools/validate-docs/index.ts new file mode 100644 index 00000000000..6273ff61c87 --- /dev/null +++ b/packages/eslint-plugin/tools/validate-docs/index.ts @@ -0,0 +1,34 @@ +import chalk from 'chalk'; +import plugin from '../../src/index'; +import { checkForRuleDocs } from './check-for-rule-docs'; +import { parseReadme } from './parse-readme'; +import { validateTableStructure } from './validate-table-structure'; +import { validateTableRules } from './validate-table-rules'; + +const { rules } = plugin; + +let hasErrors = false; +console.log(chalk.underline('Checking for rule docs')); +hasErrors = hasErrors || checkForRuleDocs(rules); + +console.log(); +console.log(chalk.underline('Valdiating README.md')); +const rulesTable = parseReadme(); + +console.log(); +console.log(chalk.italic('Checking table structure...')); +hasErrors = hasErrors || validateTableStructure(rules, rulesTable); + +console.log(); +console.log(chalk.italic('Checking rules...')); +hasErrors = hasErrors || validateTableRules(rules, rulesTable); + +if (hasErrors) { + console.log('\n\n'); + console.error( + chalk.bold.bgRed.white('There were errors found in the documentation.'), + ); + console.log('\n\n'); + // eslint-disable-next-line no-process-exit + process.exit(1); +} diff --git a/packages/eslint-plugin/tools/validate-docs/log.ts b/packages/eslint-plugin/tools/validate-docs/log.ts new file mode 100644 index 00000000000..b00ce09c500 --- /dev/null +++ b/packages/eslint-plugin/tools/validate-docs/log.ts @@ -0,0 +1,20 @@ +import chalk from 'chalk'; + +function logRule( + success: boolean, + ruleName: string, + ...messages: string[] +): void { + if (success) { + console.log(chalk.bold.green('✔'), chalk.dim(ruleName)); + } else { + logError(chalk.bold(ruleName)); + messages.forEach(m => console.error(chalk.bold.red(' -'), m)); + } +} + +function logError(...messages: string[]): void { + console.error(chalk.bold.red('✗'), ...messages); +} + +export { logError, logRule }; diff --git a/packages/eslint-plugin/tools/validate-docs/parse-readme.ts b/packages/eslint-plugin/tools/validate-docs/parse-readme.ts new file mode 100644 index 00000000000..92afaa37dd2 --- /dev/null +++ b/packages/eslint-plugin/tools/validate-docs/parse-readme.ts @@ -0,0 +1,29 @@ +import fs from 'fs'; +import marked from 'marked'; +import path from 'path'; + +function parseReadme(): marked.Tokens.Table { + const readmeRaw = fs.readFileSync( + path.resolve(__dirname, '../../README.md'), + 'utf8', + ); + const readme = marked.lexer(readmeRaw, { + gfm: true, + tables: true, + silent: false, + }); + + // find the table + const rulesTable = readme.find( + token => token.type === 'table', + ) as marked.Tokens.Table; + if (!rulesTable) { + console.error('Could not find the rules table in README.md'); + // eslint-disable-next-line no-process-exit + process.exit(1); + } + + return rulesTable; +} + +export { parseReadme }; diff --git a/packages/eslint-plugin/tools/validate-docs/validate-table-rules.ts b/packages/eslint-plugin/tools/validate-docs/validate-table-rules.ts new file mode 100644 index 00000000000..98dd40437d9 --- /dev/null +++ b/packages/eslint-plugin/tools/validate-docs/validate-table-rules.ts @@ -0,0 +1,123 @@ +import { TSESLint } from '@typescript-eslint/experimental-utils'; +import chalk from 'chalk'; +import fs from 'fs'; +import marked from 'marked'; +import path from 'path'; +import { logRule } from './log'; + +function validateTableRules( + rules: Record>, + rulesTable: marked.Tokens.Table, +): boolean { + let hasErrors = false; + + Object.entries(rules).forEach(([ruleName, rule]) => { + const row = rulesTable.cells.find(row => + row[0].includes(`/${ruleName}.md`), + ); + + if (!row) { + if (!rule.meta.deprecated) { + hasErrors = true; + logRule(false, ruleName, 'Missing entry in table'); + return; + } + + // all is well, the rule shouldn't have a row as it's deprecated + return; + } + if (row && rule.meta.deprecated) { + hasErrors = true; + logRule( + false, + ruleName, + 'Rule is marked as deprecated, should not have an entry in the table', + ); + return; + } + + const errors: string[] = []; + const [ + rowLink, + rowDescription, + rowIsRecommended, + rowIsFixable, + rowNeedsTypeInfo, + ] = row; + + function validateTableBoolean( + value: boolean, + cell: string, + trueString: string, + columnLabel: string, + ): void { + if (value && cell !== trueString) { + errors.push( + `Rule ${chalk.red( + 'not', + )} marked as ${columnLabel} when it ${chalk.bold('should')} be`, + ); + } + + if (!value && cell !== '') { + errors.push( + `Rule ${chalk.red( + 'was', + )} marked as ${columnLabel} when it ${chalk.bold('should not')} be`, + ); + } + } + + const expectedLink = `[\`@typescript-eslint/${ruleName}\`](./docs/rules/${ruleName}.md)`; + if (rowLink !== expectedLink) { + errors.push( + `Link is invalid.`, + ` Expected: ${chalk.underline(expectedLink)}`, + ` Received: ${chalk.underline(rowLink)}`, + ); + } + + const expectedDescription = rule.meta.docs.description; + if (rowDescription !== expectedDescription) { + errors.push( + 'Description does not match the rule metadata.', + ` Expected: ${chalk.underline(expectedDescription)}`, + ` Received: ${chalk.underline(rowDescription)}`, + ); + } + + validateTableBoolean( + !!rule.meta.docs.recommended, + rowIsRecommended, + ':heavy_check_mark:', + 'recommended', + ); + + validateTableBoolean( + rule.meta.fixable !== undefined, + rowIsFixable, + ':wrench:', + 'fixable', + ); + + // quick-and-dirty check to see if it uses parserServices + // not perfect but should be good enough + const ruleFileContents = fs.readFileSync( + path.resolve(__dirname, `../../src/rules/${ruleName}.ts`), + ); + const usesTypeInformation = ruleFileContents.includes('getParserServices'); + validateTableBoolean( + usesTypeInformation, + rowNeedsTypeInfo, + ':thought_balloon:', + 'requiring type information', + ); + + hasErrors = hasErrors || errors.length > 0; + logRule(errors.length === 0, ruleName, ...errors); + }); + + return hasErrors; +} + +export { validateTableRules }; diff --git a/packages/eslint-plugin/tools/validate-docs/validate-table-structure.ts b/packages/eslint-plugin/tools/validate-docs/validate-table-structure.ts new file mode 100644 index 00000000000..5c4cdbdb68b --- /dev/null +++ b/packages/eslint-plugin/tools/validate-docs/validate-table-structure.ts @@ -0,0 +1,48 @@ +import { TSESLint } from '@typescript-eslint/experimental-utils'; +import chalk from 'chalk'; +import marked from 'marked'; +import { logError } from './log'; + +function validateTableStructure( + rules: Record>, + rulesTable: marked.Tokens.Table, +): boolean { + const ruleNames = Object.keys(rules).sort(); + let hasErrors = false; + + rulesTable.cells.forEach((row, rowIndex) => { + const match = row[0].match(/\[`@typescript-eslint\/(.+)`\]/); + if (!match) { + logError(chalk.bold(`Unable to parse link in row ${rowIndex}:`), row[0]); + hasErrors = true; + return; + } + + const rowRuleName = match[1]; + const ruleIndex = ruleNames.findIndex(ruleName => rowRuleName === ruleName); + if (ruleIndex === -1) { + logError( + chalk.bold( + `Found rule ${rowRuleName} in table, but it doesn't exist in the plugin.`, + ), + ); + hasErrors = true; + return; + } + + if (ruleIndex !== rowIndex) { + console.error( + chalk.bold.red('✗'), + chalk.bold('Sorting:'), + 'Incorrect line number for', + chalk.bold(rowRuleName), + ); + hasErrors = true; + return; + } + }); + + return hasErrors; +} + +export { validateTableStructure }; diff --git a/packages/experimental-utils/src/eslint-utils/RuleCreator.ts b/packages/experimental-utils/src/eslint-utils/RuleCreator.ts index b20e70af213..c1e381af72e 100644 --- a/packages/experimental-utils/src/eslint-utils/RuleCreator.ts +++ b/packages/experimental-utils/src/eslint-utils/RuleCreator.ts @@ -14,9 +14,7 @@ type RemoveProps< > = Pick>; // we'll automatically add the url + tslint description for people. -type CreateRuleMetaDocs = RemoveProps & { - tslintName?: string; -}; +type CreateRuleMetaDocs = RemoveProps; type CreateRuleMeta = { docs: CreateRuleMetaDocs; } & RemoveProps, 'docs'>; @@ -48,9 +46,6 @@ export function RuleCreator(urlCreator: (ruleName: string) => string) { docs: { ...meta.docs, url: urlCreator(name), - extraDescription: meta.docs.tslintName - ? [`\`${meta.docs.tslintName}\` from TSLint`] - : undefined, }, }, create(context) { diff --git a/yarn.lock b/yarn.lock index 4f4a0d81f56..12e5d2f322d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1249,6 +1249,11 @@ resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.123.tgz#39be5d211478c8dd3bdae98ee75bb7efe4abfe4d" integrity sha512-pQvPkc4Nltyx7G1Ww45OjVqUsJP4UsZm+GWJpigXgkikZqJgRm4c48g027o6tdgubWHwFRF15iFd+Y4Pmqv6+Q== +"@types/marked@^0.6.5": + version "0.6.5" + resolved "https://registry.yarnpkg.com/@types/marked/-/marked-0.6.5.tgz#3cf2a56ef615dad24aaf99784ef90a9eba4e29d8" + integrity sha512-6kBKf64aVfx93UJrcyEZ+OBM5nGv4RLsI6sR1Ar34bpgvGVRoyTgpxn4ZmtxOM5aDTAaaznYuYUH8bUX3Nk3YA== + "@types/minimatch@*": version "3.0.3" resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" @@ -1400,11 +1405,6 @@ any-observable@^0.3.0: resolved "https://registry.yarnpkg.com/any-observable/-/any-observable-0.3.0.tgz#af933475e5806a67d0d7df090dd5e8bef65d119b" integrity sha512-/FQM1EDkTsf63Ub2C6O7GuYFDsSXUwsaZDurV0np41ocwq0jthUAYCmhBX9f+KwlaCgIuWyr/4WlUQUBfKfZog== -any-promise@^1.0.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f" - integrity sha1-q8av7tzqUugJzcA3au0845Y10X8= - anymatch@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" @@ -1930,11 +1930,6 @@ cli-cursor@^2.0.0, cli-cursor@^2.1.0: dependencies: restore-cursor "^2.0.0" -cli-spinners@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.1.0.tgz#22c34b4d51f573240885b201efda4e4ec9fff3c7" - integrity sha512-8B00fJOEh1HPrx4fo5eW16XmE1PcL1tGpGrxy63CXGP9nHdPBN63X75hA1zhvQuhVztJWLqV58Roj2qlNM7cAA== - cli-truncate@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-0.2.1.tgz#9f15cfbb0705005369216c626ac7d05ab90dd574" @@ -2505,7 +2500,7 @@ diff-sequences@^24.3.0: resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-24.3.0.tgz#0f20e8a1df1abddaf4d9c226680952e64118b975" integrity sha512-xLqpez+Zj9GKSnPWS0WZw1igGocZ+uua8+y+5dDNTT934N3QuY1sp2LkHzwiaYQGz60hMq0pjAshdeXm5VUOEw== -diff@^3.1.0, diff@^3.2.0, diff@^3.5.0: +diff@^3.1.0, diff@^3.2.0: version "3.5.0" resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== @@ -2655,18 +2650,6 @@ escodegen@^1.9.1: optionalDependencies: source-map "~0.6.1" -eslint-docs@^0.2.6: - version "0.2.7" - resolved "https://registry.yarnpkg.com/eslint-docs/-/eslint-docs-0.2.7.tgz#f208c3420fa2613f215a8daf5b9d75e9e7aa29ea" - integrity sha512-ylCFv96SW3aaWBrMFA7gai5tYntFXjy25CWNZWlAvamKCl7OYCTUfdUI40eAkO+3taxhGhTwCnIMHnwWwBxeYw== - dependencies: - chalk "^2.4.1" - detect-newline "^2.1.0" - diff "^3.5.0" - mz "^2.7.0" - ora "^3.0.0" - read-pkg-up "^4.0.0" - eslint-plugin-eslint-plugin@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/eslint-plugin-eslint-plugin/-/eslint-plugin-eslint-plugin-2.0.1.tgz#d275434969dbde3da1d4cb7a121dc8d88457c786" @@ -4928,6 +4911,11 @@ map-visit@^1.0.0: dependencies: object-visit "^1.0.0" +marked@^0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/marked/-/marked-0.6.2.tgz#c574be8b545a8b48641456ca1dbe0e37b6dccc1a" + integrity sha512-LqxwVH3P/rqKX4EKGz7+c2G9r98WeM/SW34ybhgNGhUQNKtf1GmmSkJ6cDGJ/t6tiyae49qRkpyTw2B9HOrgUA== + matcher@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/matcher/-/matcher-1.1.1.tgz#51d8301e138f840982b338b116bb0c09af62c1c2" @@ -5166,15 +5154,6 @@ mute-stream@~0.0.4: resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== -mz@^2.7.0: - version "2.7.0" - resolved "https://registry.yarnpkg.com/mz/-/mz-2.7.0.tgz#95008057a56cafadc2bc63dde7f9ff6955948e32" - integrity sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q== - dependencies: - any-promise "^1.0.0" - object-assign "^4.0.1" - thenify-all "^1.0.0" - nan@^2.12.1: version "2.13.2" resolved "https://registry.yarnpkg.com/nan/-/nan-2.13.2.tgz#f51dc7ae66ba7d5d55e1e6d4d8092e802c9aefe7" @@ -5521,18 +5500,6 @@ optionator@^0.8.1, optionator@^0.8.2: type-check "~0.3.2" wordwrap "~1.0.0" -ora@^3.0.0: - version "3.4.0" - resolved "https://registry.yarnpkg.com/ora/-/ora-3.4.0.tgz#bf0752491059a3ef3ed4c85097531de9fdbcd318" - integrity sha512-eNwHudNbO1folBP3JsZ19v9azXWtQZjICdr3Q0TDPIaeBQ3mXLrh54wM+er0+hSp+dWKf+Z8KM58CYzEyIYxYg== - dependencies: - chalk "^2.4.2" - cli-cursor "^2.1.0" - cli-spinners "^2.0.0" - log-symbols "^2.2.0" - strip-ansi "^5.2.0" - wcwidth "^1.0.1" - os-homedir@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" @@ -6830,7 +6797,7 @@ strip-ansi@^4.0.0: dependencies: ansi-regex "^3.0.0" -strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: +strip-ansi@^5.0.0, strip-ansi@^5.1.0: version "5.2.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== @@ -6978,20 +6945,6 @@ text-table@^0.2.0: resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= -thenify-all@^1.0.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/thenify-all/-/thenify-all-1.6.0.tgz#1a1918d402d8fc3f98fbf234db0bcc8cc10e9726" - integrity sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY= - dependencies: - thenify ">= 3.1.0 < 4" - -"thenify@>= 3.1.0 < 4": - version "3.3.0" - resolved "https://registry.yarnpkg.com/thenify/-/thenify-3.3.0.tgz#e69e38a1babe969b0108207978b9f62b88604839" - integrity sha1-5p44obq+lpsBCCB5eLn2K4hgSDk= - dependencies: - any-promise "^1.0.0" - throat@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/throat/-/throat-4.1.0.tgz#89037cbc92c56ab18926e6ba4cbb200e15672a6a" @@ -7335,7 +7288,7 @@ walker@^1.0.7, walker@~1.0.5: dependencies: makeerror "1.0.x" -wcwidth@^1.0.0, wcwidth@^1.0.1: +wcwidth@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" integrity sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=