-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
bugSomething isn't workingSomething isn't workinghas prthere is a PR raised to close thisthere is a PR raised to close thispackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin
Description
Related issues
- [@typescript-eslint/typedef] broken when used with a default parameter #784
- fix(eslint-plugin): [@typescript-eslint/typedef] support default value for parameter #785
Repro
{
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"rules": {
"@typescript-eslint/typedef": [
"error",
{
"parameter": true
}
]
}
}
type Options = {
force?: boolean;
}
class Something {
// Works fine without `= {}`
constructor(private readonly _options: Options = {}) {
// something
}
}
Expected Result
All fine. The output has no errors.
Actual Result
…\typescript-eslint-repro\src\index.ts
6:17 error expected a type annotation @typescript-eslint/typedef
✖ 1 problem (1 error, 0 warnings)
Additional Info
The --debug
argument could tell me nothing of interest.
Versions
package | version |
---|---|
@typescript-eslint/eslint-plugin |
2.0.0 |
@typescript-eslint/parser |
2.0.0 |
TypeScript |
3.5.3 |
ESLint |
6.2.2 |
node |
12.8.0 |
npm |
6.10.2 |
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinghas prthere is a PR raised to close thisthere is a PR raised to close thispackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin