Skip to content

Commit

Permalink
feat(react): remove deprecated code (#16981)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysoo authored May 12, 2023
1 parent eec95b1 commit 25e8439
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 52 deletions.
1 change: 0 additions & 1 deletion packages/react/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export {
extraEslintDependencies,
createReactEslintJson,
extendReactEslintJson,
} from './src/utils/lint';
export { CSS_IN_JS_DEPENDENCIES } from './src/utils/styled';
Expand Down
4 changes: 0 additions & 4 deletions packages/react/src/generators/application/schema.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
47 changes: 0 additions & 47 deletions packages/react/src/utils/lint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {},
},
],
});

1 comment on commit 25e8439

@vercel
Copy link

@vercel vercel bot commented on 25e8439 May 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nx-dev – ./

nx-dev-nrwl.vercel.app
nx-five.vercel.app
nx.dev
nx-dev-git-master-nrwl.vercel.app

Please sign in to comment.