Closed
Description
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
- I have read the FAQ and my problem is not listed.
Repro
module.exports = {
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": [ "@typescript-eslint" ],
"rules": {
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": ["error", {
"vars": "all",
"varsIgnorePattern": "Hmi",
"args": "none"
}]
}
}
module Hmi {
export interface myType {
}
export function getType(): Hmi.myType | null {
return null;
// return Hmi.System.getMyType();
}
}
Or even shorter:
module Hmi {
export class myClass {
}
console.log(Hmi.myClass); // Register call in reality
}
Expected Result
No rule violation.
Because the module is used.- Because I even added the name
Hmi
intovarsIgnorePattern
Actual Result
.\node_modules\.bin\eslint.cmd file.ts
file.ts
1:8 error 'Hmi' is defined but never used @typescript-eslint/no-unused-vars
✖ 1 problem (1 error, 0 warnings)
Additional Info
This examples are working!
export module Hmi { // <-- export added!
export interface myType {
}
export function getType(): Hmi.myType | null {
return null;
}
}
module Hmi {
export interface myType {
}
export function getType(): null { // <-- myType removed
return null;
}
}
Versions
"@typescript-eslint/eslint-plugin": "4.4.0",
"@typescript-eslint/parser": "4.4.0",
"eslint": "6.8.0", and "7.10.0"
"typescript": "4.0.3",