🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@eslint-share/eslint-config-prettier

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

normal config prettier

latest
npmnpm
Version
1.0.5
Version published
Maintainers
1
Created
Source

eslint-share 项目规范

不依赖 TypescriptReact 的项目可使用此配置。主要做代码格式化的校验。

依赖库

  • Eslint
  • Prettier
  • @babel/eslint-parser

安装

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

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

配置

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

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

规则复写

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

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

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