Skip to content

Commit

Permalink
fix(utils): add new properties since eslint 8.40.0 (#7460)
Browse files Browse the repository at this point in the history
* fix: add new properties

* Update packages/utils/src/ts-eslint/Rule.ts

Co-authored-by: Josh Goldberg ✨ <git@joshuakgoldberg.com>

* chore: apply suggestions

---------

Co-authored-by: Josh Goldberg ✨ <git@joshuakgoldberg.com>
  • Loading branch information
so1ve and JoshuaKGoldberg committed Aug 13, 2023
1 parent 5d75fad commit 660aff7
Showing 1 changed file with 30 additions and 0 deletions.
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 Use {@link `cwd`} instead.
*/
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 Use {@link `filename`} instead.
*/
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 Use {@link `physicalFilename`} instead.
*/
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 Use {@link `sourceCode`} instead.
*/
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

0 comments on commit 660aff7

Please sign in to comment.