blob: f836f7598ecbdebe161cefc3e74c023a356163d2 [file] [log] [blame] [raw]
---
root: true
plugins:
- import
- jsdoc
- node
- promise
- sonarjs
- unicorn
extends:
# - ./.eslint-license-header.yml Disabled for now until we fully incorporate prettier
- eslint:recommended
- plugin:import/recommended
- plugin:node/recommended
- plugin:unicorn/recommended
- prettier
env:
mocha: true
node: true
es6: true
rules:
comma-dangle:
- error
- always-multiline
eol-last:
- error
- always
eqeqeq:
- error
- smart
import/extensions: error
import/first: error
import/newline-after-import: error
import/no-absolute-path: error
import/no-cycle: error
import/no-default-export: warn
import/no-deprecated: warn
import/no-mutable-exports: error
import/no-self-import: error
import/no-useless-path-segments: error
import/no-webpack-loader-syntax: error
import/order:
- warn
- alphabetize:
order: asc
caseInsensitive: true
newlines-between: always
max-len:
- error
- 120
- ignoreRegExpLiterals: true
max-statements:
- error
- 100 # TODO reduce...was 50
no-control-regex: 0
no-duplicate-imports: error
no-useless-call: error
no-useless-computed-key: error
no-useless-concat: error
no-useless-constructor: error
no-useless-escape: error
no-useless-rename: error
no-useless-return: error
quote-props:
- error
- as-needed
quotes:
- error
- single
- allowTemplateLiterals: true
avoidEscape: true
semi:
- error
- always
space-before-function-paren:
- error
- anonymous: always
asyncArrow: always
named: never
yoda:
- error
- never
- onlyEquality: true
jsdoc/check-alignment: warn
jsdoc/check-param-names: warn
jsdoc/check-syntax: warn
jsdoc/check-tag-names: warn
jsdoc/check-types: warn
jsdoc/empty-tags: warn
jsdoc/newline-after-description: warn
jsdoc/require-hyphen-before-param-description: warn
jsdoc/valid-types: warn
no-multiple-empty-lines:
- warn
- max: 1
maxBOF: 0
maxEOF: 0
no-process-exit: off
node/no-unsupported-features/es-syntax: off
node/shebang: off
promise/catch-or-return: error
promise/no-new-statics: error
promise/no-return-wrap: error
promise/param-names: error
promise/valid-params: error
sonarjs/no-collection-size-mischeck: error
sonarjs/no-redundant-boolean: error
sonarjs/no-unused-collection: error
sonarjs/prefer-immediate-return: error
sonarjs/prefer-object-literal: error
sonarjs/prefer-single-boolean-return: error
sort-imports:
- warn
- ignoreCase: true
ignoreDeclarationSort: true
unicorn/catch-error-name: off
unicorn/consistent-function-scoping: off
unicorn/empty-brace-spaces: off
unicorn/no-fn-reference-in-iterator: off
unicorn/no-hex-escape: off
unicorn/no-null: off
unicorn/no-reduce: off
unicorn/numeric-separators-style: off
unicorn/prefer-add-event-listener: off
unicorn/prefer-flat-map: error
unicorn/prefer-optional-catch-binding: off
unicorn/prefer-node-protocol: off # until we get node 16+
unicorn/prefer-number-properties: off
unicorn/prefer-string-slice: off
unicorn/prevent-abbreviations: off
# things we'd like to turn on but need fairly extensive code changes:
unicorn/prefer-ternary: off
unicorn/prefer-array-some: off
unicorn/prefer-spread: off
unicorn/no-lonely-if: off
unicorn/no-array-reduce: off
unicorn/prefer-array-flat: off # can't turn off yet without tests blowing up; lodash vs underscore?
unicorn/no-array-callback-reference: off
unicorn/prefer-switch: off
unicorn/no-static-only-class: off
parserOptions:
sourceType: module
ecmaVersion: 2020
globals:
BigInt: true