Closed
Description
Repro
{
"rules": {
"@typescript-eslint/no-object-literal-type-assertion": "error"
}
}
I'm trying to make the action parameter in my reducer accept a empty object:
import * as Actions from './actions'
const reducer = (state, action: Actions.ActionType = {} as Actions.ActionType) {}
// removing the namespace throws the error:
import {ActionType} from './actions'
const reducer = (state, action: ActionType = {} as ActionType) {}
adding {"allowAsParameter": true}
makes no difference.
Expected Result
There should be no difference in using a namespaced type or not - error should be thrown in both cases
Actual Result
Error is not thrown when type is imported with star
Versions
package | version |
---|---|
@typescript-eslint/eslint-plugin |
1.10.2 |
@typescript-eslint/parser |
1.10.2 |
TypeScript |
3.5.1 |
ESLint |
5.16 |
node |
10.15.3 |