aboutsummaryrefslogtreecommitdiff
path: root/.eslintrc.yml
blob: 87e46521be2d0922606f0f8fa398b6053917aaa0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
---
root: true
plugins:
  - import
  - jsdoc
  - node
  - promise
  - sonarjs
  - prettier
  - unicorn
  - '@typescript-eslint'
  - unused-imports
extends:
  - ./.eslint-license-header.yml
  - eslint:recommended
  - plugin:import/recommended
  - plugin:node/recommended
  - plugin:unicorn/recommended
  - prettier
  - plugin:@typescript-eslint/eslint-recommended
  - plugin:@typescript-eslint/recommended
  - plugin:import/typescript
env:
  mocha: true
  node: true
  es6: true
rules:
  prettier/prettier: error
  comma-dangle:
    - error
    - arrays: always-multiline
      objects: always-multiline
      imports: always-multiline
      exports: always-multiline
      functions: always-multiline
  eol-last:
    - error
    - always
  eqeqeq:
    - error
    - smart
  import/default: off # fs-extra trips this. the ts compiler catches actual errors
  import/extensions: error
  import/first: error
  import/newline-after-import: error
  import/no-absolute-path: error
  import/no-cycle: error
  import/no-default-export: error
  import/no-deprecated: error
  import/no-mutable-exports: error
  import/no-named-as-default-member: off # Far too many things (express, morgan, fs) trip this
  import/no-self-import: error
  import/no-useless-path-segments: error
  import/no-webpack-loader-syntax: error
  import/no-unresolved: off # Doesn't like .js files
  import/order:
    - error
    - alphabetize:
        order: asc
        caseInsensitive: true
      newlines-between: always
  max-len:
    - error
    - 120
    - ignoreRegExpLiterals: true
  max-statements:
    - error
    - 100 # TODO reduce...was 50
  no-console: error
  no-control-regex: 0
  no-duplicate-imports: error
  no-useless-call: error
  no-useless-computed-key: error
  no-useless-concat: error
  '@typescript-eslint/no-useless-constructor': error
  no-useless-escape: error
  no-useless-rename: error
  no-useless-return: error
  no-empty:
    - error
    - allowEmptyCatch: true
  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
  keyword-spacing:
    - error
    - after: true
  yoda:
    - error
    - never
    - onlyEquality: true
  prefer-const:
    - error
    - destructuring: all
  jsdoc/check-alignment: error
  jsdoc/check-param-names: error
  jsdoc/check-syntax: error
  jsdoc/check-tag-names: off
  jsdoc/check-types: error
  jsdoc/empty-tags: error
  jsdoc/require-hyphen-before-param-description: error
  jsdoc/valid-types: error
  no-multiple-empty-lines:
    - error
    - max: 1
      maxBOF: 0
      maxEOF: 0
  no-process-exit: off
  node/no-unsupported-features/es-syntax: off
  node/shebang: off
  node/no-missing-import: off # Doesn't like .js imports of .interfaces.ts files
  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:
    - error
    - 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
  unicorn/no-process-exit: off
  unicorn/no-useless-undefined:
    - error
    - checkArguments: false
  'unused-imports/no-unused-imports': error
  '@typescript-eslint/no-empty-function': off
  '@typescript-eslint/no-unused-vars': off
  '@typescript-eslint/no-explicit-any': off
parserOptions:
  sourceType: module
  ecmaVersion: 2020
globals:
  BigInt: true
settings:
  node:
    tryExtensions: [.js, .ts]
  import/parsers:
    '@typescript-eslint/parser': [.ts, .tsx]
  import/resolver: 'typescript'