-
Notifications
You must be signed in to change notification settings - Fork 3
/
eslint.config.js
44 lines (43 loc) · 1.32 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
import js from '@eslint/js';
import mochaPlugin from 'eslint-plugin-mocha';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
import babelParser from '@babel/eslint-parser';
import pluginSyntaxImportAssertions from '@babel/plugin-syntax-import-assertions';
export default [
js.configs.recommended,
{
rules: {
'no-unused-vars': ['error', { argsIgnorePattern: '_', caughtErrorsIgnorePattern: '_' }],
'no-var': ['error'],
'prefer-const': ['error'],
'no-undef': ['off'],
'no-console': ['error'],
},
},
{
languageOptions: {
ecmaVersion: 2020,
sourceType: 'module',
parser: babelParser,
parserOptions: {
requireConfigFile: false,
babelOptions: {
plugins: [pluginSyntaxImportAssertions], // needed for the "import pkg from '../../package.json' with { type: 'json' };" syntax
},
},
},
},
eslintPluginPrettierRecommended,
mochaPlugin.configs.flat.recommended,
{
rules: {
'mocha/no-setup-in-describe': ['off'],
'mocha/no-exclusive-tests': ['error'],
'mocha/no-pending-tests': ['error'],
'mocha/no-skipped-tests': ['error'],
'mocha/no-hooks-for-single-case': ['off'],
'mocha/no-top-level-hooks': ['error'],
'mocha/no-global-tests': ['off'],
},
},
];