forked from confluentinc/confluent-kafka-javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
75 lines (72 loc) · 1.99 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
const js = require("@eslint/js");
const jest = require('eslint-plugin-jest');
const ts = require('typescript-eslint');
const tsdoc = require('eslint-plugin-tsdoc');
const ckjsSpecificSettings = {
languageOptions: {
globals: {
"require": "readonly",
"module": "writable",
"setImmediate": "readonly",
"setTimeout": "readonly",
"clearTimeout": "readonly",
"setInterval": "readonly",
"clearInterval": "readonly",
"console": "readonly"
}
},
"rules": {
"eqeqeq": ["error", "always"],
"no-use-before-define": ["error", "nofunc"],
"no-caller": "error",
"no-new": "error",
"no-eq-null": "error",
"no-trailing-spaces": "error",
"no-constant-condition": "off",
"semi": "error"
}
};
const ckjsSpecificJestSettings = {
"rules": {
"jest/no-disabled-tests": "off",
"jest/no-conditional-expect": "off",
}
};
module.exports = ts.config(
{
ignores: ["**/dist/"]
},
{
...js.configs.recommended,
files: ["lib/**/*.js", "test/promisified/**/*.js"],
ignores: []
},
{
...ckjsSpecificSettings,
files: ["lib/**/*.js", "test/promisified/**/*.js"],
ignores: []
},
{
...jest.configs['flat/recommended'],
files: ["test/promisified/**/*.js"]
},
{
...ckjsSpecificJestSettings,
files: ["test/promisified/**/*.js"]
},
...ts.configs.recommended.map((config) => ({
...config,
ignores: ["**/*.js", "types/rdkafka.d.ts", "types/kafkajs.d.ts", "types/config.d.ts"],
plugins: {
"@typescript-eslint": ts.plugin,
tsdoc,
},
rules: {
...config.rules,
"prefer-const": "warn",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-unused-vars": "warn",
"tsdoc/syntax": "warn",
}
})),
);