Skip to content

style: add missing return types to render methods #71

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

Merged
merged 1 commit into from
Oct 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/api-demo-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class ApiDemoBase extends ApiViewerMixin(LitElement) {
this._id = id++;
}

protected render() {
protected render(): TemplateResult {
return html`
${until(
renderDemo(this.jsonFetched, this.selected, this._id, this.excludeKnobs)
Expand Down
10 changes: 8 additions & 2 deletions src/api-demo-content.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { LitElement, html, customElement, property } from 'lit-element';
import {
LitElement,
html,
customElement,
property,
TemplateResult
} from 'lit-element';
import { ElementInfo } from './lib/types.js';
import { EMPTY_ELEMENT } from './lib/constants.js';
import './api-viewer-demo.js';
Expand All @@ -17,7 +23,7 @@ export class ApiDemoContent extends LitElement {
return this;
}

protected render() {
protected render(): TemplateResult {
const { elements, selected, exclude, vid } = this;

const { name, properties, slots, events, cssProperties } = {
Expand Down
2 changes: 1 addition & 1 deletion src/api-docs-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ async function renderDocs(
}

export class ApiDocsBase extends ApiViewerMixin(LitElement) {
protected render() {
protected render(): TemplateResult {
return html`${until(renderDocs(this.jsonFetched, this.selected))}`;
}
}
10 changes: 8 additions & 2 deletions src/api-docs-content.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { LitElement, html, customElement, property } from 'lit-element';
import {
LitElement,
html,
customElement,
property,
TemplateResult
} from 'lit-element';
import { ElementInfo } from './lib/types.js';
import { EMPTY_ELEMENT } from './lib/constants.js';
import { parse } from './lib/markdown.js';
Expand All @@ -14,7 +20,7 @@ export class ApiDocsContent extends LitElement {
return this;
}

protected render() {
protected render(): TemplateResult {
const { elements, selected } = this;

const {
Expand Down
2 changes: 1 addition & 1 deletion src/api-viewer-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class ApiViewerBase extends ApiViewerMixin(LitElement) {
this._id = id++;
}

protected render() {
protected render(): TemplateResult {
return html`
${until(
renderDocs(
Expand Down
12 changes: 9 additions & 3 deletions src/api-viewer-content.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { LitElement, html, customElement, property } from 'lit-element';
import {
LitElement,
html,
customElement,
property,
TemplateResult
} from 'lit-element';
import { cache } from 'lit-html/directives/cache.js';
import { ElementInfo } from './lib/types.js';
import { EMPTY_ELEMENT } from './lib/constants.js';
Expand All @@ -18,11 +24,11 @@ export class ApiViewerContent extends LitElement {

@property({ type: Number }) vid?: number;

protected createRenderRoot() {
protected createRenderRoot(): this {
return this;
}

protected render() {
protected render(): TemplateResult {
const { elements, selected, section, exclude, vid } = this;

const {
Expand Down
2 changes: 1 addition & 1 deletion src/api-viewer-demo-events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class ApiViewerDemoEvents extends LitElement {
return this;
}

protected render() {
protected render(): TemplateResult {
const { log } = this;
return html`
<button
Expand Down
10 changes: 8 additions & 2 deletions src/api-viewer-demo-layout.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { LitElement, html, customElement, property } from 'lit-element';
import {
LitElement,
html,
customElement,
property,
TemplateResult
} from 'lit-element';
import { renderer } from './lib/renderer.js';
import {
cssPropRenderer,
Expand All @@ -22,7 +28,7 @@ export class ApiViewerDemoLayout extends ApiDemoLayoutMixin(LitElement) {
return this;
}

protected render() {
protected render(): TemplateResult {
const [noCss, noEvents, noSlots, noCustomKnobs, noProps] = [
this.cssProps,
this.events,
Expand Down
2 changes: 1 addition & 1 deletion src/api-viewer-demo-snippet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export class ApiViewerDemoSnippet extends LitElement {
];
}

protected render() {
protected render(): TemplateResult {
return html`
${renderSnippet(
this.vid as number,
Expand Down
2 changes: 1 addition & 1 deletion src/api-viewer-demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class ApiViewerDemo extends LitElement {
return this;
}

protected render() {
protected render(): TemplateResult {
const { name } = this;

if (name && this.lastName !== name) {
Expand Down
2 changes: 1 addition & 1 deletion src/api-viewer-docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export class ApiViewerDocs extends LitElement {
return this;
}

protected render() {
protected render(): TemplateResult {
const { slots, props, attrs, events, cssParts, cssProps } = this;

const properties = props || [];
Expand Down
10 changes: 8 additions & 2 deletions src/api-viewer-panel.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { LitElement, html, customElement, css } from 'lit-element';
import {
LitElement,
html,
customElement,
css,
TemplateResult
} from 'lit-element';

let panelIdCounter = 0;

Expand All @@ -19,7 +25,7 @@ export class ApiViewerPanel extends LitElement {
`;
}

protected render() {
protected render(): TemplateResult {
return html`<slot></slot>`;
}

Expand Down
5 changes: 3 additions & 2 deletions src/api-viewer-tab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import {
customElement,
css,
property,
PropertyValues
PropertyValues,
TemplateResult
} from 'lit-element';

let tabIdCounter = 0;
Expand Down Expand Up @@ -107,7 +108,7 @@ export class ApiViewerTab extends LitElement {
`;
}

protected render() {
protected render(): TemplateResult {
return html`${this.heading}`;
}

Expand Down
5 changes: 3 additions & 2 deletions src/fixtures/fancy-accordion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import {
css,
customElement,
property,
PropertyValues
PropertyValues,
TemplateResult
} from 'lit-element';
import { ExpansionPanel } from './expansion-panel.js';

Expand Down Expand Up @@ -75,7 +76,7 @@ export class FancyAccordion extends LitElement {
`;
}

protected render() {
protected render(): TemplateResult {
return html`<slot></slot>`;
}

Expand Down
11 changes: 9 additions & 2 deletions src/fixtures/intl-currency.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
import { LitElement, html, css, customElement, property } from 'lit-element';
import {
LitElement,
html,
css,
customElement,
property,
TemplateResult
} from 'lit-element';

const format = (
value: number,
Expand Down Expand Up @@ -49,7 +56,7 @@ export class IntlCurrency extends LitElement {
`;
}

protected render() {
protected render(): TemplateResult {
return html`
<div part="value">${format(this.value, this.currency, this.locale)}</div>
`;
Expand Down
5 changes: 3 additions & 2 deletions src/fixtures/progress-bar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import {
css,
customElement,
property,
PropertyValues
PropertyValues,
TemplateResult
} from 'lit-element';

const normalizeValue = (value: number, min: number, max: number) => {
Expand Down Expand Up @@ -152,7 +153,7 @@ export class ProgressBar extends LitElement {
`;
}

protected render() {
protected render(): TemplateResult {
return html`<div part="bar"><div part="value"></div></div>`;
}

Expand Down