Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

eslint-plugin-console

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-console

定制ESLint rule of console

latest
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

eslint-plugin-console

安装包

安装eslint:

npm i eslint -D

安装eslint-plugin-console

npm install eslint-plugin-console -D

配置

将插件添加到.eslintrc文件的plugins中:

继承插件配置

在插件中会将所有规则都导出,然后可以使用extends来继承插件的配置。

PS: 不止这种继承方式,即使你传入一个对象,一个文件,eslint 也能继承其中的配置。

// .eslintrc.js
module.exports = {
  extends: ["plugin:console/no-console-args"], // 继承插件导出的配置
};

引入插件一条条写入规则

// .eslintrc.js
module.exports = {
  plugins: ["console"],
  rules: {
    "console/no-console-args": "error",
    // 更多插件规则
  },
};

提供的规则

  • no-console-args: 禁止console.log()无参数

Keywords

eslint-plugin

FAQs

Package last updated on 03 Jul 2023

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