@acmecryptocorp/eslint-config 中文文档教程

发布于 5年前 浏览 14 项目主页 更新于 3年前

@acmecryptocorp/eslint-config

semantic-release

Description

Acme Crypto Corp 的 可扩展配置 ESlint

Installation

安装 config

npm install -D @acmecryptocorp/eslint-config
yarn add --dev @acmecryptocorp/eslint-config

peer dependencies

npx install-peerdeps --dev @acmecryptocorp/eslint-config

或手动安装:

npm

npm install -D \
  @acmecryptocorp/eslint-plugin@~1.1.1 \
  @typescript-eslint/eslint-plugin@~2.17.0 \
  eslint@^6.8.0 \
  eslint-config-airbnb@~14.0.0 \
  eslint-config-prettier@~6.9.0 \
  eslint-import-resolver-ts@~0.4.2 \
  eslint-plugin-eslint-comments@~3.1.1 \
  eslint-plugin-filenames@~1.3.2 \
  eslint-plugin-flowtype@~4.6.0 \
  eslint-plugin-import@2.18.2 \
  eslint-plugin-no-loops@~0.3.0 \
  eslint-plugin-optimize-regex@~1.1.7 \
  eslint-plugin-promise@~4.1.1 \
  eslint-plugin-sort-class-members@~1.6.0 \
  eslint-plugin-unicorn@~15.0.1 \
  typescript@^3.6.3

yarn

yarn add --dev \
  @acmecryptocorp/eslint-plugin@~1.1.1 \
  @typescript-eslint/eslint-plugin@~2.17.0 \
  eslint@^6.8.0 \
  eslint-config-airbnb@~14.0.0 \
  eslint-config-prettier@~6.9.0 \
  eslint-import-resolver-ts@~0.4.2 \
  eslint-plugin-eslint-comments@~3.1.1 \
  eslint-plugin-filenames@~1.3.2 \
  eslint-plugin-flowtype@~4.6.0 \
  eslint-plugin-import@2.18.2 \
  eslint-plugin-no-loops@~0.3.0 \
  eslint-plugin-optimize-regex@~1.1.7 \
  eslint-plugin-promise@~4.1.1 \
  eslint-plugin-sort-class-members@~1.6.0 \
  eslint-plugin-unicorn@~15.0.1 \
  typescript@^3.6.3

Usage

将所需的配置添加到您的 .eslintrc:

Example:

.eslintrc.json

"extends": [
  "@acmecryptocorp",
  "@acmecryptocorp/eslint-config/flow"
]

.eslintrc.yml

extends:
  - '@acmecryptocorp'
  - '@acmecryptocorp/eslint-config/flow'

Notes

建议与更漂亮

请参阅:@acmecryptocorp/prettier-config

Configurations

@acmecryptocorp

一般配置。

配置文件:json, yaml

@acmecryptocorp/eslint-config/flow

Flow相关配置。

配置文件:json, yaml

@acmecryptocorp/eslint-config/typescript

Typescript 的配置

重要:您必须指定typescript 配置文件 的路径.eslintrc 中的解析器选项。

示例:

parserOptions:
  project: 'tsconfig.json'

配置文件:json, yaml

@acmecryptocorp/eslint-config/typescript-beta

已弃用

测试版 Typescript

配置文件:jsonyaml

@acmecryptocorp/eslint-config

semantic-release

Description

Acme Crypto Corp's extensible config for ESlint.

Installation

Install the config

npm install -D @acmecryptocorp/eslint-config
yarn add --dev @acmecryptocorp/eslint-config

and peer dependencies:

npx install-peerdeps --dev @acmecryptocorp/eslint-config

or manually:

npm:

npm install -D \
  @acmecryptocorp/eslint-plugin@~1.1.1 \
  @typescript-eslint/eslint-plugin@~2.17.0 \
  eslint@^6.8.0 \
  eslint-config-airbnb@~14.0.0 \
  eslint-config-prettier@~6.9.0 \
  eslint-import-resolver-ts@~0.4.2 \
  eslint-plugin-eslint-comments@~3.1.1 \
  eslint-plugin-filenames@~1.3.2 \
  eslint-plugin-flowtype@~4.6.0 \
  eslint-plugin-import@2.18.2 \
  eslint-plugin-no-loops@~0.3.0 \
  eslint-plugin-optimize-regex@~1.1.7 \
  eslint-plugin-promise@~4.1.1 \
  eslint-plugin-sort-class-members@~1.6.0 \
  eslint-plugin-unicorn@~15.0.1 \
  typescript@^3.6.3

yarn:

yarn add --dev \
  @acmecryptocorp/eslint-plugin@~1.1.1 \
  @typescript-eslint/eslint-plugin@~2.17.0 \
  eslint@^6.8.0 \
  eslint-config-airbnb@~14.0.0 \
  eslint-config-prettier@~6.9.0 \
  eslint-import-resolver-ts@~0.4.2 \
  eslint-plugin-eslint-comments@~3.1.1 \
  eslint-plugin-filenames@~1.3.2 \
  eslint-plugin-flowtype@~4.6.0 \
  eslint-plugin-import@2.18.2 \
  eslint-plugin-no-loops@~0.3.0 \
  eslint-plugin-optimize-regex@~1.1.7 \
  eslint-plugin-promise@~4.1.1 \
  eslint-plugin-sort-class-members@~1.6.0 \
  eslint-plugin-unicorn@~15.0.1 \
  typescript@^3.6.3

Usage

Add desired configuration to your .eslintrc:

Example:

.eslintrc.json

"extends": [
  "@acmecryptocorp",
  "@acmecryptocorp/eslint-config/flow"
]

.eslintrc.yml

extends:
  - '@acmecryptocorp'
  - '@acmecryptocorp/eslint-config/flow'

Notes

This config is recommended to be used alongside Prettier.

See: @acmecryptocorp/prettier-config

Configurations

@acmecryptocorp

General configuration.

Configuration files: json, yaml.

@acmecryptocorp/eslint-config/flow

Flow related configuration.

Configuration files: json, yaml.

@acmecryptocorp/eslint-config/typescript

Configuration for Typescript

Important: You must specify path to your typescript configuration file in parser options in your .eslintrc.

Example:

parserOptions:
  project: 'tsconfig.json'

Configuration files: json, yaml.

@acmecryptocorp/eslint-config/typescript-beta

DEPRECTATED

Beta configuration for Typescript

Configuration files: json, yaml.

更多

友情链接

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文