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
{
"env": {
"es6": true
},
"globals": {},
"parser": null,
"parserOptions": {
"ecmaVersion": 2017,
"sourceType": "script"
},
"plugins": [],
"rules": {
"accessor-pairs": [
"warn"
],
"array-bracket-newline": [
"off"
],
"array-bracket-spacing": [
"warn",
"never"
],
"array-callback-return": [
"warn"
],
"arrow-spacing": [
"warn",
{
"before": true,
"after": true
}
],
"block-spacing": [
"warn",
"never"
],
"brace-style": [
"warn",
"1tbs"
],
"camelcase": [
"warn",
{
"properties": "never",
"ignoreDestructuring": false,
"ignoreImports": false,
"ignoreGlobals": false
}
],
"comma-spacing": [
"warn",
{
"before": false,
"after": true
}
],
"comma-style": [
"warn",
"last"
],
"complexity": [
"warn",
30
],
"computed-property-spacing": [
"warn",
"never"
],
"consistent-this": [
"warn",
"that"
],
"consistent-return": [
"warn"
],
"constructor-super": [
"error"
],
"curly": [
"error",
"all"
],
"default-case": [
"error"
],
"default-case-last": [
"warn"
],
"default-param-last": [
"warn"
],
"dot-notation": [
"error",
{
"allowPattern": "^[a-zA-Z]+(_[a-zA-Z]+)+$",
"allowKeywords": true
}
],
"eol-last": [
"warn"
],
"eqeqeq": [
"error"
],
"func-call-spacing": [
"warn",
"never"
],
"func-names": [
"off"
],
"func-style": [
"off"
],
"function-paren-newline": [
"warn",
"multiline"
],
"generator-star-spacing": [
"warn",
{
"before": true,
"after": false
}
],
"guard-for-in": [
"error"
],
"grouped-accessor-pairs": [
"warn"
],
"id-blacklist": [
"off"
],
"id-length": [
"off"
],
"id-match": [
"off"
],
"implicit-arrow-linebreak": [
"warn"
],
"indent": [
"warn",
"tab",
{
"SwitchCase": 1,
"flatTernaryExpressions": false,
"offsetTernaryExpressions": false,
"ignoreComments": false
}
],
"jsx-quotes": [
"warn",
"prefer-double"
],
"key-spacing": [
"warn",
{
"beforeColon": false,
"afterColon": true
}
],
"keyword-spacing": [
"error",
{
"before": true,
"after": true,
"overrides": {}
}
],
"linebreak-style": [
"off"
],
"lines-around-comment": [
"off"
],
"lines-between-class-members": [
"warn",
"always",
{
"exceptAfterSingleLine": true
}
],
"max-depth": [
"warn",
10
],
"max-len": [
"warn",
500
],
"max-lines": [
"warn",
1000
],
"max-nested-callbacks": [
"warn",
10
],
"max-params": [
"warn",
10
],
"max-statements": [
"warn",
150
],
"max-statements-per-line": [
"warn",
{
"max": 2
}
],
"new-cap": [
"warn"
],
"new-parens": [
"warn"
],
"newline-per-chained-call": [
"off"
],
"no-alert": [
"off"
],
"no-array-constructor": [
"warn"
],
"no-await-in-loop": [
"warn"
],
"no-bitwise": [
"warn"
],
"no-caller": [
"error"
],
"no-case-declarations": [
"error"
],
"no-class-assign": [
"error"
],
"no-confusing-arrow": [
"error"
],
"no-continue": [
"warn"
],
"no-const-assign": [
"error"
],
"no-constructor-return": [
"warn"
],
"no-delete-var": [
"error"
],
"no-div-regex": [
"error"
],
"no-dupe-class-members": [
"error"
],
"no-duplicate-imports": [
"error"
],
"no-empty": [
"error",
{
"allowEmptyCatch": true
}
],
"no-empty-pattern": [
"warn"
],
"no-eq-null": [
"error"
],
"no-eval": [
"error"
],
"no-extend-native": [
"error"
],
"no-extra-bind": [
"error"
],
"no-extra-label": [
"warn"
],
"no-extra-parens": [
"warn"
],
"no-fallthrough": [
"warn"
],
"no-floating-decimal": [
"error"
],
"no-implicit-coercion": [
"warn",
{
"boolean": true,
"number": true,
"string": true,
"disallowTemplateShorthand": false
}
],
"no-implicit-globals": [
"warn"
],
"no-implied-eval": [
"error"
],
"no-inline-comments": [
"off"
],
"no-invalid-this": [
"error"
],
"no-iterator": [
"error"
],
"no-label-var": [
"error"
],
"no-labels": [
"error",
{
"allowLoop": false,
"allowSwitch": false
}
],
"no-lone-blocks": [
"warn"
],
"no-lonely-if": [
"off"
],
"no-loop-func": [
"warn"
],
"no-magic-numbers": [
"off"
],
"no-mixed-spaces-and-tabs": [
"warn"
],
"no-multiple-empty-lines": [
"off"
],
"no-multi-assign": [
"warn"
],
"no-multi-spaces": [
"warn",
{
"ignoreEOLComments": true
}
],
"no-multi-str": [
"error"
],
"no-native-reassign": [
"error"
],
"no-negated-condition": [
"off"
],
"no-new-func": [
"error"
],
"no-new-object": [
"warn"
],
"no-new-symbol": [
"error"
],
"no-new-wrappers": [
"error"
],
"no-octal-escape": [
"error"
],
"no-octal": [
"error"
],
"no-plusplus": [
"off"
],
"no-process-env": [
"error"
],
"no-promise-executor-return": [
"warn"
],
"no-proto": [
"error"
],
"no-prototype-builtins": [
"off"
],
"no-redeclare": [
"error",
{
"builtinGlobals": true
}
],
"no-restricted-syntax": [
"warn",
"WithStatement"
],
"no-return-assign": [
"error"
],
"no-return-await": [
"error"
],
"no-script-url": [
"error"
],
"no-self-assign": [
"error"
],
"no-self-compare": [
"error"
],
"no-sequences": [
"error"
],
"no-shadow": [
"error",
{
"builtinGlobals": true,
"allow": [
"close",
"event",
"external",
"innerHeight",
"length",
"module",
"name",
"open",
"parent",
"print",
"prompt",
"status",
"test",
"toolbar",
"top",
"URL"
],
"hoist": "functions"
}
],
"no-shadow-restricted-names": [
"error"
],
"no-template-curly-in-string": [
"warn"
],
"no-ternary": [
"off"
],
"no-this-before-super": [
"error"
],
"no-trailing-spaces": [
"warn"
],
"no-throw-literal": [
"error"
],
"no-undef": [
"error"
],
"no-undef-init": [
"error"
],
"no-underscore-dangle": [
"off"
],
"no-undefined": [
"off"
],
"no-unmodified-loop-condition": [
"warn"
],
"no-unneeded-ternary": [
"warn"
],
"no-unreachable-loop": [
"warn"
],
"no-unused-expressions": [
"warn",
{
"allowTernary": true,
"allowShortCircuit": false,
"allowTaggedTemplates": false,
"enforceForJSX": false
}
],
"no-unused-labels": [
"warn"
],
"no-unused-private-class-members": [
"warn"
],
"no-unused-vars": [
"warn",
{
"vars": "all",
"args": "after-used"
}
],
"no-use-before-define": [
"error",
"nofunc"
],
"no-useless-call": [
"warn"
],
"no-useless-catch": [
"warn"
],
"no-useless-computed-key": [
"warn"
],
"no-useless-concat": [
"warn"
],
"no-useless-constructor": [
"error"
],
"no-useless-rename": [
"warn"
],
"no-useless-return": [
"warn"
],
"no-var": [
"error"
],
"no-void": [
"warn",
{
"allowAsStatement": true
}
],
"no-warning-comments": [
"off"
],
"no-whitespace-before-property": [
"warn"
],
"no-with": [
"error"
],
"object-curly-newline": [
"off"
],
"object-curly-spacing": [
"warn",
"never"
],
"object-shorthand": [
"off"
],
"one-var-declaration-per-line": [
"off"
],
"operator-assignment": [
"off"
],
"operator-linebreak": [
"warn",
"after",
{
"overrides": {
"?": "ignore",
":": "ignore"
}
}
],
"padded-blocks": [
"off"
],
"padding-line-between-statements": [
"warn",
{
"blankLine": "always",
"prev": "directive",
"next": "*"
},
{
"blankLine": "any",
"prev": "directive",
"next": "directive"
}
],
"prefer-arrow-callback": [
"off"
],
"prefer-const": [
"warn"
],
"prefer-object-has-own": [
"off"
],
"prefer-reflect": [
"off"
],
"prefer-rest-params": [
"off"
],
"prefer-spread": [
"off"
],
"prefer-template": [
"off"
],
"quotes": [
"warn",
"single",
"avoid-escape"
],
"radix": [
"error"
],
"require-atomic-updates": [
"warn"
],
"require-yield": [
"error"
],
"semi": [
"warn",
"always"
],
"semi-spacing": [
"warn",
{
"before": false,
"after": true
}
],
"semi-style": [
"error",
"last"
],
"sort-imports": [
"off"
],
"sort-vars": [
"off"
],
"space-before-blocks": [
"warn"
],
"space-before-function-paren": [
"warn",
{
"anonymous": "always",
"named": "never"
}
],
"space-infix-ops": [
"warn"
],
"space-unary-ops": [
"warn",
{
"words": true,
"nonwords": false
}
],
"spaced-comment": [
"off",
"always"
],
"strict": [
"error"
],
"switch-colon-spacing": [
"error",
{
"after": true,
"before": false
}
],
"template-curly-spacing": [
"error"
],
"unicode-bom": [
"error",
"never"
],
"vars-on-top": [
"error"
],
"wrap-iife": [
"error",
"outside"
],
"wrap-regex": [
"off"
],
"yield-star-spacing": [
"error"
],
"yoda": [
"error",
"never",
{
"exceptRange": true,
"onlyEquality": false
}
],
"for-direction": [
"error"
],
"getter-return": [
"error"
],
"no-async-promise-executor": [
"error"
],
"no-compare-neg-zero": [
"error"
],
"no-cond-assign": [
"error"
],
"no-constant-condition": [
"error"
],
"no-control-regex": [
"error"
],
"no-debugger": [
"error"
],
"no-dupe-args": [
"error"
],
"no-dupe-else-if": [
"error"
],
"no-dupe-keys": [
"error"
],
"no-duplicate-case": [
"error"
],
"no-empty-character-class": [
"error"
],
"no-ex-assign": [
"error"
],
"no-extra-boolean-cast": [
"error"
],
"no-extra-semi": [
"error"
],
"no-func-assign": [
"error"
],
"no-global-assign": [
"error"
],
"no-import-assign": [
"error"
],
"no-inner-declarations": [
"error"
],
"no-invalid-regexp": [
"error"
],
"no-irregular-whitespace": [
"error"
],
"no-loss-of-precision": [
"error"
],
"no-misleading-character-class": [
"error"
],
"no-nonoctal-decimal-escape": [
"error"
],
"no-obj-calls": [
"error"
],
"no-regex-spaces": [
"error"
],
"no-setter-return": [
"error"
],
"no-sparse-arrays": [
"error"
],
"no-unexpected-multiline": [
"error"
],
"no-unreachable": [
"error"
],
"no-unsafe-finally": [
"error"
],
"no-unsafe-negation": [
"error"
],
"no-unsafe-optional-chaining": [
"error"
],
"no-useless-backreference": [
"error"
],
"no-useless-escape": [
"error"
],
"use-isnan": [
"error"
],
"valid-typeof": [
"error"
]
},
"settings": {},
"ignorePatterns": [
".eslintrc.js",
"configs/eslint-plugin-custom/",
"dist/",
"doc/",
"node_modules/",
"rollout/",
"temp/",
"test/selenium/public/",
"test/selenium-jest/public/",
"vendor/"
]
}
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
const item = e.target.value;
}
Expected Result
No warning
Actual Result
The use of the HTMLInputElement
instead of the default Element
types is reported as warning This is the default value for this type parameter, so it can be omitted.
Additional Info
Versions
package | version |
---|---|
@typescript-eslint/eslint-plugin |
5.12.0 |
@typescript-eslint/parser |
5.12.0 |
TypeScript |
4.5.5 |
ESLint |
8.9.0 |
node |
16.14.0 |