From 25e8439b200f13859b1f24b24b6344c56f9477b3 Mon Sep 17 00:00:00 2001 From: Jack Hsu Date: Fri, 12 May 2023 13:00:46 -0400 Subject: [PATCH] feat(react): remove deprecated code (#16981) --- packages/react/index.ts | 1 - .../src/generators/application/schema.d.ts | 4 -- packages/react/src/utils/lint.ts | 47 ------------------- 3 files changed, 52 deletions(-) diff --git a/packages/react/index.ts b/packages/react/index.ts index 50c4f6fcf0fc3..c028d98886ac3 100644 --- a/packages/react/index.ts +++ b/packages/react/index.ts @@ -1,6 +1,5 @@ export { extraEslintDependencies, - createReactEslintJson, extendReactEslintJson, } from './src/utils/lint'; export { CSS_IN_JS_DEPENDENCIES } from './src/utils/styled'; diff --git a/packages/react/src/generators/application/schema.d.ts b/packages/react/src/generators/application/schema.d.ts index bc4f9877e3f34..ab83ef80b1ca7 100644 --- a/packages/react/src/generators/application/schema.d.ts +++ b/packages/react/src/generators/application/schema.d.ts @@ -9,10 +9,6 @@ export interface Schema { tags?: string; unitTestRunner?: 'jest' | 'vitest' | 'none'; inSourceTests?: boolean; - /** - * @deprecated - */ - babelJest?: boolean; e2eTestRunner: 'cypress' | 'none'; linter: Linter; pascalCaseFiles?: boolean; diff --git a/packages/react/src/utils/lint.ts b/packages/react/src/utils/lint.ts index 8640d0329e51a..88157c6ed63d2 100644 --- a/packages/react/src/utils/lint.ts +++ b/packages/react/src/utils/lint.ts @@ -25,50 +25,3 @@ export const extendReactEslintJson = (json: Linter.Config) => { ...config, }; }; - -/** - * @deprecated Use {@link extendReactEslintJson} instead. - */ -export const createReactEslintJson = ( - projectRoot: string, - setParserOptionsProject: boolean -): Linter.Config => ({ - extends: ['plugin:@nx/react', `${offsetFromRoot(projectRoot)}.eslintrc.json`], - ignorePatterns: ['!**/*'], - overrides: [ - { - files: ['*.ts', '*.tsx', '*.js', '*.jsx'], - /** - * NOTE: We no longer set parserOptions.project by default when creating new projects. - * - * We have observed that users rarely add rules requiring type-checking to their Nx workspaces, and therefore - * do not actually need the capabilites which parserOptions.project provides. When specifying parserOptions.project, - * typescript-eslint needs to create full TypeScript Programs for you. When omitting it, it can perform a simple - * parse (and AST tranformation) of the source files it encounters during a lint run, which is much faster and much - * less memory intensive. - * - * In the rare case that users attempt to add rules requiring type-checking to their setup later on (and haven't set - * parserOptions.project), the executor will attempt to look for the particular error typescript-eslint gives you - * and provide feedback to the user. - */ - parserOptions: !setParserOptionsProject - ? undefined - : { - project: [`${projectRoot}/tsconfig.*?.json`], - }, - /** - * Having an empty rules object present makes it more obvious to the user where they would - * extend things from if they needed to - */ - rules: {}, - }, - { - files: ['*.ts', '*.tsx'], - rules: {}, - }, - { - files: ['*.js', '*.jsx'], - rules: {}, - }, - ], -});