🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@eslint-share/eslint-config-prettier-react-ts

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eslint-share/eslint-config-prettier-react-ts

react-ts eslint share config

latest
npmnpm
Version
1.0.5
Version published
Maintainers
1
Created
Source

eslint-share 项目规范

使用了 TypescriptReact 开发的业务库可以使用此配置。

依赖库

  • Eslint
  • React
  • Prettier
  • Typescript

安装

  • npm i @eslint-share/eslint-config-prettier-react-ts or yarn add @eslint-share/eslint-config-prettier-react-ts

使用 yarn 如果出现错误的话,需要补充安装 yarn add eslint-plugin-prettier@latest -D

配置

在项目根目录新建 eslint 配置文件:.eslintrc.js 中加入:

module.exports = {
  "extends": ["@eslint-share/eslint-config-prettier-react-ts"]
}

规则复写

如果需要修改 Prettier 规则,需要在 .eslintrc.js 中新增字段 rules 字段:

module.exports = {
  ...
  rules: {
    "prettier/prettier": [
      "error",
      {
        printWidth: 100,
        trailingComma: "none"
      }
    ]
  }
}

Keywords

eslint

FAQs

Package last updated on 17 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts