-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.eslintrc.js
67 lines (55 loc) · 1.84 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
'use strict'
const os = require('os')
/** Line break style to be used, based on current OS */
const lbstyle = os.platform() === 'win32' ? 'windows' : 'unix'
module.exports = {
reportUnusedDisableDirectives: true,
extends: [
'@strv/node/v14',
'@strv/node/optional',
'@strv/node/style',
],
rules: {
// If your editor cannot show these to you, occasionally turn this off and run the linter
'no-warning-comments': 0,
// This repository is configured so that upon checkout, git should convert line endings to
// platform-specific defaults and convert them back to LF when checking in. As such, we must
// enforce CRLF endings on Windows, otherwise the lint task would fail on Windows systems.
'linebreak-style': ['error', lbstyle],
},
overrides: [{
files: [
'src/**/*.ts',
'test/**/*.ts',
'test/**/*.test.ts',
],
extends: [
'@strv/node/v14',
'@strv/node/optional',
'@strv/typescript',
'@strv/typescript/style',
'@strv/mocha',
],
parserOptions: {
project: 'tsconfig.json',
},
settings: {
'import/resolver': {
typescript: {},
},
},
env: {
// Disable Mocha globals which are enabled in @strv/mocha. We will import the necessary
// functions directly from 'mocha' package in this project.
// This is done so that we avoid having all of the Mocha globals being declared even in source
// files. It is currently not possible to disable these globals for source files but have them
// available in test files - they are either fully available or not available at all.
mocha: false,
},
rules: {
// If your editor cannot show these to you, occasionally turn this off and run the linter
'no-warning-comments': 0,
'linebreak-style': ['error', lbstyle],
},
}],
}