eslint-plugin-ante

Shared configurations for JavaScript projects.

eslint-plugin-ante

Standard linting rules for ESLint, suitable for all JavaScript projects.

Installation

We recommend installing eslintand eslint-plugin-antelocally within your project:

# Install eslint if it is not already installed.
$ yarn add --dev eslint

# Install this plugin.
$ yarn add --dev eslint-plugin-ante

Configuration

Within your ESLint configuration file (e.g: .eslintrc.json), add an entry to the "plugins" section:

{
  "plugins": [
    "eslint-plugin-ante"
  ]
}

Shareable Configurations

Recommended

The recommendedconfiguration enforces a significant subset of the core non-stylistic rules listed at ESLint: Rules, covering the "Possible Errors", "Best Practices", "Variables", and "ECMAScript 6" sections. It is highly recommended to use this in conjunction withthe eslint:recommendedconfiguration provided natively by ESLint, as this configuration does not includethose rules.

To use this configuration, add an entry to your ESLint configuration's extendssection:

{
  "extends": [
    "eslint:recommended",
    "plugin:ante/recommended"
  ]
}

Style

The styleconfiguration enforces a set of stylistic conventions using the core rules described at ESLint: Rules: Stylistic Issues. These are not included in the recommendedconfiguration above because some of the choices are highly subjective. We recommend using this configuration for new projects, or projects where a conventionis desired rather than a particular convention, although any of the default rules provided in this configuration may be overridden in your project's rulessection.

To use this configuration, add an entry to your ESLint configuration's extendssection:

{
  "extends": [
    "plugin:ante/style"
  ]
}

Possible Errors

The possible-errorsconfiguration enforces a significant subset of the core rules described at ESLint: Rules: Possible Errors.

To use this configuration, add an entry to your ESLint configuration's extendssection:

{
  "extends": [
    "plugin:ante/possible-errors"
  ]
}

Best Practices

The best-practicesconfiguration enforces a significant subset of the core rules described at ESLint: Rules: Best Practices.

To use this configuration, add an entry to your ESLint configuration's extendssection:

{
  "extends": [
    "plugin:ante/best-practices"
  ]
}

ECMAScript 6

The es6configuration enforces a significant subset of the core rules described at ESLint: Rules: ECMAScript 6.

To use this configuration, add an entry to your ESLint configuration's extendssection:

{
  "extends": [
    "plugin:ante/es6"
  ]
}

Variables

The variablesconfiguration enforces a significant subset of the core rules described at ESLint: Rules: Variables.

To use this configuration, add an entry to your ESLint configuration's extendssection:

{
  "extends": [
    "plugin:ante/variables"
  ]
}
License

eslint-plugin-ante is licensed under the MIT License.

Repository

https://github.com/twuni/eslint-plugin-ante


上一篇:grpc_tools_node_protoc_ts
下一篇:bip21

相关推荐

  • 预期的换行符是'LF '但发现'CRLF '在使用大口ESLint断行风格

    Backdoor Cipher(https://stackoverflow.com/users/5908241/backdoorcipher)提出了一个问题:Expected linebreaks t...

    2 年前
  • 项目代码的格式化统一配置 Prettier & ESLint

    以前没时间过eslint,每次项目vscode 编辑器的eslint插件就关掉eslint,老项目都没注意过相关的代码规范,这次新项目加入进去实践下! Question 1. 三个插件功自动有...

    2 年前
  • 错误ocurredjsplugin.3005

    Nanoselvakumar(https://stackoverflow.com/users/2217462/nano)提出了一个问题:An error has ocurredJSPlugin.300...

    2 年前
  • 详解html-webpack-plugin用法全解

    htmlwebpackplugin 可能用过的 webpack 的童鞋都用过这个 plugin ,就算没用过可能也听过。我们在学习webpack的时候,可能经常会看到这样的一段代码。

    3 年前
  • 认识 ESLint 和 Prettier

    原文链接:https://ssshooter.com/202006... ESLint 和 Prettier 分别是什么,有什么关系? 直接用脚手架生成一个带 ESLint 的项目,整天报错有没有很...

    2 个月前
  • 自己实现一个inline-manifest-webpack-plugin

    背景 项目里有用到inlinemanifestwebpackplugin,当把htmlwebpackplugin升级到v4时,插件就报错了。原本想等插件适配,结果发现不维护了。

    16 天前
  • 编写你的第一个 Babel Plugin

    现在我们用 React 和 Vue 开发项目时,package.json 文件都会有 babel 的依赖,还会依赖于一些插件。什么是 babel,怎么样写一个 babel 插件呢,看完你就明白了。

    7 个月前
  • 用eslint + prettier + pre-commit管理项目(React)

    前言 人是很懒惰的,你刚开始建立的一个规规整整的项目,可能一段时间过后,就回被你无数次的提交代码弄得凌乱不堪。 就算你能保证你的编码风格严谨统一,别人又该如何,每个人都有不一样的编码风格,要保持统...

    2 年前
  • 深入理解 Eslint (手把手教你撸一个plugin)

    前言 虽然现在已经有很多实用的 ESHint 插件了,但随着项目不断迭代发展,你可能会遇到已有 ESHint 插件不能满足现在团队开发的情况。这时候,你需要自己来创建一个 ESHint 插件。

    10 个月前
  • 深入理解 ESLint

    前言 小沈是一个刚刚开始工作的前端实习生,第一次进行团队开发,难免有些紧张。在导师的安排下,拿到了项目的 git 权限,开始进行 clone。 小沈开始细细品味着同事们的代码,终于在他的不懈...

    1 年前

官方社区

扫码加入 JavaScript 社区