Skip to content

Enhancement: Bug: remove typings for context.markVariableAsUsed() and friends? #11371

Open
@kirkwaiblinger

Description

@kirkwaiblinger

Before You File a Proposal Please Confirm You Have Done The Following...

Relevant Package

utils

My proposal is suitable for this project

  • I believe my proposal would be useful to the broader TypeScript community (meaning it is not a niche proposal).

Description

With the resolution of eslint/eslint#19910, I'm wondering if we should remove the corresponding typings in our own repo?

// Deprecated members
/**
* Returns an array of the ancestors of the currently-traversed node, starting at
* the root of the AST and continuing through the direct parent of the current node.
* This array does not include the currently-traversed node itself.
*
* @deprecated in favor of `SourceCode#getAncestors`
*/
getAncestors(): TSESTree.Node[];
/**
* Returns a list of variables declared by the given node.
* This information can be used to track references to variables.
*
* @deprecated in favor of `SourceCode#getDeclaredVariables`
*/
getDeclaredVariables(node: TSESTree.Node): readonly Scope.Variable[];
/**
* Returns the current working directory passed to Linter.
* It is a path to a directory that should be considered as the current working directory.
* @deprecated in favor of `RuleContext#cwd`
*/
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.
*/
cwd: string;
/**
* Returns the filename associated with the source.
*
* @deprecated in favor of `RuleContext#filename`
*/
getFilename(): string;
/**
* The filename associated with the source.
*/
filename: string;
/**
* Returns the full path of the file on disk without any code block information (unlike `getFilename()`).
* @deprecated in favor of `RuleContext#physicalFilename`
*/
getPhysicalFilename(): string;
/**
* The full path of the file on disk without any code block information (unlike `filename`).
*/
physicalFilename: string;
/**
* Returns the scope of the currently-traversed node.
* This information can be used track references to variables.
*
* @deprecated in favor of `SourceCode#getScope`
*/
getScope(): Scope.Scope;
/**
* Returns a SourceCode object that you can use to work with the source that
* was passed to ESLint.
*
* @deprecated in favor of `RuleContext#sourceCode`
*/
getSourceCode(): Readonly<SourceCode>;
/**
* A SourceCode object that you can use to work with the source that
* was passed to ESLint.
*/
sourceCode: Readonly<SourceCode>;
/**
* Marks a variable with the given name in the current scope as used.
* This affects the no-unused-vars rule.
*
* @deprecated in favor of `SourceCode#markVariableAsUsed`
*/
markVariableAsUsed(name: string): boolean;
/**
* Reports a problem in the code.
*/
report(descriptor: ReportDescriptor<MessageIds>): void;

May help with resolving #10899

Additional Info

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issueenhancementNew feature or requestpackage: utilsIssues related to the @typescript-eslint/utils package

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy