Skip to content

Commit

Permalink
Run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
edoardocavazza committed Jan 22, 2024
1 parent 798ef4f commit d13b66d
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 19 deletions.
2 changes: 1 addition & 1 deletion docs/guide/custom-elements.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ In the example below, we define a custom element that uses a realm to render its

```ts
import { attachRealm } from '@chialab/quantum';
import { render, html } from 'uhtml';
import { html, render } from 'uhtml';

export class MyElement extends HTMLComponent {
readonly realm = attachRealm(this);
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ At this time, you can use a generic view library to render the internal template

```js
import { attachRealm } from '@chialab/quantum';
import { render, html } from 'uhtml';
import { html, render } from 'uhtml';

const root = document.createElement('div');
const realm = attachRealm(root);
Expand Down
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand All @@ -11,8 +11,8 @@
<div id="app"></div>
<script type="module">
import { render } from 'preact';
import { useRef, useEffect } from 'preact/hooks';
import { render as uRender, html } from 'uhtml';
import { useEffect, useRef } from 'preact/hooks';
import { html, render as uRender } from 'uhtml';
import { attachRealm } from './src/index.js';

const root = document.getElementById('app');
Expand Down
2 changes: 1 addition & 1 deletion src/Element.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getRealm, getParentRealm } from './Realm.js';
import { getParentRealm, getRealm } from './Realm.js';
import { defineProperty, getOwnPropertyDescriptors } from './utils.js';

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Node.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createNodeList } from './NodeList.js';
import { getRealm, getParentRealm } from './Realm.js';
import { getParentRealm, getRealm } from './Realm.js';
import { defineProperty, getOwnPropertyDescriptors } from './utils.js';

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/components/CustomElement.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { render, html } from 'uhtml';
import { html, render } from 'uhtml';
import { attachRealm } from '../../src/index.js';

export class CustomElement extends HTMLElement {
Expand Down
9 changes: 5 additions & 4 deletions tests/lit.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { html, render } from 'lit';
import { test, describe, expect } from 'vitest';
import { describe, expect, test } from 'vitest';
import './components/CustomElement.js';

describe('Lit', () => {
Expand Down Expand Up @@ -56,9 +56,10 @@ describe('Lit', () => {
});

test('should update named slots', () => {
const Template = (title) => html`<custom-element>
Text ${title ? html`<h1 slot="children">Title</h1>` : html`<h2 slot="children">Subtitle</h2>`}
</custom-element>`;
const Template = (title) =>
html`<custom-element>
Text ${title ? html`<h1 slot="children">Title</h1>` : html`<h2 slot="children">Subtitle</h2>`}
</custom-element>`;
const container = document.createElement('div');
render(Template(true), container);
const element = container.children[0];
Expand Down
2 changes: 1 addition & 1 deletion tests/preact.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { h, render } from 'preact';
import { test, describe, expect } from 'vitest';
import { describe, expect, test } from 'vitest';
import './components/CustomElement.js';

describe('Preact', () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/react.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import * as ReactDOM from 'react-dom/client';
import { test, describe, expect } from 'vitest';
import { describe, expect, test } from 'vitest';
import './components/CustomElement.js';

describe('React', () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/realm.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { test, describe, expect } from 'vitest';
import { describe, expect, test } from 'vitest';
import { attachRealm } from '../src/index.js';

describe('realm', () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/uhtml.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { html, render } from 'uhtml';
import { test, describe, expect } from 'vitest';
import { describe, expect, test } from 'vitest';
import './components/CustomElement.js';

describe('uhtml', () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/vue.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { test, describe, expect } from 'vitest';
import { describe, expect, test } from 'vitest';
import * as Vue from 'vue';
import './components/CustomElement.js';

Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
"noFallthroughCasesInSwitch": true,
},
"include": ["src"]
"include": ["src"],
}

0 comments on commit d13b66d

Please sign in to comment.