Skip to content

Latest commit

 

History

History
57 lines (41 loc) · 1.18 KB

File metadata and controls

57 lines (41 loc) · 1.18 KB

ember/template-require-valid-named-block-naming-format

💼 This rule is enabled in the following configs: ✅ recommended, strict-gjs, strict-gts.

Require valid named block naming format.

Named blocks in yield and has-block helpers should follow a consistent naming format.

Examples

This rule forbids the following (with default camelCase):

<template>
  {{yield to='foo-bar'}}
</template>
<template>
  {{has-block 'foo-bar'}}
</template>

This rule allows the following (with default camelCase):

<template>
  {{yield to='fooBar'}}
</template>
<template>
  {{has-block 'fooBar'}}
</template>

Configuration

  • camelCase (default) - Named blocks should use camelCase format
  • kebab-case - Named blocks should use kebab-case format
// .eslintrc.js
module.exports = {
  rules: {
    'ember/template-require-valid-named-block-naming-format': ['error', 'camelCase'],
  },
};

References