-
Notifications
You must be signed in to change notification settings - Fork 2
/
eslint.config.js
96 lines (93 loc) · 2.27 KB
/
eslint.config.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
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
const config = require('@rubensworks/eslint-config');
module.exports = config([
{
files: [ '**/*.ts' ],
languageOptions: {
parserOptions: {
tsconfigRootDir: __dirname,
project: [ './tsconfig.eslint.json' ],
},
},
},
{
rules: {
// Default
'unicorn/consistent-destructuring': 'off',
'unicorn/no-array-callback-reference': 'off',
// TODO: check if these can be enabled
'ts/naming-convention': 'off',
'ts/no-unsafe-return': 'off',
'ts/no-unsafe-argument': 'off',
'ts/no-unsafe-assignment': 'off',
'ts/no-require-imports': [ 'error', { allow: [
'process/',
'web-streams-ponyfill',
'is-stream',
'readable-stream-node-to-web',
'stream-to-string',
]}],
'ts/no-var-requires': [ 'error', { allow: [
'process/',
'web-streams-ponyfill',
'is-stream',
'readable-stream-node-to-web',
'stream-to-string',
]}],
},
},
{
// Specific rules for NodeJS-specific files
files: [
'**/test/**/*.ts',
],
rules: {
'import/no-nodejs-modules': 'off',
'unused-imports/no-unused-vars': 'off',
'ts/no-require-imports': 'off',
'ts/no-var-requires': 'off',
},
},
{
// The config packages use an empty index.ts
files: [
'engines/config-*/lib/index.ts',
],
rules: {
'import/unambiguous': 'off',
},
},
{
// Some test files import 'jest-rdf' which triggers this
// The http actors import 'cross-fetch/polyfill' which also triggers this
// Some jest tests import '../../lib' which triggers this
files: [
'**/test/*-test.ts',
'**/test/*-util.ts',
],
rules: {
'import/no-unassigned-import': 'off',
},
},
{
// Files that do not require linting
ignores: [
'setup-jest.js',
'**/engine-default.js',
'**/engine-browser.js',
'**/comunica-browser.js',
'.github/**',
'**/bintest/**',
'lerna.json',
],
},
{
files: [ '**/*.js' ],
rules: {
'ts/no-require-imports': 'off',
'ts/no-var-requires': 'off',
'import/no-nodejs-modules': 'off',
'import/no-extraneous-dependencies': 'off',
'import/extensions': 'off',
},
},
]);