Reactjs typescript eslint:如何使道具对换行符作出反应

Reactjs typescript eslint:如何使道具对换行符作出反应,reactjs,eslint,prettier,typescript-eslint,Reactjs,Eslint,Prettier,Typescript Eslint,我试图添加一个linting规则,将longReact属性值分解为新行。下面的示例显示属性段落是超长的,我不知道如何将其换行以使其换行 <Card header="General Contractors, Engineering Procurement Providers, Prime Contractors" id="gen-contractor" paragraph={`Construction companies that buil

我试图添加一个linting规则,将long
React
属性值分解为新行。下面的示例显示属性
段落
是超长的,我不知道如何将其换行以使其换行

<Card
  header="General Contractors, Engineering Procurement Providers, Prime Contractors"
  id="gen-contractor"
  paragraph={`Construction companies that build pipelines. While these companies may provide many services "in-house", they often sub-contract work that requires special equipment or
know-how`}
  onCardToggle={(isChecked) => console.log('isChecked', isChecked)}
/>
这是我的
。prettierrc

{
  "singleQuote": true,
  "trailingComma": "all"
}
以下是我的
devDependencies
中所有与linting相关的依赖项:

"devDependencies": {
    "@babel/core": "^7.13.14",
    "@typescript-eslint/eslint-plugin": "^4.21.0",
    "@typescript-eslint/parser": "^4.21.0",
    "@wojtekmaj/enzyme-adapter-react-17": "^0.6.1",
    "autoprefixer": "^10.2.5",
    "babel-loader": "^8.2.2",
    "babel-plugin-module-resolver": "^4.1.0",
    "eslint": "^7.23.0",
    "eslint-config-airbnb-typescript": "^12.3.1",
    "eslint-import-resolver-alias": "^1.1.2",
    "eslint-plugin-import": "^2.22.1",
    "eslint-plugin-jsx-a11y": "^6.4.1",
    "eslint-plugin-react": "^7.23.1",
    "eslint-plugin-react-hooks": "^4.2.0",
    "prettier": "^2.2.1",
  }

对于诸如“我怎样才能使我的代码格式变得更漂亮,从而使它变得……?”这样的问题,普遍的答案是“你不能。”

Prettier的目的是通过关注代码样式来促进项目和团队中的协作,而不是成为一个可定制的代码格式化程序,它可以做用户想要做的任何事情。换句话说,它产生的格式不是真正可定制的,这是有意的。请在此处阅读更多信息:

"devDependencies": {
    "@babel/core": "^7.13.14",
    "@typescript-eslint/eslint-plugin": "^4.21.0",
    "@typescript-eslint/parser": "^4.21.0",
    "@wojtekmaj/enzyme-adapter-react-17": "^0.6.1",
    "autoprefixer": "^10.2.5",
    "babel-loader": "^8.2.2",
    "babel-plugin-module-resolver": "^4.1.0",
    "eslint": "^7.23.0",
    "eslint-config-airbnb-typescript": "^12.3.1",
    "eslint-import-resolver-alias": "^1.1.2",
    "eslint-plugin-import": "^2.22.1",
    "eslint-plugin-jsx-a11y": "^6.4.1",
    "eslint-plugin-react": "^7.23.1",
    "eslint-plugin-react-hooks": "^4.2.0",
    "prettier": "^2.2.1",
  }