Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(typescript-estree): deprecate createDefaultProgram #5890

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/typescript-estree/README.md
Expand Up @@ -208,7 +208,7 @@ interface ParseAndGenerateServicesOptions extends ParseOptions {

/**
* @deprecated - this flag will be removed in the next major.
* Do not rely on the behaviour provided by this flag.
* Do not rely on the behavior provided by this flag.
Copy link
Member

Choose a reason for hiding this comment

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

image

YOU AMERICANS AND YOUR BAD SPELLINGS

Copy link
Member Author

Choose a reason for hiding this comment

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

😂 cspell was yelling at me!

*/
DEPRECATED__createDefaultProgram?: boolean;

Expand Down
Expand Up @@ -36,6 +36,7 @@ function createProjectProgram(
);

// The file was either matched within the tsconfig, or we allow creating a default program
// eslint-disable-next-line deprecation/deprecation -- will be cleaned up with the next major
if (astAndProgram || parseSettings.DEPRECATED__createDefaultProgram) {
return astAndProgram;
}
Expand Down
Expand Up @@ -29,6 +29,7 @@ export function createParseSettings(
comment: options.comment === true,
comments: [],
DEPRECATED__createDefaultProgram:
// eslint-disable-next-line deprecation/deprecation -- will be cleaned up with the next major
options.DEPRECATED__createDefaultProgram === true,
debugLevel:
options.debugLevel === true
Expand Down
2 changes: 1 addition & 1 deletion packages/typescript-estree/src/parser-options.ts
Expand Up @@ -145,7 +145,7 @@ interface ParseAndGenerateServicesOptions extends ParseOptions {

/**
* @deprecated - this flag will be removed in the next major.
* Do not rely on the behaviour provided by this flag.
* Do not rely on the behavior provided by this flag.
*/
DEPRECATED__createDefaultProgram?: boolean;

Expand Down
1 change: 1 addition & 0 deletions packages/typescript-estree/src/parser.ts
Expand Up @@ -46,6 +46,7 @@ function getProgramAndAST(
(shouldProvideParserServices &&
// eslint-disable-next-line deprecation/deprecation -- will be cleaned up with the next major
parseSettings.DEPRECATED__createDefaultProgram &&
// eslint-disable-next-line deprecation/deprecation -- will be cleaned up with the next major
createDefaultProgram(parseSettings)) ||
createIsolatedProgram(parseSettings)
);
Expand Down