autorest/.default-eslintrc.yaml

105 строки
3.1 KiB
YAML

---
parser: "@typescript-eslint/parser"
plugins:
- "@typescript-eslint"
- prettier
- unicorn
- node
- jest
- import
env:
es6: true
node: true
extends:
- eslint:recommended
- plugin:@typescript-eslint/recommended
- plugin:node/recommended
- plugin:jest/recommended
- plugin:jest/recommended
- plugin:import/recommended
- plugin:import/typescript
globals:
Atomics: readonly
SharedArrayBuffer: readonly
parserOptions:
ecmaVersion: 2018
sourceType: module
warnOnUnsupportedTypeScriptVersion: false
project: ./tsconfig.json
rules:
"@typescript-eslint/no-this-alias": off
"@typescript-eslint/interface-name-prefix": off
"@typescript-eslint/explicit-function-return-type": off
"@typescript-eslint/no-explicit-any": off
"@typescript-eslint/no-empty-interface": off
"@typescript-eslint/no-namespace": off
"@typescript-eslint/explicit-member-accessibility": off
"@typescript-eslint/no-unused-vars": off
"@typescript-eslint/no-parameter-properties": off
"@typescript-eslint/no-angle-bracket-type-assertion": off
"@typescript-eslint/no-use-before-define": off
"@typescript-eslint/no-var-requires": off
"@typescript-eslint/no-empty-function": off
"@typescript-eslint/explicit-module-boundary-types": off
"@typescript-eslint/ban-types": off
"@typescript-eslint/consistent-type-assertions": off
"@typescript-eslint/no-floating-promises": warn
"require-atomic-updates": off
# Prettier config https://github.com/prettier/eslint-plugin-prettier#recommended-configuration
prettier/prettier: warn
arrow-body-style: off
prefer-arrow-callback: off
# Unicorn plugin config
unicorn/filename-case: warn
# =================================================
# Node plugin
# =================================================
# Prevent from using method that are not yet availalbe in the supported version of node.(see engines field of package.json)
node/no-unsupported-features/node-builtins: error
node/no-unsupported-features/es-builtins: error
node/no-unsupported-features/es-syntax: off # Disabling this one otherwise it will complain about typescript imports which get transpiled.
node/no-missing-import: off
node/shebang: off
node/no-unpublished-import: off
# =================================================
# Jest plugin
# =================================================
jest/no-deprecated-functions: off
jest/expect-expect: off
jest/no-standalone-expect: off
jest/no-focused-tests: warn
jest/no-identical-title: warn
# =================================================
# Import plugin
# =================================================
import/no-default-export: warn
import/no-self-import: warn # This cause many circular dependency issues with index files.
import/no-internal-modules: off
import/no-unresolved: off
import/order:
- warn
- groups: ["builtin", "external", "parent", "sibling", "index"]
alphabetize:
order: "asc"
caseInsensitive: true
# Basic config
no-console: warn
no-undef: off
no-unused-vars: off
no-multiple-empty-lines:
- warn
- max: 2
maxBOF: 0
maxEOF: 1