aboutsummaryrefslogtreecommitdiffhomepage
path: root/eslint.config.js
blob: 3bca729f1c2c424d2adbb139dc72b8a5cbd60ae0 (plain)
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
import globals from 'globals'
import js from '@eslint/js'
import importPlugin from 'eslint-plugin-import'
import promisePlugin from 'eslint-plugin-promise'
import nodePlugin from 'eslint-plugin-node'
import jsdoc from 'eslint-plugin-jsdoc'

export default [
  js.configs.recommended,
  {
    languageOptions: {
      ecmaVersion: 2022,
      sourceType: 'module',
      globals: {
        ...globals.browser,
        ...globals.node
      }
    },
    plugins: {
      import: importPlugin,
      promise: promisePlugin,
      node: nodePlugin
    },
    rules: {
      'no-unused-vars': ['warn', {
        varsIgnorePattern: '^_',
        argsIgnorePattern: '^_',
        caughtErrorsIgnorePattern: '^ignore|_'
      }],
      'import/no-unresolved': 'error',
      'no-console': ['error', { allow: ['info', 'warn', 'error'] }],
      eqeqeq: ['error', 'always'],
      // 'curly': ['warn', 'multi'],
      'prefer-const': 'error',
      'no-var': 'error',
      'array-callback-return': 'error',
      'no-unexpected-multiline': 'warn'
    }
  },
  {
    files: ['src/*js'],
    plugins: {
      jsdoc
    },
    rules: {
      'jsdoc/require-description': 'warn'
    }
  }
]