Skip to content

Commit b705d82

Browse files
committed
Update configuration
1 parent cdd4a7b commit b705d82

File tree

3 files changed

+486
-269
lines changed

3 files changed

+486
-269
lines changed

eslint.config.cjs

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,52 @@
11
// eslint.config.js
22
const js = require('@eslint/js');
33
const pluginPromise = require('eslint-plugin-promise');
4-
const pluginUnicorn = require('eslint-plugin-unicorn');
4+
const pluginUnicorn = require('eslint-plugin-unicorn').default;
55
const pluginN = require('eslint-plugin-n');
66
const prettier = require('eslint-config-prettier');
7+
const pluginMocha = require('eslint-plugin-mocha').default;
8+
const globals = require('globals');
79

810
module.exports = [
11+
js.configs.recommended,
912
{
13+
files: ['**/*.js'],
1014
ignores: ['dist/**', 'tmp/**', 'coverage/**'],
15+
languageOptions: {
16+
ecmaVersion: 2022,
17+
sourceType: 'commonjs',
18+
globals: {
19+
// Node.js globals
20+
...globals.node,
21+
...globals.mocha,
22+
},
23+
},
1124
plugins: {
1225
promise: pluginPromise,
1326
unicorn: pluginUnicorn,
1427
n: pluginN,
28+
mocha: pluginMocha,
29+
},
30+
rules: {
31+
...pluginPromise.configs.recommended.rules,
32+
...pluginN.configs.recommended.rules,
33+
...pluginUnicorn.configs.recommended.rules,
34+
...pluginMocha.configs.recommended.rules,
35+
// Give warnings for rules should fix in the future
36+
'no-prototype-builtins': 'warn',
37+
// Disable rules that don't fit this CommonJS project
38+
'unicorn/prefer-module': 'off',
39+
'unicorn/prevent-abbreviations': 'off',
40+
'unicorn/no-null': 'off',
41+
'unicorn/prefer-spread': 'warn',
42+
'unicorn/no-immediate-mutation': 'warn',
43+
'unicorn/prefer-single-call': 'warn',
44+
'unicorn/no-array-reduce': 'warn',
45+
'unicorn/no-await-expression-member': 'warn',
46+
'unicorn/prefer-structured-clone': 'warn',
47+
// Disable Mocha rule that doesn't fit existing test patterns
48+
'mocha/no-setup-in-describe': 'off',
1549
},
1650
},
1751
prettier,
18-
]
52+
];

0 commit comments

Comments
 (0)