Skip to content

Latest commit

 

History

History
44 lines (35 loc) · 1.17 KB

overrides.md

File metadata and controls

44 lines (35 loc) · 1.17 KB

Overrides support

You can tell the linter to override certain aspects for individual files or entire directories with the overrides option.

The overrides option would enable the user to do the following:

  • Allows the user to pass an array exact modules/glob patterns
  • Enable overriding of rules for a specific set of files

This option takes an array of objects where each object would support 2 keys:

  • files: Array of glob patterns (that would either match the exact modules or glob-match multiple modules)

  • rules: An object of lint rules that the user wants to override for the specific files

  • module -- 'app/templates/exceptional-page'

  • glob -- 'app/templates/components/odd-ones/**'

Sample configuration

'use strict';

module.exports = {
  extends: 'recommended',
  rules: {
    'no-implicit-this': true,
  }
  overrides: [
    {
      files: ['**/item-description/**/templates/components/**/*.hbs'],
      rules: {
        'no-implicit-this': false,
        'no-bare-strings': true,
      },
    },
    {
      files: ['**/item-main/**/templates/components/**/*.hbs'],
      rules: {
        'no-input-block': true,
      },
    },
  ],
};