-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy patheslint.config.js
More file actions
73 lines (62 loc) · 1.61 KB
/
Copy patheslint.config.js
File metadata and controls
73 lines (62 loc) · 1.61 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
// ESLint configuration <https://eslint.org/docs/user-guide/configuring>
'use strict';
const { default: nodejs } = require('@kevinoid/eslint-config/nodejs.js');
const globals = require('globals');
module.exports = [
{
ignores: [
'coverage/',
'doc/',
],
},
...nodejs,
{
rules: {
// Allow requiring devDependencies for build and test
'import/no-extraneous-dependencies': ['error', {
devDependencies: [
...nodejs
.findLast(
(conf) => conf.rules?.['import/no-extraneous-dependencies'],
)
.rules['import/no-extraneous-dependencies'][1].devDependencies,
'test-bin/**',
'test-lib/**',
'test/**',
],
}],
// Allow CommonJS modules
'unicorn/prefer-module': 'off',
// Don't prefer top-level await
// Since top-level await is only supported in ECMAScript Modules (ESM)
'unicorn/prefer-top-level-await': 'off',
},
},
{
name: 'bin config',
files: [
'bin/*.js',
'test-bin/*',
],
rules: {
// Executable scripts should have a shebang
'n/hashbang': 'off',
},
},
{
name: 'test config',
basePath: 'test',
languageOptions: {
globals: globals.mocha,
},
rules: {
// Allow, but don't require, braces around function body
// Braces around body of it() function is more consistent/readable
'arrow-body-style': 'off',
// Allow null use in tests
'unicorn/no-null': 'off',
// Allow EventEmitter use in tests
'unicorn/prefer-event-target': 'off',
},
},
];