We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@typescript-eslint/no-unnecessary-condition
export let
<script lang="ts"> export let mode: "foo" | "bar" = "foo"; mode == "foo"; </script>
src/Test.svelte 3:2 warning Unnecessary conditional, both sides of the expression are literal values @typescript-eslint/no-unnecessary-condition
It seems like typescript doesn't realize that the prop is mutable.
The problem doesn't exist for various other ways of writing this:
export let mode = "foo" as "foo" | "bar"; export let mode = "foo"; export let mode: "foo" | "bar";
In all of these cases no warning is emitted.
This occurs for more than just union types. For example it also works with enums and booleans.
module.exports = { extends: [ "eslint:recommended", "plugin:@typescript-eslint/strict", ], parser: "@typescript-eslint/parser", parserOptions: { project: "tsconfig.json", extraFileExtensions: [".svelte"], }, overrides: [{ files: ["*.svelte"], processor: "svelte3/svelte3", }], plugins: [ "@typescript-eslint", "svelte3", ], settings: { "svelte3/typescript": true, }, };
The text was updated successfully, but these errors were encountered:
No branches or pull requests
It seems like typescript doesn't realize that the prop is mutable.
The problem doesn't exist for various other ways of writing this:
In all of these cases no warning is emitted.
This occurs for more than just union types. For example it also works with enums and booleans.
The text was updated successfully, but these errors were encountered: