-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy patheslint.config.mjs
41 lines (38 loc) · 995 Bytes
/
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
import { fileURLToPath } from 'node:url';
import * as path from 'node:path';
import globals from 'globals';
import { FlatCompat } from '@eslint/eslintrc';
import pluginJs from '@eslint/js';
import pluginJest from 'eslint-plugin-jest';
import jest from 'eslint-plugin-jest';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
});
/** @type {import('eslint').Linter.Config[]} */
export default [
{
plugins: { jest: pluginJest },
languageOptions: { globals: globals.node },
},
pluginJs.configs.recommended,
{
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
},
},
{
ignores: ['node-modules'],
},
{
files: ['**/*.test.js'],
...jest.configs['flat/recommended'],
},
...compat.config({
plugins: ['require-extensions'],
extends: 'plugin:require-extensions/recommended',
ignorePatterns: ['**/*.test.js'],
}),
];