Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Enhancement: [no-deprecated] Add 'allow' option for specific types or values #9899

Closed
Labels
accepting prsGo ahead, send a pull request that resolves this issueenhancement: plugin rule optionNew rule option for an existing eslint-plugin rulelocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.package: eslint-pluginIssues related to @typescript-eslint/eslint-plugin
@BurningEnlightenment

Description

@BurningEnlightenment

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

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).

Link to the rule's documentation

https://typescript-eslint.io/rules/no-deprecated/

Description

I find it very useful to flag and address deprecated API usage during the dependency upgrade cycle. Whence I'd like to enforce the rule for the usage of my dependencies.
However, for my own code base I want to follow a gradual deprecation cycle, i.e. I want to introduce an updated API and inform users writing new code about the updated API via a@deprecated JSDoc comment. Afterwards I'd phase the deprecated API out and remove it in the end.
The current rule is unsuited for the combined requirements, so I propose a boolean optionignoreUserDeprecations.

Fail

/**@deprecated Use apiV2 instead. */asyncfunctionapiV1():Promise<void>{/*…*/}asyncfunctionapiV2():Promise<void>{/*…*/}awaitapiV1();/* >===================================< */import{parse}from'node:url';// 'parse' is deprecated. Use the WHATWG URL API instead.consturl=parse('/foo');

Pass

/**@deprecated Use apiV2 instead. */asyncfunctionapiV1():Promise<void>{/*…*/}asyncfunctionapiV2():Promise<void>{/*…*/}// apiV1 has been defined in the current code base and is therefore not flaggedawaitapiV1();/* >===================================< */// Modern Node.js API, uses `new URL()`consturl2=newURL('/foo','http://www.example.com');

Additional Info

Originally proposed in the [no-deprecated] issue#8988 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issueenhancement: plugin rule optionNew rule option for an existing eslint-plugin rulelocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.package: eslint-pluginIssues related to @typescript-eslint/eslint-plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp