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

feat: no-attributes-during-construction #61

Merged
merged 8 commits into from
Mar 12, 2021

Conversation

ekashida
Copy link
Member

Fixes #26

README.md Outdated Show resolved Hide resolved
docs/rules/no-attributes-during-construction.md Outdated Show resolved Hide resolved
docs/rules/no-attributes-during-construction.md Outdated Show resolved Hide resolved
.map((node) => node.expression);

if (assignmentExpressions.length !== 0) {
const classProperties = classBody.body
Copy link
Member

Choose a reason for hiding this comment

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

I never realized before this that if a class field is defined with the same name than a global HTML property, the property doesn't reflect.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, the descriptors we copy from the HTMLElement prototype are added to the base lightning element so they can be overridden by the component class.

lib/rules/no-attributes-during-construction.js Outdated Show resolved Hide resolved
Copy link
Member

@pmdartus pmdartus left a comment

Choose a reason for hiding this comment

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

Added a couple of nitpicks. Otherwise, the code looks good.

lib/rules/no-attributes-during-construction.js Outdated Show resolved Hide resolved
Copy link
Contributor

@jodarove jodarove left a comment

Choose a reason for hiding this comment

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

more nitpicks, the code looks great!

docs/rules/no-attributes-during-construction.md Outdated Show resolved Hide resolved
lib/rules/no-attributes-during-construction.js Outdated Show resolved Hide resolved
lib/rules/no-attributes-during-construction.js Outdated Show resolved Hide resolved
@ekashida ekashida merged commit ca33119 into master Mar 12, 2021
@ekashida ekashida deleted the ekashida/no-initialized-global-attributes branch March 12, 2021 12:30
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.

Add rule to validate usages of global HTML attribute during construction
3 participants