question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rule proposal: `component-name-in-template-casing`

See original GitHub issue

Style guide: https://vuejs.org/v2/style-guide/#Component-name-casing-in-templates-strongly-recommended

Description: This rule would ensure proper component names in templates. As we only check .vue files in terms of templates we can provide both options: kebab-case and PascalCase

Good examples:

  • kebab-case
<the-component />
  • PascalCase
<TheComponent />

Bad examples:

<theComponent />
<Thecomponent />
<The-component />

and obviously with kebab-case option it would warn about PascalCase and vice-versa.

Default option would be PascalCase.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:6
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
probilcommented, Jun 8, 2018

@Mouvedia Agree with you. PascalCase is not the best option for everyone. But the same for kebab-case. I don’t think this eslint plugin is able to parse DOM templates at all. Because currently it relies on *.vue extension and // @vue/component comment so only SFC will be checked. But DOM templates are usually hidden somewhere in the back-end templates. Correct me please, if I’m wrong here.

In most projects, component names should always be PascalCase in single-file components

This plugin tries to follow official Vue Style Guide so PascalCase should be default. But of course. there should be configuration for this rule. So you can easily configure it to use kebab-case or both if you like

0reactions
Mouvediacommented, Jun 8, 2018

It depends on what matters the most to you:

  • one is official and recent (september 2017)
  • the other has precedence and hence is wide spread (january 2017)

Both are valid options and have CONs/PROs. One reason we should go with one or the other is if a convention exists on the React side: it would be detrimental to not follow their lead.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Proposed rule: Order Competition Rule - SEC.gov
proposed rule would prohibit a restricted competition trading center from internally executing certain orders of individual investors at a ...
Read more >
Self-Regulatory Organizations: Notice of Filing and Immediate ...
A. Self-Regulatory Organization's Statement of the Purpose of, and Statutory Basis for, the Proposed Rule Change. 1. Purpose. The Exchange ...
Read more >
SEC Proposes Equity Market Overhaul and Best Execution Rule
The SEC is proposing to amend Regulation NMS to (1) amend the tick sizes under Rule 612 to establish a variable minimum pricing...
Read more >
SEC Proposes Amendments to the Shareholder Proposal Rules
The SEC proposed modifying certain bases for excluding shareholder proposals from company proxy statements. If adopted, these amendments are ...
Read more >
SEC Proposes Amendments to Shareholder Proposal Rule
Rule 14a-8 under the Securities Exchange Act provides a means by which shareholders can submit proposals for inclusion in a company's proxy ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found