Skip to content
Snippets Groups Projects
.eslintrc.js 3.10 KiB
module.exports = {
  root: true,
  env: {
    node: true
  },
  extends: [
    'eslint:recommended',
    '@vue/standard',
    '@vue/typescript/recommended',
    'plugin:vue/vue3-strongly-recommended',
    'plugin:import/errors',
    'plugin:import/warnings'
  ],
  plugins: [
    'mocha'
  ],
  parserOptions: {
    ecmaVersion: 2020
  },
  rules: {
    'no-console': 1,
    'no-debugger': 1,
    'no-inline-comments': 1,
    'spaced-comment': 1,
    'multiline-comment-style': 1,
    'vue/array-bracket-spacing': 1,
    'vue/arrow-spacing': 1,
    'vue/block-spacing': 1,
    'vue/comma-dangle': 1,
    'vue/component-definition-name-casing': 2,
    'vue/component-name-in-template-casing': 2,
    'vue/eqeqeq': 1,
    'vue/html-self-closing': [
      1,
      {
        html: {
          normal: 'never',
          void: 'always'
        }
      }
    ],
    'vue/key-spacing': 2,
    'vue/keyword-spacing': 1,
    'vue/match-component-file-name': [
      2,
      {
        extensions: [
          '.jsx',
          '.tsx',
          '.vue'
        ]
      }
    ],
    'vue/max-attributes-per-line': [
      1,
      {
        singleline: 3
      }
    ],
    'vue/no-deprecated-scope-attribute': 2,
    'vue/no-deprecated-slot-attribute': 2,
    'vue/no-deprecated-slot-scope-attribute': 2,
    'vue/no-empty-pattern': 2,
    'vue/no-irregular-whitespace': 2,
    'vue/no-reserved-component-names': 2,
    'vue/no-static-inline-styles': 2,
    'vue/no-v-html': 2,
    'vue/object-curly-spacing': [
      2,
      'always'
    ],
    'vue/padding-line-between-blocks': 2,
    'vue/space-infix-ops': 2,
    'vue/space-unary-ops': [
      2,
      {
        words: true,
        nonwords: false
      }
    ],
    'vue/this-in-template': 2,
    'vue/v-on-style': [
      2,
      'longform'
    ],
    'vue/v-on-function-call': 2,
    'vue/v-slot-style': [
      2,
      {
        default: 'longform',
        named: 'longform'
      }
    ],
    'vue/valid-v-bind-sync': 2,
    'vue/valid-v-slot': 2,

    // Do not force a new line on each HTML content
    'vue/singleline-html-element-content-newline': 0,
    // Allow nested template tags with attributes as in src/components/Corpus/AllowedMetaData/Row.vue
    'vue/no-useless-template-attributes': 0,
    // Disable multi word components for campatibility
    'vue/multi-word-component-names': 0,

    // Mocha specific settings
    'mocha/max-top-level-suites': 1,
    'mocha/no-exclusive-tests': 2,
    'mocha/no-global-tests': 1,
    'mocha/no-nested-tests': 1,
    'mocha/no-pending-tests': 1,
    'mocha/no-skipped-tests': 1,
    'mocha/no-identical-title': 2,
    'mocha/handle-done-callback': 2,
    'mocha/no-return-and-callback': 2,
    'mocha/no-setup-in-describe': 2,
    'mocha/no-sibling-hooks': 2,
    'mocha/no-top-level-hooks': 1
  },
  settings: {
    'import/resolver': {
      alias: {
        map: [
          ['@', './src']
        ],
        extensions: ['.vue', '.js', '.jsx', '.ts', '.tsx']
      }
    }
  },
  overrides: [
    {
      files: [
        '**/__tests__/*.{j,t}s?(x)',
        '**/tests/unit/**/*.spec.{j,t}s?(x)'
      ],
      env: {
        mocha: true
      }
    }
  ]
}