Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-config-db

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-config-db

A collection of configuration files containing eslint

  • 1.2.1-2
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

eslint-config-db

安装

使用 npm 安装

npm install --save-dev eslint-config-db eslint-plugin-prettier eslint-plugin-import

使用 yarn 安装

yarn add -D eslint-config-db eslint-plugin-prettier eslint-plugin-import

在项目中配置

eslint 配置文件中加入对应配置即可生效

普通项目

{
  extends: ['db'],
}

react项目

{
  extends: ['db/react'],
}

commit时启用代码检查

可以启用提交时检测代码来规范项目内的代码风格

只会检测有改动的,之前的文件不会去检测

执行 npx init-lint ,会自动进行设置

prettier

如果要使用 prettier 自动格式化,需要在根目录创建 .prettierrc.js 文件。

该文件用于覆盖系统默认配置,具体要实现自动格式化还要安装相应插件并设置默认格式化工具

// .prettierrc.js
const prettier = require('eslint-config-db/config/prettier')

module.exports = {
  ...prettier,
}

stylelint

如果使用 stylelint 来检查 css 样式,需要在根目录创建 .stylelintrc.js 文件。

// .stylelintrc.js
const stylelint = require('eslint-config-db/config/stylelint')

module.exports = {
  ...stylelint,
}

FAQs

Package last updated on 21 Dec 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc