-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy patheslint.config.js
More file actions
55 lines (52 loc) · 1.47 KB
/
eslint.config.js
File metadata and controls
55 lines (52 loc) · 1.47 KB
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
import { defineConfig, globalIgnores } from 'eslint/config';
import { FlatCompat } from '@eslint/eslintrc';
import globals from 'globals';
import onlyWarn from 'eslint-plugin-only-warn';
import tsParser from '@typescript-eslint/parser';
import js from '@eslint/js';
const __dirname = import.meta.dirname;
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});
/** @type {import('eslint').Linter.Config[]} */
export default defineConfig([
{
languageOptions: {
globals: {
...globals.node,
},
ecmaVersion: 'latest',
sourceType: 'module',
parserOptions: {},
},
extends: compat.extends('plugin:sonarjs/recommended-legacy', 'plugin:promise/recommended', 'prettier'),
rules: {
'sonarjs/no-duplicate-string': 'off',
'sonarjs/no-nested-template-literals': 'off',
'sonarjs/cognitive-complexity': 'off',
'global-require': 'off',
'no-restricted-exports': 'off',
'no-console': 'off',
'func-names': 'off',
'no-template-curly-in-string': 'off',
'no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
},
],
},
plugins: {
'only-warn': onlyWarn,
},
},
{
files: ['**/*.ts'],
languageOptions: {
parser: tsParser,
},
},
globalIgnores(['**/node_modules', '**/dist', '**/.idea', '**/.vscode', '**/reports', '**/tar', '!**/*.js', '!**/*.ts']),
]);