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

Add a rule to require the @logger decorator #4

Merged
merged 1 commit into from
Jul 30, 2019

Conversation

sslotsky
Copy link
Contributor

No description provided.

code: componentMissingLogger,
errors: [{ messageId: "loggerMissing" }]
}
]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is so great—testing valid and invalid examples. 💯

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah! In fact you have to include both valid and invalid examples, otherwise the test will throw an error.

}`;

const componentMissingLogger = `
import { h, Component, Prop } from '@stencil/core';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this doesn’t get evaluated by JS, because @stencil/core isn’t a dependency? The ESLint parser supports decorators and stuff out-of-the-box?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, there's no evaluation here, only parsing the text into nodes. And yes, decorators are supported out of the box!

@sslotsky sslotsky merged commit 8db4107 into master Jul 30, 2019
@sslotsky sslotsky deleted the sslotsky/require-logger-decorator branch July 30, 2019 18:02
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

Successfully merging this pull request may close these issues.

None yet

2 participants