forked from Tsalmas-Anastasios/node-express-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
85 lines (83 loc) · 2.67 KB
/
eslint.config.js
File metadata and controls
85 lines (83 loc) · 2.67 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import js from '@eslint/js';
import { defineConfig } from 'eslint/config';
import eslintConfigPrettier from 'eslint-config-prettier/flat';
import importPlugin from 'eslint-plugin-import';
import simpleImportSort from 'eslint-plugin-simple-import-sort';
import sonarJs from 'eslint-plugin-sonarjs';
import eslintPluginUnicorn from 'eslint-plugin-unicorn';
import globals from 'globals';
import { configs as typeScriptConfigs } from 'typescript-eslint';
export default defineConfig([
{
ignores: ['docs/**/*', '**/{build,coverage,dist,generated,.nx,.turbo}', '**/*.generated.*'],
},
{
files: ['**/*.{js,jsx,ts,tsx}'],
extends: [
js.configs.recommended,
typeScriptConfigs.recommended,
typeScriptConfigs.stylistic,
importPlugin.flatConfigs.recommended,
importPlugin.flatConfigs.typescript,
eslintPluginUnicorn.configs.recommended,
sonarJs.configs.recommended,
eslintConfigPrettier,
],
plugins: {
'simple-import-sort': simpleImportSort,
},
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
parserOptions: {
ecmaFeatures: { jsx: true },
},
globals: {
...globals.browser,
...globals.node,
},
},
rules: {
'no-console': ['warn', { allow: ['error'] }],
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
args: 'all',
argsIgnorePattern: '^_',
caughtErrors: 'all',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
varsIgnorePattern: '^_',
ignoreRestSiblings: true,
},
],
camelcase: [
'error',
{
properties: 'always',
ignoreDestructuring: false,
},
],
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
'import/first': 'error',
'import/newline-after-import': 'error',
'import/no-duplicates': 'error',
},
settings: {
'import/resolver': {
typescript: true,
node: true,
},
},
},
{
files: ['**/*.test.{ts, tsx, js, jsx}'],
languageOptions: {
globals: {
...globals.jest,
},
},
},
]);