import globals from 'globals'
import js from '@eslint/js'
import eslintConfigPrettier from 'eslint-config-prettier'

export default [
  js.configs.recommended,
  {
    languageOptions: {
      globals: {
        ...globals.browser,
        ...globals.node,
        jQuery: 'readonly',
        Drupal: 'readonly',
        once: 'readonly',
      },

      ecmaVersion: 'latest',
      sourceType: 'module',
    },

    rules: {
      eqeqeq: 'error',
      'no-var': 'error',
      'prefer-template': 'error',
      'max-params': ['warn', 5],
      camelcase: ['error', { properties: 'never' }],
      'new-cap': ['error', { properties: false }],
      'no-new': 'off',
      'capitalized-comments': 'off',
      'no-negated-condition': 'off',
      'arrow-body-style': 'off',
    },
  },
  eslintConfigPrettier,
]
