43081j / 43081j/eslint-plugin-lit
lit/lifecycle-super not working with custom base classes
- Dominant language
- TypeScript
- Stars
- 138
- Forks
- 26
- Avg merge
- 23h 29m
- Merged PRs (30d)
- 4
Description
I added `flat/recommended` to my config:
```js
...
{
files: ["webapp/**/*.{js,ts}"],
languageOptions: { globals: { ...globals.browser } },
// Note this:
settings: { lit: { elementBaseClasses: ["MobxElement"] } },
...litConfigs["flat/recommended"],
rules: {
...litConfigs["flat/recommended"].rules,
"lit/attribute-value-entities": "error",
"lit/lifecycle-super": "error",
"lit/no-classfield-shadowing": "error",
"lit/no-invalid-escape-sequences": "error",
"lit/no-legacy-imports": "error",
"lit/no-native-attributes": "error",
"lit/no-private-properties": "error",
"lit/no-template-arrow": "off",
"lit/no-template-bind": "error",
"lit/no-template-map": "off",
"lit/no-this-assign-in-render": "off",
"lit/no-useless-template-literals": "error",
"lit/no-value-attribute": "warn",
"lit/prefer-nothing": "warn",
"lit/quoted-expressions": ["warn", "never"],
"lit/value-after-constraints": "error",
},
},
...
```
This works:
```ts
class MyEl extends LitElement {
override connectedCallback(): void {
// lint error, no super.connectedCallback() here. 🟢
}
}
```
This does not work:
```ts
class MyEl extends MobxElement {
override connectedCallback(): void {
// no lint error, despite no super.connectedCallback() here! 🔴
}
}
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.