refactor: cleanup eslint configuration
[e-mobility-charging-stations-simulator.git] / .eslintrc.cjs
1 // eslint-disable-next-line n/no-unpublished-require
2 const { defineConfig } = require('eslint-define-config')
3
4 module.exports = defineConfig({
5 root: true,
6 env: {
7 es2022: true,
8 node: true
9 },
10 parserOptions: {
11 sourceType: 'module',
12 ecmaVersion: 2022
13 },
14 plugins: ['simple-import-sort', 'import'],
15 extends: ['eslint:recommended', 'plugin:import/recommended'],
16 settings: {
17 'import/resolver': {
18 typescript: {
19 project: './tsconfig.json'
20 }
21 }
22 },
23 rules: {
24 'simple-import-sort/imports': 'error',
25 'simple-import-sort/exports': 'error'
26 // 'sort-imports': [
27 // 'error',
28 // {
29 // ignoreCase: false,
30 // ignoreDeclarationSort: true,
31 // ignoreMemberSort: false,
32 // memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
33 // allowSeparatedGroups: true
34 // }
35 // ],
36 // 'import/order': [
37 // 'error',
38 // {
39 // groups: [
40 // 'builtin', // Built-in imports (come from NodeJS native) go first
41 // 'external', // <- External imports
42 // 'internal', // <- Absolute imports
43 // ['sibling', 'parent'], // <- Relative imports, the sibling and parent types they can be mingled together
44 // 'index', // <- Index imports
45 // 'unknown' // <- Unknown
46 // ],
47 // 'newlines-between': 'always',
48 // alphabetize: {
49 // /* Sort in ascending order. Options: ["ignore", "asc", "desc"] */
50 // order: 'asc',
51 // /* Ignore case. Options: [true, false] */
52 // caseInsensitive: true
53 // }
54 // }
55 // ]
56 },
57 overrides: [
58 {
59 files: ['**/*.ts'],
60 parser: '@typescript-eslint/parser',
61 parserOptions: {
62 project: './tsconfig.json'
63 },
64 plugins: ['@typescript-eslint', 'eslint-plugin-tsdoc'],
65 extends: [
66 'plugin:@typescript-eslint/strict-type-checked',
67 'plugin:@typescript-eslint/stylistic-type-checked',
68 'plugin:import/typescript',
69 'standard-with-typescript'
70 ],
71 rules: {
72 'operator-linebreak': 'off',
73 'tsdoc/syntax': 'warn'
74 }
75 },
76 {
77 files: ['**/*.js', '**/*.cjs', '**/*.mjs'],
78 plugins: ['jsdoc'],
79 extends: ['plugin:n/recommended', 'plugin:jsdoc/recommended', 'standard'],
80 rules: {
81 'n/shebang': 'off'
82 }
83 }
84 ]
85 })