Skip to content

Commit

Permalink
[no-empty-glimmer-component-classes] Import the template tag value in…
Browse files Browse the repository at this point in the history
…stead of hardcode (#1898)
  • Loading branch information
chrisrng committed Jun 21, 2023
1 parent 9a2768f commit 0b8374c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/rules/no-empty-glimmer-component-classes.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

const { isGlimmerComponent } = require('../utils/ember');
const { isClassPropertyOrPropertyDefinition } = require('../utils/types');
const { TEMPLATE_TAG_PLACEHOLDER } = require('ember-template-imports/src/util');

const ERROR_MESSAGE = 'Do not create empty backing classes for Glimmer components.';
const ERROR_MESSAGE_TEMPLATE_TAG =
Expand Down Expand Up @@ -41,7 +42,7 @@ module.exports = {
} else if (
node.body.body.length === 1 &&
isClassPropertyOrPropertyDefinition(node.body.body[0]) &&
node.body.body[0].key?.callee?.name === '__GLIMMER_TEMPLATE' &&
node.body.body[0].key?.callee?.name === TEMPLATE_TAG_PLACEHOLDER &&
!subClassHasTypeDefinition
) {
context.report({ node, message: ERROR_MESSAGE_TEMPLATE_TAG });
Expand Down

0 comments on commit 0b8374c

Please sign in to comment.