forked from Mafalda-SFU/eslint-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
47 lines (47 loc) · 1.51 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
module.exports = {
overrides: [
{
env: {
'jest/globals': true
},
extends: ['plugin:jest/all'],
files: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'],
overrides: [
{
files: ['*.js?(x)'],
rules: {
// requires types information, provided by `@typescript-eslint`. It
// should fail silently if not available , but it doesn't, so we
// explicitly disable it to be on the safe sides.
'jest/unbound-method': 'off'
}
},
{
files: ['*.ts?(x)'],
rules: {
// Disabled for `jest/unbound-method`
'@typescript-eslint/unbound-method': 'off'
}
}
],
plugins: ['jest'],
rules: {
'jest/consistent-test-it': [
'error', {withinDescribe: 'test'} // NOTE: Opinionated
],
'jest/max-expects': 'off', // NOTE: Opinionated
'jest/no-disabled-tests': 'warn',
'jest/no-focused-tests': 'error',
'jest/no-hooks': ['error', {allow: ['afterEach', 'beforeEach']}],
'jest/no-large-snapshots': [
'error', {inlineMaxSize: 50, maxSize: Infinity} // NOTE: Opinionated
],
'jest/prefer-lowercase-title': [
'error', {ignore: ['describe', 'test']} // NOTE: Opinionated
],
'jest/prefer-snapshot-hint': 'off', // NOTE: Opinionated
'jest/require-top-level-describe': 'off' // NOTE: Opinionated
}
}
]
};