Repository navigation
Expand file tree
/
Copy patheslint.config.js
More file actions
75 lines (72 loc) · 2.64 KB
/
Copy patheslint.config.js
File metadata and controls
75 lines (72 loc) · 2.64 KB
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
'use strict';
// Shared lint baseline for the Postal Systems / Nodemailer packages: eslint:recommended
// plus the rules of the retired eslint-config-nodemailer, with formatting left to Prettier.
// Keep this file identical across repos except for the "Repo-specific" block at the end.
const js = require('@eslint/js');
const prettier = require('eslint-config-prettier');
const globals = require('globals');
module.exports = [
{
ignores: ['node_modules/**', 'coverage/**', 'dist/**']
},
js.configs.recommended,
{
files: ['**/*.js', '**/*.cjs'],
languageOptions: {
ecmaVersion: 2022,
sourceType: 'commonjs',
globals: { ...globals.node }
},
rules: {
'no-await-in-loop': 'error',
'no-div-regex': 'error',
strict: ['error', 'global'],
eqeqeq: 'error',
'dot-notation': 'error',
curly: 'error',
'no-unused-expressions': ['error', { allowShortCircuit: true }],
'no-unused-vars': ['error', { varsIgnorePattern: '^_', argsIgnorePattern: '^_', caughtErrorsIgnorePattern: '^_' }],
'handle-callback-err': 'error',
'no-new': 'error',
'new-cap': 'error',
'no-eval': 'error',
'no-invalid-this': 'error',
radix: ['error', 'always'],
'no-use-before-define': ['error', 'nofunc'],
'callback-return': ['error', ['callback', 'cb', 'done']],
'no-redeclare': 'error',
'block-scoped-var': 'error',
'no-sequences': 'error',
'no-throw-literal': 'error',
'no-useless-call': 'error',
'no-useless-concat': 'error',
'no-void': 'error',
yoda: 'error',
'no-var': 'error',
'no-bitwise': 'error',
'no-lonely-if': 'error',
'arrow-body-style': ['error', 'as-needed'],
'prefer-arrow-callback': 'error',
'object-shorthand': 'error',
'prefer-spread': 'error',
'no-prototype-builtins': 'off'
}
},
{
files: ['test/**'],
languageOptions: {
globals: { ...globals.node, ...globals.mocha }
}
},
// Repo-specific: overrides go here, each with a one-line reason
{
// lib/ is what millions of old consumers load, keep the shipped file byte-identical to 0.1.13
// rather than rewriting it for style (2 no-var, 5 no-useless-escape, all behavior-neutral)
files: ['lib/**'],
rules: {
'no-var': 'off',
'no-useless-escape': 'off'
}
},
prettier
];