- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 2.7k
Closed
Labels
Description
Is there an existing issue for this?
- I have searched the existing issues and my issue is unique
- My issue appears in the command-line and not only in the text editor
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,.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"],
  },
};
Expected Behavior
It should keep the generic argument. E.g.
<DataTable<Items> fullscreen keyField="id" items={items}  />
Should become
<DataTable<Items> 
  fullscreen
  keyField="id"
  items={items}
/>
eslint-plugin-react version
v7.32.2
eslint version
v8.35.0
node version
v16.15.1