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

Rule proposal: no-reserved-component-names #486

Closed
Mouvedia opened this issue May 31, 2018 · 4 comments
Closed

Rule proposal: no-reserved-component-names #486

Mouvedia opened this issue May 31, 2018 · 4 comments

Comments

@Mouvedia
Copy link

see https://stackoverflow.com/a/22545622/248058

Those names should produce an error:

  • annotation-xml
  • color-profile
  • font-face
  • font-face-src
  • font-face-uri
  • font-face-format
  • font-face-name
  • missing-glyph
@Mouvedia Mouvedia changed the title Rule proposal: custom element name warning Rule proposal: custom element name May 31, 2018
@chrisvfritz
Copy link
Contributor

This makes sense, but I think it should be focused on avoiding reserved names in component definitions, e.g. no-reserved-component-names and it would be in essentials.

@chrisvfritz
Copy link
Contributor

Some examples of code it should catch:

Vue.component('font-face', {})
const name = 'font-face'

Vue.component(name, {})
// filename: font-face.vue

export default {
  name: 'font-face'
}
// filename: font-face.vue

module.exports = {
  name: 'font-face'
}

@chrisvfritz chrisvfritz changed the title Rule proposal: custom element name Rule proposal: no-reserved-component-names Jul 31, 2018
@michalsnik
Copy link
Member

I think we should also warn about:

export default {
  components: {
    'font-face': ...,
  }
}

This returns same warning in Vue app, as former examples. @chrisvfritz @shadskii

@shadskii
Copy link
Contributor

shadskii commented Jan 9, 2019

I've added warnings for locally registered components in #757. Thank you for the suggestion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants