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

fix(utils): add new properties since eslint 8.40.0 #7460

Merged
merged 3 commits into from
Aug 13, 2023
Merged
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
30 changes: 30 additions & 0 deletions packages/utils/src/ts-eslint/Rule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,20 +220,42 @@ interface RuleContext<
* Returns the current working directory passed to Linter.
* It is a path to a directory that should be considered as the current working directory.
* @since 6.6.0
* @deprecated
so1ve marked this conversation as resolved.
Show resolved Hide resolved
*/
getCwd(): string;

/**
* The current working directory passed to Linter.
* It is a path to a directory that should be considered as the current working directory.
* @since 8.40.0
*/
cwd: string;

/**
* Returns the filename associated with the source.
* @deprecated
*/
getFilename(): string;

/**
* The filename associated with the source.
* @since 8.40.0
*/
filename: string;

/**
* Returns the full path of the file on disk without any code block information (unlike `getFilename()`).
* @since 7.28.0
* @deprecated
*/
getPhysicalFilename?(): string;

/**
* The full path of the file on disk without any code block information (unlike `filename`).
* @since 8.40.0
*/
physicalFilename?: string;

/**
* Returns the scope of the currently-traversed node.
* This information can be used track references to variables.
Expand All @@ -243,9 +265,17 @@ interface RuleContext<
/**
* Returns a SourceCode object that you can use to work with the source that
* was passed to ESLint.
* @deprecated
*/
getSourceCode(): Readonly<SourceCode>;

/**
* A SourceCode object that you can use to work with the source that
* was passed to ESLint.
* @since 8.40.0
*/
sourceCode: Readonly<SourceCode>;

/**
* Marks a variable with the given name in the current scope as used.
* This affects the no-unused-vars rule.
Expand Down