2.0.1 • Published 5 years ago

@azure/eslint-plugin-azure-sdk v2.0.1

Weekly downloads
487
License
MIT
Repository
github
Last release
5 years ago

eslint-plugin-azure-sdk

An ESLint plugin enforcing design guidelines for the JavaScript/TypeScript Azure SDK.

Installation

You'll first need to install ESLint:

npm i eslint --save-dev

Next, install @azure/eslint-plugin-azure-sdk:

npm install @azure/eslint-plugin-azure-sdk --save-dev

Usage

Add @azure/azure-sdk to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
  "plugins": ["@azure/azure-sdk"]
}

Make sure to set your .eslintrc configuration file's parserOptions.project field to point to the tsconfig file at the root of your project as follows:

{
  "parserOptions": {
    "project": "./tsconfig.json"
  }
}

For all rules to be enforced according to the standards set by the Design Guidelines, add this plugin's recommended configuration to the extends section of your .eslintrc configuration file as follows:

{
  "extends": ["plugin:@azure/azure-sdk/recommended"]
}

If the main TypeScript entrypoint to your package is not in src/index.ts, set settings.main in your .eslintrc configuration file to the entrypoint as follows (for example, if the entrypoint is index.ts):

{
  "settings": {
    "main": "index.ts"
  }
}

If you need to modify or disable specific rules, you can do so in the rules section of your .eslintrc configuration file. For example, if you are not targeting Node, disable ts-config-moduleresolution as follows:

{
  "rules": {
    "@azure/azure-sdk/ts-config-moduleresolution": "off"
  }
}

Some rules (see table below) are fixable using the --fix ESLint option (added in 1.3.0).

Supported Rules

Key

SymbolMeaning
:triangular_flag_on_post:Error
:warning:Warning
:heavy_multiplication_x:Off
:heavy_check_mark:Fixable and autofix-enabled
:x:Not fixable

Rules

RuleDefaultFixableRelease
github-source-headers:triangular_flag_on_post::heavy_check_mark:1.1.0
ts-apisurface-standardized-verbs:triangular_flag_on_post::x:1.2.0
ts-apisurface-supportcancellation:triangular_flag_on_post::x:1.2.0
ts-config-allowsyntheticdefaultimports:triangular_flag_on_post::heavy_check_mark:1.0.0
ts-config-declaration:triangular_flag_on_post::heavy_check_mark:1.0.0
ts-config-esmoduleinterop:triangular_flag_on_post::heavy_check_mark:1.0.0
ts-config-exclude:triangular_flag_on_post::heavy_check_mark:1.0.0
ts-config-forceconsistentcasinginfilenames:triangular_flag_on_post::heavy_check_mark:1.0.0
ts-config-importhelpers:triangular_flag_on_post::heavy_check_mark:1.0.0
ts-config-lib:triangular_flag_on_post::heavy_check_mark:1.0.0
ts-config-module:triangular_flag_on_post::heavy_check_mark:1.0.0
ts-config-moduleresolution:triangular_flag_on_post::heavy_check_mark:1.1.0
ts-config-no-experimentaldecorators:triangular_flag_on_post::heavy_check_mark:1.0.0
ts-config-sourcemap:triangular_flag_on_post::heavy_check_mark:1.0.0
ts-config-strict:triangular_flag_on_post::heavy_check_mark:1.0.0
ts-config-target:triangular_flag_on_post::x:1.1.0
ts-doc-internal:triangular_flag_on_post::x:1.1.0
ts-error-handling:heavy_multiplication_x::x:1.1.0
ts-modules-only-named:triangular_flag_on_post::x:1.1.0
ts-naming-drop-noun:triangular_flag_on_post::x:1.2.0
ts-naming-options:triangular_flag_on_post::x:1.2.0
ts-naming-subclients:triangular_flag_on_post::x:1.2.0
ts-no-const-enums:warning::heavy_check_mark:1.1.0
ts-no-namespaces:triangular_flag_on_post::x:1.2.0
ts-package-json-author:triangular_flag_on_post::heavy_check_mark:1.0.0
ts-package-json-bugs:triangular_flag_on_post::heavy_check_mark:1.0.0
ts-package-json-engine-is-present:triangular_flag_on_post::heavy_check_mark:1.1.0
ts-package-json-files-required:triangular_flag_on_post::heavy_check_mark:1.1.0
ts-package-json-homepage:triangular_flag_on_post::x:1.0.0
ts-package-json-keywords:triangular_flag_on_post::heavy_check_mark:1.0.0
ts-package-json-license:triangular_flag_on_post::heavy_check_mark:1.0.0
ts-package-json-main-is-cjs:triangular_flag_on_post::heavy_check_mark:1.1.0
ts-package-json-module:triangular_flag_on_post::heavy_check_mark:1.1.0
ts-package-json-name:triangular_flag_on_post::x:1.0.0
ts-package-json-repo:triangular_flag_on_post::heavy_check_mark:1.0.0
ts-package-json-required-scripts:triangular_flag_on_post::x:1.0.0
ts-package-json-sideeffects:triangular_flag_on_post::heavy_check_mark:1.0.0
ts-package-json-types:triangular_flag_on_post::x:1.1.0
ts-pagination-list:triangular_flag_on_post::x:1.2.0
ts-use-interface-parameters:warning::x:1.1.0
ts-use-promises:triangular_flag_on_post::x:1.1.0
ts-versioning-semver:triangular_flag_on_post::x:1.1.0