-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
47 lines (42 loc) · 1.39 KB
/
index.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
import neostandard, { resolveIgnoresFromGitignore } from 'neostandard';
import { additionalRules } from './base-configs/additional-rules.js';
import { esmRules } from './base-configs/esm.js';
import { jsdocRules } from './base-configs/jsdoc.js';
import { mochaRules } from './base-configs/mocha.js';
import { nodeRules } from './base-configs/node.js';
import { regexpRules } from './base-configs/regexp.js';
import { modifiedNeostandardRules } from './base-configs/modified-rules.js';
/**
* @param {{ cjs?: boolean, noMocha?: boolean } & import('neostandard').NeostandardOptions} [options]
* @returns {import('eslint').Linter.Config[]}
*/
export function voxpelli (options) {
const {
cjs = false,
ignores: rawIgnores,
noMocha,
...neostandardOptions
} = options || {};
const ignores = [
'coverage/**/*',
...resolveIgnoresFromGitignore(),
...rawIgnores || [],
];
return [
// If ignores is the lone key, then that amounts to being global ignores: https://eslint.org/docs/latest/use/configure/configuration-files#globally-ignoring-files-with-ignores
{ ignores },
...neostandard({
semi: true,
ts: true,
...neostandardOptions,
}),
...modifiedNeostandardRules,
...additionalRules,
...jsdocRules,
...regexpRules,
...nodeRules(cjs),
...cjs ? [] : esmRules,
...noMocha ? [] : mochaRules,
];
}
export default voxpelli();