-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed as not planned
Closed as not planned
Copy link
Labels
bugSomething isn't workingSomething isn't workinglocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.Please 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-pluginIssues related to @typescript-eslint/eslint-pluginworking as intendedIssues that are closed as they are working as intendedIssues that are closed as they are working as intended
Description
Before You File a Bug Report Please Confirm You Have Done The Following...
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
- I have searched for related issues and found none that matched my issue.
- I have read the FAQ and my problem is not listed.
Playground Link
Repro Code
declare namespace A.B {
const y: string;
}
/** @deprecated */
declare namespace A.C {
const z: string;
}
console.log(A.B.y);
ESLint Config
module.exports = {
"rules": {
"@typescript-eslint/no-deprecated": "error"
}
}
tsconfig
Expected Result
No lint errors on the line console.log(A.B.y)
, because none of the elements A
, A.B
, or A.B.y
are marked @deprecated
.
Actual Result
A @typescript-eslint/no-deprecated
lint error appears on that line:
`A` is deprecated. 10:13 - 10:14
Additional Info
A real-world example of this is in the @types/chrome
package, which provides typing for browser-specific APIs exposed by Chrome for use in Chrome Apps and Chrome Extensions. There are a bunch of specific APIs that are deprecated, such as:
/**
* @deprecated Part of the deprecated Chrome Apps platform
*/
declare namespace chrome.socket {
// ...
}
But this results in the linter raising a @typescript-eslint/no-deprecated
at every usage site of chrome
(not just chrome.socket
- also other things like chrome.tabs
, chrome.runtime
, etc, which aren't deprecated).
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinglocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.Please 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-pluginIssues related to @typescript-eslint/eslint-pluginworking as intendedIssues that are closed as they are working as intendedIssues that are closed as they are working as intended