Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no-actions-hash false positive & failing #2215

Open
lifeart opened this issue Nov 19, 2024 · 0 comments
Open

no-actions-hash false positive & failing #2215

lifeart opened this issue Nov 19, 2024 · 0 comments

Comments

@lifeart
Copy link

lifeart commented Nov 19, 2024

Rule: https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/no-actions-hash.md
Failing on code like:

class MyComponent {
     declare actions: typeof dispatchToActions;
}
class MyComponent {
      actions!: typeof dispatchToActions;
}

Workaround:

class MyComponent {
      ['actions']!: typeof dispatchToActions;
}

Error: TypeError: Cannot read properties of null (reading 'type')

function isActionsProp(property) {
  return (
    types.isIdentifier(property.key) &&
    property.key.name === 'actions' &&
    types.isObjectExpression(property.value) // here property value is null
  );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant