Skip to content

chore(design): add docs-private-hostbinding-lifecycle linting rule#3639

Merged
damienwebdev merged 3 commits into
graycoreio:developfrom
leozhang14:hostbinding-lifecycle-linting-rule
May 8, 2025
Merged

chore(design): add docs-private-hostbinding-lifecycle linting rule#3639
damienwebdev merged 3 commits into
graycoreio:developfrom
leozhang14:hostbinding-lifecycle-linting-rule

Conversation

@leozhang14
Copy link
Copy Markdown
Contributor

@leozhang14 leozhang14 commented Apr 24, 2025

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

No existing linting rule for @docs-private tag for HostBinding and Lifecycle methods.

Fixes: #3487

What is the new behavior?

Added linting rule, and added @docs-private tag to hostbinding and lifecycle methods.

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Notes:

  • The non-typescript files are the files that involve changes that aren't purely linting
  • The changes to the typescript files are only to add the @docs-private tag to satisfy lerna run lint
  • To apply the linting changes, I ran eslint --fix for the necessary packages, since I couldn't find documentation to do it through lerna (not sure if this is the right approach)
  • The rule current applies to the entire repository
  • To apply the rule only to design, remove custom-rules from tools/config and directly import it as a plugin to libs/design/.eslintrc.js
  • CodeClimate errors for function length and code complexity
  • It may be worth it to later abstract away some of the custom eslint rule functions in tools/eslint/custom-rules/docs-private-hostbinding-lifecycle.js (e.g. hasDocsPrivate could be abstracted to hasTag if we need to frequently check for specific JSDoc annotations/block tags)
  • However, since we only have 1 custom rule currently, I decided to keep them all in the same file for now

@leozhang14 leozhang14 self-assigned this Apr 24, 2025
@leozhang14 leozhang14 requested review from a team as code owners April 24, 2025 00:11
Comment thread libs/design/button/src/button/basic/button.component.ts Outdated
@leozhang14 leozhang14 force-pushed the hostbinding-lifecycle-linting-rule branch from 0afee00 to 9dbb0e1 Compare April 24, 2025 16:48
@xelaint
Copy link
Copy Markdown
Member

xelaint commented Apr 29, 2025

@damienwebdev does this need to apply to all packages, or just @daffodil/design?

@damienwebdev
Copy link
Copy Markdown
Member

Just design for now.

@xelaint xelaint force-pushed the hostbinding-lifecycle-linting-rule branch from 9dbb0e1 to 89216e2 Compare April 29, 2025 18:26
@xelaint xelaint changed the title feat/lint(docs-private tag for hostbinding/lifecycle): implement cust… chore(design): add docs-private-hostbinding-lifecycle linting rule Apr 29, 2025
@leozhang14 leozhang14 force-pushed the hostbinding-lifecycle-linting-rule branch from 89216e2 to 9dbb0e1 Compare April 29, 2025 19:23
@xelaint xelaint force-pushed the hostbinding-lifecycle-linting-rule branch 4 times, most recently from 324cb4d to 91e4aca Compare April 30, 2025 17:58
@xelaint
Copy link
Copy Markdown
Member

xelaint commented Apr 30, 2025

@damienwebdev should be good to go, only thing is codeclimate failing.

@xelaint xelaint force-pushed the hostbinding-lifecycle-linting-rule branch from 91e4aca to fb60255 Compare May 7, 2025 18:38
@damienwebdev
Copy link
Copy Markdown
Member

@xelaint needs a rebase.

@xelaint xelaint force-pushed the hostbinding-lifecycle-linting-rule branch from c2369e1 to eb0f909 Compare May 7, 2025 20:12
@xelaint
Copy link
Copy Markdown
Member

xelaint commented May 7, 2025

@xelaint needs a rebase.

@damienwebdev done

@damienwebdev damienwebdev requested a review from xelaint May 8, 2025 00:46
Copy link
Copy Markdown
Member

@damienwebdev damienwebdev left a comment

Choose a reason for hiding this comment

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

lgtm

@damienwebdev damienwebdev merged commit 7e0d1e3 into graycoreio:develop May 8, 2025
14 checks passed
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.

[FEAT] Add linting rule to design to mark all HostBinding and lifecycle methods as @docs-private

3 participants