Generic components have their generic parameter removed when auto fixing.
It should not remove the generic argument.
I setup vscode to format on save. Alternatively eslint . --ext .tsx,.ts produces the same result.
My eslint config.
module.exports = {
parser: "@typescript-eslint/parser",
extends: [
"plugin:compat/recommended",
"plugin:react/recommended",
],
env: {
browser: true,
},
plugins: [
"@typescript-eslint",
],
parserOptions: {
ecmaVersion: 2018,
sourceType: "module",
tsconfigRootDir: __dirname,
project: "./tsconfig.json",
ecmaFeatures: {
jsx: true,
},
},
rules: {
"react/jsx-first-prop-new-line": ["error", "multiline"],
},
settings: {
react: {
version: "detect", // Tells eslint-plugin-react to automatically detect the version of React to use
},
"import/internal-regex": "^components/|^lib/",
polyfills: ["fetch", "Promise"],
},
};
It should keep the generic argument. E.g.
<DataTable<Items> fullscreen keyField="id" items={items} />
<DataTable<Items>
fullscreen
keyField="id"
items={items}
/>
Is there an existing issue for this?
Description Overview
Generic components have their generic parameter removed when auto fixing.
Screen.Recording.2023-03-07.at.14.36.22.mov
It should not remove the generic argument.
I setup vscode to format on save. Alternatively
eslint . --ext .tsx,.tsproduces the same result.My eslint config.
Expected Behavior
It should keep the generic argument. E.g.
Should become
eslint-plugin-react version
v7.32.2
eslint version
v8.35.0
node version
v16.15.1