Skip to content
Snippets Groups Projects
.eslintrc.yml 4.30 KiB
env:
  browser: true
  es6: true

# See https://github.com/OCA/odoo-community.org/issues/37#issuecomment-470686449
parserOptions:
  ecmaVersion: 2017

overrides:
  - files:
      - "**/*.esm.js"
    parserOptions:
      sourceType: module

# Globals available in Odoo that shouldn't produce errorings
globals:
  _: readonly
  $: readonly
  fuzzy: readonly
  jQuery: readonly
  moment: readonly
  odoo: readonly
  openerp: readonly
  owl: readonly

# Styling is handled by Prettier, so we only need to enable AST rules;
# see https://github.com/OCA/maintainer-quality-tools/pull/618#issuecomment-558576890
rules:
  accessor-pairs: warn
  array-callback-return: warn
  callback-return: warn
  capitalized-comments:
    - warn
    - always
    - ignoreConsecutiveComments: true
      ignoreInlineComments: true
  complexity:
    - warn
    - 15
  constructor-super: warn
  dot-notation: warn
  eqeqeq: warn
  global-require: warn
  handle-callback-err: warn
  id-blacklist: warn
  id-match: warn
  init-declarations: error
  max-depth: warn
  max-nested-callbacks: warn
  max-statements-per-line: warn
  no-alert: warn
  no-array-constructor: warn
  no-caller: warn
  no-case-declarations: warn
  no-class-assign: warn
  no-cond-assign: error
  no-const-assign: error
  no-constant-condition: warn
  no-control-regex: warn
  no-debugger: error
  no-delete-var: warn
  no-div-regex: warn
  no-dupe-args: error
  no-dupe-class-members: error
  no-dupe-keys: error
  no-duplicate-case: error
  no-duplicate-imports: error
  no-else-return: warn
  no-empty-character-class: warn
  no-empty-function: error