This repository has been archived by the owner on Jan 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
.eslintrc.js
53 lines (43 loc) · 1.75 KB
/
.eslintrc.js
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
module.exports = {
root: true,
parser: '@typescript-eslint/parser', // Make ESLint compatible with TypeScript
parserOptions: {
// Enable linting rules with type information from our tsconfig
tsconfigRootDir: __dirname,
project: ['./tsconfig.eslint.json'],
sourceType: 'module', // Allow the use of imports / ES modules
ecmaFeatures: {
impliedStrict: true, // Enable global strict mode
},
},
// Specify global variables that are predefined
env: {
browser: true, // Enable browser global variables
node: true, // Enable node global variables & Node.js scoping
es2020: true, // Add all ECMAScript 2020 globals and automatically set the ecmaVersion parser option to ES2020
},
plugins: [
'@typescript-eslint', // Add some TypeScript specific rules, and disable rules covered by the typechecker
'import', // Add rules that help validate proper imports
],
extends: ['@xpring-eng/eslint-config-base/loose'],
rules: {
// TODO:(hbergren) Remove this rule when the PayID logger lives in a standalone library
'no-console': 'off',
},
overrides: [
{
files: 'test/**/*.test.ts',
rules: {
// Because of gRPC, our tests have to have a ton of imports
'import/max-dependencies': ['warn', { max: 11 }],
// Because of gRPC, our tests have to have a ton of statements to be useful
'max-statements': ['warn', { max: 40 }],
// TODO:(@hbergren) We should be able to get rid of this rule eventually.
// When we refactor our test files to be more specific / smaller,
// we can remove this rule and use the stricter config provided for this rule in @xpring-eng/eslint-config-base.
'max-lines': ['warn', { max: 400 }],
},
},
],
}