Lint for consistent component tag names in component definitions
This CL lints that for a given component that all the references to
its tag name are the same.
```
class Foo extends HTMLElement {
// Check that this name
static litTagName = LitHtml.literal\`devtools-foo\`
}
// And this name
ComponentHelpers.CustomElements.defineComponent('devtools-foo', Foo);
declare global {
interface HTMLElementTagNameMap {
// And this one are the same
'devtools-foo': Foo
}
}
```
Bug: 1153077
Change-Id: I29694449cb37950d1a5ff5391779e16e462926e2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2897279
Reviewed-by: Paul Lewis <[email protected]>
Commit-Queue: Jack Franklin <[email protected]>
diff --git a/front_end/.eslintrc.js b/front_end/.eslintrc.js
index 1340755..4601fb3 100644
--- a/front_end/.eslintrc.js
+++ b/front_end/.eslintrc.js
@@ -29,6 +29,7 @@
'rulesdir/lit_html_data_as_type': 2,
'rulesdir/lit_no_style_interpolation': 2,
'rulesdir/ban_literal_devtools_component_tag_names': 2,
+ 'rulesdir/check_component_naming': 2,
'@typescript-eslint/naming-convention': [
'error', {
'selector': ['property', 'parameterProperty'],