-
Notifications
You must be signed in to change notification settings - Fork 43
/
.eslintrc.cjs
40 lines (40 loc) · 1.35 KB
/
.eslintrc.cjs
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
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest', // Allows the use of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
},
plugins: [
'@typescript-eslint',
'todo-plz', // for enforcing TODO formatting to require "github.com/TBD54566975/dwn-server/issues/"
],
env: {
node: true, // Enable Node.js global variables
browser: true,
},
rules: {
'max-len': ['error', { code: 150, ignoreStrings: true }],
'brace-style': ['error', '1tbs', { 'allowSingleLine': false }],
curly: ['error', 'all'],
'no-console': 'off',
'@typescript-eslint/explicit-function-return-type': ['error'],
// enforce `import type` when an import is not used at runtime, allowing transpilers/bundlers to drop imports as an optimization
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/no-unused-vars': [
'error',
{
vars: 'all',
args: 'after-used',
ignoreRestSiblings: true,
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
'prefer-const': ['error', { destructuring: 'all' }],
// enforce github issue reference for every TO-DO comment
'todo-plz/ticket-ref': [
'error',
{ commentPattern: '.*github.com/TBD54566975/dwn-server/issues/.*' },
],
},
};