From ab9019df1b928507cf166e110f68f2de8806488b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Jona=C5=A1?= Date: Thu, 10 Aug 2023 15:39:23 +0200 Subject: [PATCH] feat(linter): deprecate tslint (#18464) --- CONTRIBUTING.md | 2 +- .../angular/generators/convert-tslint-to-eslint.json | 2 ++ docs/generated/packages/linter/documents/overview.md | 2 +- .../packages/nest/generators/convert-tslint-to-eslint.json | 2 ++ docs/shared/monorepo-nx-enterprise.md | 2 +- docs/shared/packages/linter/linter-plugin.md | 2 +- docs/shared/recipes/generators/generator-options.md | 2 +- nx-dev/models-package/src/lib/json-schema.models.ts | 1 - packages/angular/generators.json | 6 ++++-- .../src/generators/convert-tslint-to-eslint/compat.ts | 3 +++ .../convert-tslint-to-eslint/convert-tslint-to-eslint.ts | 3 +++ .../src/generators/convert-tslint-to-eslint/schema.json | 1 + packages/angular/src/utils/nx-devkit/ast-utils.ts | 6 +++--- packages/cypress/index.ts | 1 + .../convert-tslint-to-eslint/convert-tslint-to-eslint.ts | 3 +++ .../src/generators/convert-tslint-to-eslint/schema.json | 1 + .../src/generators/configuration/lib/update-workspace.ts | 3 +++ packages/linter/index.ts | 1 + .../convert-nx-enforce-module-boundaries-rule.ts | 3 +++ .../convert-tslint-to-eslint/convert-to-eslint-config.ts | 6 ++++++ .../src/utils/convert-tslint-to-eslint/project-converter.ts | 5 +++++ packages/linter/src/utils/convert-tslint-to-eslint/utils.ts | 3 +++ packages/linter/src/utils/versions.ts | 1 + packages/nest/generators.json | 6 ++++-- packages/nest/index.ts | 1 + .../convert-tslint-to-eslint/convert-tslint-to-eslint.ts | 3 +++ .../src/generators/convert-tslint-to-eslint/schema.json | 1 + packages/nx/src/native/index.d.ts | 1 - scripts/documentation/json-parser.ts | 4 +--- 29 files changed, 60 insertions(+), 17 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b0b7a1f944..409c1d36a0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -343,7 +343,7 @@ Including the issue number that the PR relates to also helps with tracking. ```plain feat(angular): add an option to generate lazy-loadable modules -`nx generate lib mylib --lazy` provisions the mylib project in tslint.json +`nx generate lib mylib --lazy` provisions the mylib project in .eslintrc.json Closes #157 ``` diff --git a/docs/generated/packages/angular/generators/convert-tslint-to-eslint.json b/docs/generated/packages/angular/generators/convert-tslint-to-eslint.json index f6a62fd9a1..cd5f0ee01d 100644 --- a/docs/generated/packages/angular/generators/convert-tslint-to-eslint.json +++ b/docs/generated/packages/angular/generators/convert-tslint-to-eslint.json @@ -7,6 +7,7 @@ "cli": "nx", "title": "Convert an Angular project from TSLint to ESLint", "description": "Convert an Angular project from TSLint to ESLint. NOTE: Does not work in `--dry-run mode`.", + "x-deprecated": "This generator is deprecated and will be removed in a future version of Nx. Migrate to ESLint.", "examples": [ { "command": "nx g convert-tslint-to-eslint myapp", @@ -54,6 +55,7 @@ "presets": [] }, "description": "Converts a project from TSLint to ESLint.", + "x-deprecated": "This generator is deprecated and will be removed in a future version of Nx. Migrate to ESLint.", "implementation": "/packages/angular/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint#conversionGenerator.ts", "aliases": [], "hidden": false, diff --git a/docs/generated/packages/linter/documents/overview.md b/docs/generated/packages/linter/documents/overview.md index 98328abc80..46575ac261 100644 --- a/docs/generated/packages/linter/documents/overview.md +++ b/docs/generated/packages/linter/documents/overview.md @@ -28,7 +28,7 @@ nx lint my-lib ## Utils -- [convert-tslint-to-eslint](/packages/angular/generators/convert-tslint-to-eslint) - Converts a project linter from [TSLint](https://palantir.github.io/tslint/) to [ESLint](https://eslint.org/) +- **Deprecated** [convert-tslint-to-eslint](/packages/angular/generators/convert-tslint-to-eslint) - Converts a project linter from [TSLint](https://palantir.github.io/tslint/) to [ESLint](https://eslint.org/) ## ESLint plugin diff --git a/docs/generated/packages/nest/generators/convert-tslint-to-eslint.json b/docs/generated/packages/nest/generators/convert-tslint-to-eslint.json index 145f07b494..a9459ede5d 100644 --- a/docs/generated/packages/nest/generators/convert-tslint-to-eslint.json +++ b/docs/generated/packages/nest/generators/convert-tslint-to-eslint.json @@ -6,6 +6,7 @@ "$id": "nest-convert-tslint-to-eslint", "cli": "nx", "title": "Convert a NestJS project from TSLint to ESLint", + "x-deprecated": "This generator is deprecated and will be removed in a future version of Nx. Migrate to ESLint.", "description": "Convert a NestJS project from TSLint to ESLint. \n_NOTE: Does not work in `--dry-run` mode_.", "examples": [ { @@ -44,6 +45,7 @@ "presets": [] }, "description": "Convert a project from TSLint to ESLint.", + "x-deprecated": "This generator is deprecated and will be removed in a future version of Nx. Migrate to ESLint.", "implementation": "/packages/nest/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint#conversionGenerator.ts", "aliases": [], "hidden": false, diff --git a/docs/shared/monorepo-nx-enterprise.md b/docs/shared/monorepo-nx-enterprise.md index 586890ae67..f06452f59f 100644 --- a/docs/shared/monorepo-nx-enterprise.md +++ b/docs/shared/monorepo-nx-enterprise.md @@ -191,7 +191,7 @@ Read more about workspace generators in the Workspace Generators guide. ### Workspace Lint Checks Custom lint checks is another great way to enforce best practices. We can create custom lint checks in the `tools/lint` -directory and then register them in `tslint.json` or `.eslintrc.json`. +directory and then register them in `.eslintrc.json`. ## Developer Workflow diff --git a/docs/shared/packages/linter/linter-plugin.md b/docs/shared/packages/linter/linter-plugin.md index 98328abc80..46575ac261 100644 --- a/docs/shared/packages/linter/linter-plugin.md +++ b/docs/shared/packages/linter/linter-plugin.md @@ -28,7 +28,7 @@ nx lint my-lib ## Utils -- [convert-tslint-to-eslint](/packages/angular/generators/convert-tslint-to-eslint) - Converts a project linter from [TSLint](https://palantir.github.io/tslint/) to [ESLint](https://eslint.org/) +- **Deprecated** [convert-tslint-to-eslint](/packages/angular/generators/convert-tslint-to-eslint) - Converts a project linter from [TSLint](https://palantir.github.io/tslint/) to [ESLint](https://eslint.org/) ## ESLint plugin diff --git a/docs/shared/recipes/generators/generator-options.md b/docs/shared/recipes/generators/generator-options.md index 668e9e85b0..dc8d0c51ab 100644 --- a/docs/shared/recipes/generators/generator-options.md +++ b/docs/shared/recipes/generators/generator-options.md @@ -617,7 +617,7 @@ The default value of this property. Example: "linter": { "description": "The tool to use for running lint checks.", "type": "string", - "enum": ["eslint", "tslint"], + "enum": ["eslint"], "default": "eslint" } } diff --git a/nx-dev/models-package/src/lib/json-schema.models.ts b/nx-dev/models-package/src/lib/json-schema.models.ts index 5c9857c69b..2fb6211825 100644 --- a/nx-dev/models-package/src/lib/json-schema.models.ts +++ b/nx-dev/models-package/src/lib/json-schema.models.ts @@ -1,4 +1,3 @@ -/* tslint:disable */ /** * This file was automatically generated by json-schema-to-typescript. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, diff --git a/packages/angular/generators.json b/packages/angular/generators.json index 3298c68882..3635a8ece9 100644 --- a/packages/angular/generators.json +++ b/packages/angular/generators.json @@ -42,7 +42,8 @@ "convert-tslint-to-eslint": { "factory": "./src/generators/convert-tslint-to-eslint/compat", "schema": "./src/generators/convert-tslint-to-eslint/schema.json", - "description": "Converts a project from TSLint to ESLint." + "description": "Converts a project from TSLint to ESLint.", + "x-deprecated": "This generator is deprecated and will be removed in a future version of Nx. Migrate to ESLint." }, "init": { "factory": "./src/generators/init/init.compat#initSchematic", @@ -194,7 +195,8 @@ "convert-tslint-to-eslint": { "factory": "./src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint#conversionGenerator", "schema": "./src/generators/convert-tslint-to-eslint/schema.json", - "description": "Converts a project from TSLint to ESLint." + "description": "Converts a project from TSLint to ESLint.", + "x-deprecated": "This generator is deprecated and will be removed in a future version of Nx. Migrate to ESLint." }, "directive": { "factory": "./src/generators/directive/directive", diff --git a/packages/angular/src/generators/convert-tslint-to-eslint/compat.ts b/packages/angular/src/generators/convert-tslint-to-eslint/compat.ts index 78822c2f47..83a7ea48db 100644 --- a/packages/angular/src/generators/convert-tslint-to-eslint/compat.ts +++ b/packages/angular/src/generators/convert-tslint-to-eslint/compat.ts @@ -2,6 +2,9 @@ import { convertNxGenerator } from '@nx/devkit'; import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; import { conversionGenerator } from './convert-tslint-to-eslint'; +/** + * @deprecated This generator will be removed in v17 + */ export const conversionSchematic = warnForSchematicUsage( convertNxGenerator(conversionGenerator) ); diff --git a/packages/angular/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.ts b/packages/angular/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.ts index 155a871e10..c9d3ea5858 100755 --- a/packages/angular/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.ts +++ b/packages/angular/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.ts @@ -5,6 +5,9 @@ import type { Linter } from 'eslint'; import type { AngularProjectConfiguration } from '../../utils/types'; import { addLintingGenerator } from '../add-linting/add-linting'; +/** + * @deprecated This generator will be removed in v17 + */ export async function conversionGenerator( host: Tree, options: ConvertTSLintToESLintSchema diff --git a/packages/angular/src/generators/convert-tslint-to-eslint/schema.json b/packages/angular/src/generators/convert-tslint-to-eslint/schema.json index 2a01c09a5c..7ec4017afe 100644 --- a/packages/angular/src/generators/convert-tslint-to-eslint/schema.json +++ b/packages/angular/src/generators/convert-tslint-to-eslint/schema.json @@ -4,6 +4,7 @@ "cli": "nx", "title": "Convert an Angular project from TSLint to ESLint", "description": "Convert an Angular project from TSLint to ESLint. NOTE: Does not work in `--dry-run mode`.", + "x-deprecated": "This generator is deprecated and will be removed in a future version of Nx. Migrate to ESLint.", "examples": [ { "command": "nx g convert-tslint-to-eslint myapp", diff --git a/packages/angular/src/utils/nx-devkit/ast-utils.ts b/packages/angular/src/utils/nx-devkit/ast-utils.ts index e18f14b455..b48b407a93 100644 --- a/packages/angular/src/utils/nx-devkit/ast-utils.ts +++ b/packages/angular/src/utils/nx-devkit/ast-utils.ts @@ -168,7 +168,7 @@ function _addSymbolToDecoratorMetadata( decoratorName: DecoratorName ): ts.SourceFile { const nodes = getDecoratorMetadata(source, decoratorName, '@angular/core'); - let node: any = nodes[0]; // tslint:disable-line:no-any + let node: any = nodes[0]; // Find the decorator declaration. if (!node) { @@ -326,7 +326,7 @@ export function removeFromNgModule( property: string ): ts.SourceFile { const nodes = getDecoratorMetadata(source, 'NgModule', '@angular/core'); - let node: any = nodes[0]; // tslint:disable-line:no-any + let node: any = nodes[0]; // Find the decorator declaration. if (!node) { @@ -598,7 +598,7 @@ function getMatchingProperty( module: string ): ts.ObjectLiteralElement { const nodes = getDecoratorMetadata(source, identifier, module); - let node: any = nodes[0]; // tslint:disable-line:no-any + let node: any = nodes[0]; if (!node) return null; diff --git a/packages/cypress/index.ts b/packages/cypress/index.ts index 5b62a7fb29..7b33d4084f 100644 --- a/packages/cypress/index.ts +++ b/packages/cypress/index.ts @@ -9,5 +9,6 @@ export const cypressComponentConfiguration = componentConfigurationGenerator; export { configurationGenerator as cypressE2EConfigurationGenerator }; export { cypressProjectGenerator } from './src/generators/cypress-project/cypress-project'; export { cypressInitGenerator } from './src/generators/init/init'; +/** @deprecated This generator will be removed in v17 */ export { conversionGenerator } from './src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint'; export { migrateCypressProject } from './src/generators/migrate-to-cypress-11/migrate-to-cypress-11'; diff --git a/packages/cypress/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.ts b/packages/cypress/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.ts index f5ba2bd29e..6521438557 100755 --- a/packages/cypress/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.ts +++ b/packages/cypress/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.ts @@ -12,6 +12,9 @@ import { import { addLinterToCyProject } from '../../utils/add-linter'; import type { Linter as ESLinter } from 'eslint'; +/** + * @deprecated This generator will be removed in v17 + */ export async function conversionGenerator( host: Tree, options: ConvertTSLintToESLintSchema diff --git a/packages/cypress/src/generators/convert-tslint-to-eslint/schema.json b/packages/cypress/src/generators/convert-tslint-to-eslint/schema.json index 540955ad77..8aada591fd 100644 --- a/packages/cypress/src/generators/convert-tslint-to-eslint/schema.json +++ b/packages/cypress/src/generators/convert-tslint-to-eslint/schema.json @@ -4,6 +4,7 @@ "cli": "nx", "title": "Convert a Cypress project from TSLint to ESLint", "description": "Convert a Cypress project from TSLint to ESLint.\n_NOTE: Does not work in `--dry-run` mode_.", + "x-deprecated": "This generator is deprecated and will be removed in a future version of Nx. Migrate to ESLint.", "examples": [ { "command": "nx g convert-tslint-to-eslint myapp", diff --git a/packages/jest/src/generators/configuration/lib/update-workspace.ts b/packages/jest/src/generators/configuration/lib/update-workspace.ts index f0c46ede96..230846a81b 100644 --- a/packages/jest/src/generators/configuration/lib/update-workspace.ts +++ b/packages/jest/src/generators/configuration/lib/update-workspace.ts @@ -38,6 +38,9 @@ export function updateWorkspace( }, }; + /** + * @deprecated this will be removed in the v17 + */ const isUsingTSLint = projectConfig.targets.lint?.executor === '@angular-devkit/build-angular:tslint'; diff --git a/packages/linter/index.ts b/packages/linter/index.ts index 3186ba51b5..dc8c31e713 100644 --- a/packages/linter/index.ts +++ b/packages/linter/index.ts @@ -1,6 +1,7 @@ export { lintProjectGenerator } from './src/generators/lint-project/lint-project'; export { lintInitGenerator } from './src/generators/init/init'; export { Linter } from './src/generators/utils/linter'; +/** @deprecated This will be removed in v17 */ export * from './src/utils/convert-tslint-to-eslint'; // @nx/angular needs it for the Angular CLI workspace migration to Nx to diff --git a/packages/linter/src/utils/convert-tslint-to-eslint/convert-nx-enforce-module-boundaries-rule.ts b/packages/linter/src/utils/convert-tslint-to-eslint/convert-nx-enforce-module-boundaries-rule.ts index 57074f6515..3b144b91ef 100644 --- a/packages/linter/src/utils/convert-tslint-to-eslint/convert-nx-enforce-module-boundaries-rule.ts +++ b/packages/linter/src/utils/convert-tslint-to-eslint/convert-nx-enforce-module-boundaries-rule.ts @@ -26,6 +26,9 @@ function convertTSLintRuleSeverity( const NX_TSLINT_RULE_NAME = 'nx-enforce-module-boundaries'; +/** + * @deprecated This converter will be removed in v17 + */ export function convertTslintNxRuleToEslintNxRule( tslintJson: Record ): { diff --git a/packages/linter/src/utils/convert-tslint-to-eslint/convert-to-eslint-config.ts b/packages/linter/src/utils/convert-tslint-to-eslint/convert-to-eslint-config.ts index a29113863f..983a1bc111 100644 --- a/packages/linter/src/utils/convert-tslint-to-eslint/convert-to-eslint-config.ts +++ b/packages/linter/src/utils/convert-tslint-to-eslint/convert-to-eslint-config.ts @@ -49,6 +49,9 @@ function getConvertToEslintConfig() { return tslintToEslint; } +/** + * @deprecated This will be removed in v17 + */ export async function convertToESLintConfig( pathToTslintJson: string, tslintJson: Record, @@ -196,6 +199,9 @@ function likelyContainsTSLintComment(fileContent: string): boolean { return fileContent.includes('tslint:'); } +/** + * @deprecated This will be removed in v17 + */ export function convertTSLintDisableCommentsForProject( tree: Tree, projectName: string diff --git a/packages/linter/src/utils/convert-tslint-to-eslint/project-converter.ts b/packages/linter/src/utils/convert-tslint-to-eslint/project-converter.ts index 1340a4776c..4ca01b6196 100644 --- a/packages/linter/src/utils/convert-tslint-to-eslint/project-converter.ts +++ b/packages/linter/src/utils/convert-tslint-to-eslint/project-converter.ts @@ -24,6 +24,8 @@ import { /** * Common schema used by all implementations of convert-tslint-to-eslint generators + * + * @deprecated This will be removed in v17 */ export interface ConvertTSLintToESLintSchema { project: string; @@ -34,6 +36,7 @@ export interface ConvertTSLintToESLintSchema { } /** + * * When we convert a TSLint setup to an ESLint setup for a particular project, there are a number of * shared/common concerns (implemented as library utilities within @nx/linter), and a few things * which are specific to this package and the types of projects it produces. @@ -49,6 +52,8 @@ export interface ConvertTSLintToESLintSchema { * * - The user's project-level tslint.json file will be converted into a corresponding .eslintrc.json file * and it will extend from the root workspace .eslintrc.json file as normal. + * + * @deprecated This will be removed in v17 */ export class ProjectConverter { private readonly projectConfig: ProjectConfiguration; diff --git a/packages/linter/src/utils/convert-tslint-to-eslint/utils.ts b/packages/linter/src/utils/convert-tslint-to-eslint/utils.ts index 580ef4c2b5..7288b7a888 100644 --- a/packages/linter/src/utils/convert-tslint-to-eslint/utils.ts +++ b/packages/linter/src/utils/convert-tslint-to-eslint/utils.ts @@ -60,6 +60,9 @@ function warnInCaseOfUnconvertedRules( } } +/** + * @deprecated This will be removed in v17 + */ export async function convertTSLintConfig( rawTSLintJson: any, tslintJsonPath: string, diff --git a/packages/linter/src/utils/versions.ts b/packages/linter/src/utils/versions.ts index a3c2bfcf99..da83374b05 100644 --- a/packages/linter/src/utils/versions.ts +++ b/packages/linter/src/utils/versions.ts @@ -3,5 +3,6 @@ export const nxVersion = require('../../package.json').version; export const eslintVersion = '~8.46.0'; export const eslintrcVersion = '^2.1.1'; export const eslintConfigPrettierVersion = '8.1.0'; +/** @deprecated This will be removed in v17 */ export const tslintToEslintConfigVersion = '^2.13.0'; export const typescriptESLintVersion = '^5.60.1'; diff --git a/packages/nest/generators.json b/packages/nest/generators.json index 74b92ab811..4993de48ce 100644 --- a/packages/nest/generators.json +++ b/packages/nest/generators.json @@ -13,7 +13,8 @@ "convert-tslint-to-eslint": { "factory": "./src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint#conversionSchematic", "schema": "./src/generators/convert-tslint-to-eslint/schema.json", - "description": "Convert a project from TSLint to ESLint." + "description": "Convert a project from TSLint to ESLint.", + "x-deprecated": "This generator is deprecated and will be removed in a future version of Nx. Migrate to ESLint." }, "init": { "factory": "./src/generators/init/init#initSchematic", @@ -116,7 +117,8 @@ "convert-tslint-to-eslint": { "factory": "./src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint#conversionGenerator", "schema": "./src/generators/convert-tslint-to-eslint/schema.json", - "description": "Convert a project from TSLint to ESLint." + "description": "Convert a project from TSLint to ESLint.", + "x-deprecated": "This generator is deprecated and will be removed in a future version of Nx. Migrate to ESLint." }, "init": { "factory": "./src/generators/init/init", diff --git a/packages/nest/index.ts b/packages/nest/index.ts index f7d82a3abc..e19a92acc5 100644 --- a/packages/nest/index.ts +++ b/packages/nest/index.ts @@ -1,6 +1,7 @@ export { applicationGenerator } from './src/generators/application/application'; export { classGenerator } from './src/generators/class/class'; export { controllerGenerator } from './src/generators/controller/controller'; +/** @deprecated This generator will be removed in v17 */ export { conversionGenerator } from './src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint'; export { decoratorGenerator } from './src/generators/decorator/decorator'; export { filterGenerator } from './src/generators/filter/filter'; diff --git a/packages/nest/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.ts b/packages/nest/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.ts index d7b194ec64..5bd8c3e9e6 100755 --- a/packages/nest/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.ts +++ b/packages/nest/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.ts @@ -15,6 +15,9 @@ import { } from '@nx/js/src/generators/library/library'; import type { Linter } from 'eslint'; +/** + * @deprecated This generator will be removed in v17 + */ export async function conversionGenerator( host: Tree, options: ConvertTSLintToESLintSchema diff --git a/packages/nest/src/generators/convert-tslint-to-eslint/schema.json b/packages/nest/src/generators/convert-tslint-to-eslint/schema.json index ed18893efa..47d26cf142 100644 --- a/packages/nest/src/generators/convert-tslint-to-eslint/schema.json +++ b/packages/nest/src/generators/convert-tslint-to-eslint/schema.json @@ -3,6 +3,7 @@ "$id": "nest-convert-tslint-to-eslint", "cli": "nx", "title": "Convert a NestJS project from TSLint to ESLint", + "x-deprecated": "This generator is deprecated and will be removed in a future version of Nx. Migrate to ESLint.", "description": "Convert a NestJS project from TSLint to ESLint. \n_NOTE: Does not work in `--dry-run` mode_.", "examples": [ { diff --git a/packages/nx/src/native/index.d.ts b/packages/nx/src/native/index.d.ts index 7f411fd70b..2e1c92dc0f 100644 --- a/packages/nx/src/native/index.d.ts +++ b/packages/nx/src/native/index.d.ts @@ -1,4 +1,3 @@ -/* tslint:disable */ /* eslint-disable */ /* auto-generated by NAPI-RS */ diff --git a/scripts/documentation/json-parser.ts b/scripts/documentation/json-parser.ts index c9904adea0..15947322b1 100644 --- a/scripts/documentation/json-parser.ts +++ b/scripts/documentation/json-parser.ts @@ -19,9 +19,7 @@ function _getEnumFromValue( } if (Object.values(enumeration).indexOf(value) !== -1) { - // TODO: this should be unknown - // tslint:disable-next-line:no-any - return value as any as T; + return value as unknown as T; } return defaultValue;