-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
81 lines (78 loc) · 1.75 KB
/
eslint.config.mjs
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
76
77
78
79
80
81
import fs from 'node:fs';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import cheminfo from 'eslint-config-cheminfo-typescript/base';
import unicorn from 'eslint-config-cheminfo-typescript/unicorn';
import globals from 'globals';
export default [
{
ignores: [
'packages/*/coverage',
'packages/*/dist',
'packages/*/docs',
'packages/*/examples',
'packages/*/example',
'packages/*/lib',
'packages/*/lib-module',
'packages/*/node_modules',
'packages/chemical-groups/src/groups.js',
'packages/chemical-groups/src/groupsObject.js',
],
},
...cheminfo,
...unicorn,
{
languageOptions: {
globals: {
...globals.node,
},
},
rules: {
'max-lines-per-function': [
'warn',
{
max: 1000,
skipBlankLines: true,
skipComments: true,
},
],
'no-shadow': [
'error',
{
builtinGlobals: true,
hoist: 'all',
allow: [],
},
],
'no-await-in-loop': 'off',
'prefer-named-capture-group': 'off',
},
},
{
files: ['**/__tests__/**'],
rules: {
'max-lines-per-function': 'off',
},
},
...createNoExtraneousConfigs(),
];
function createNoExtraneousConfigs() {
const configs = [];
for (const pkg of fs.readdirSync('packages')) {
configs.push({
files: [`packages/${pkg}/**`],
rules: {
'import/no-extraneous-dependencies': [
'error',
{
packageDir: [
fileURLToPath(new URL(`packages/${pkg}`, import.meta.url)),
path.dirname(fileURLToPath(import.meta.url)),
],
},
],
},
});
}
return configs;
}