-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy patheslint.config.mjs
38 lines (35 loc) · 1023 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
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { FlatCompat } from '@eslint/eslintrc';
import { fixupConfigRules, includeIgnoreFile } from '@eslint/compat';
import js from '@eslint/js';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const gitignorePath = path.resolve(__dirname, '.gitignore');
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended
});
export default [
includeIgnoreFile(gitignorePath),
...fixupConfigRules(compat.extends('eslint:recommended', 'prettier')),
...compat.config({
env: {
browser: true,
node: true,
es6: true
},
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module'
},
plugins: ['prettier'],
extends: ['prettier'],
rules: {
'no-unused-vars': ['error', { caughtErrors: 'none' }],
'prettier/prettier': 2,
strict: [2, 'global'],
'global-strict': [0, 'always']
}
})
];