diff --git a/.eleventy.cjs b/.eleventy.cjs index 2cce760..24c05df 100644 --- a/.eleventy.cjs +++ b/.eleventy.cjs @@ -1,15 +1,15 @@ -const syntaxHighlight = require("@11ty/eleventy-plugin-syntaxhighlight"); +const syntaxHighlight = require('@11ty/eleventy-plugin-syntaxhighlight'); -module.exports = function(eleventyConfig) { +module.exports = function (eleventyConfig) { eleventyConfig.addPlugin(syntaxHighlight); return { dir: { - input: "docs-src", - output: "docs" + input: 'docs-src', + output: 'docs', }, templateExtensionAliases: { - "11ty.cjs": "11ty.js", - "11tydata.cjs": "11tydata.js" - } + '11ty.cjs': '11ty.js', + '11tydata.cjs': '11tydata.js', + }, }; }; diff --git a/.eslintrc.json b/.eslintrc.json index 7dbc806..7a9c364 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -9,17 +9,18 @@ "ecmaVersion": 2020, "sourceType": "module" }, - "plugins": [ - "@typescript-eslint" - ], + "plugins": ["@typescript-eslint"], "rules": { "no-unexpected-multiline": "off", "@typescript-eslint/indent": "off", "@typescript-eslint/explicit-function-return-type": "off", "@typescript-eslint/no-non-null-assertion": "off", "@typescript-eslint/no-use-before-define": "off", - "@typescript-eslint/no-unused-vars": ["warn", { - "argsIgnorePattern": "^_" - }] + "@typescript-eslint/no-unused-vars": [ + "warn", + { + "argsIgnorePattern": "^_" + } + ] } } diff --git a/karma.conf.cjs b/karma.conf.cjs index d74f201..adfc4bd 100644 --- a/karma.conf.cjs +++ b/karma.conf.cjs @@ -1,24 +1,24 @@ -const { createDefaultConfig } = require('@open-wc/testing-karma'); +const {createDefaultConfig} = require('@open-wc/testing-karma'); const merge = require('deepmerge'); -module.exports = config => { +module.exports = (config) => { config.set( merge(createDefaultConfig(config), { frameworks: ['mocha', 'chai'], client: { - mocha: {ui: 'tdd'} + mocha: {ui: 'tdd'}, }, files: [ { pattern: config.grep ? config.grep : 'test/**/*_test.js', - type: 'module' + type: 'module', }, ], // See the karma-esm docs for all options esm: { nodeResolve: true, }, - }), + }) ); return config; }; diff --git a/rollup.config.js b/rollup.config.js index 8428898..ef00cc6 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -42,6 +42,6 @@ export default { }), filesize({ showBrotliSize: true, - }) - ] -} + }), + ], +}; diff --git a/src/test/my-element_test.ts b/src/test/my-element_test.ts index 4874843..98ead0d 100644 --- a/src/test/my-element_test.ts +++ b/src/test/my-element_test.ts @@ -4,7 +4,6 @@ import {fixture, html} from '@open-wc/testing'; const assert = chai.assert; suite('my-element', () => { - test('is defined', () => { const el = document.createElement('my-element'); assert.instanceOf(el, MyElement); @@ -12,32 +11,40 @@ suite('my-element', () => { test('renders with default values', async () => { const el = await fixture(html``); - assert.shadowDom.equal(el, ` + assert.shadowDom.equal( + el, + `

Hello, World!

- `); + ` + ); }); test('renders with a set name', async () => { const el = await fixture(html``); - assert.shadowDom.equal(el, ` + assert.shadowDom.equal( + el, + `

Hello, Test!

- `); + ` + ); }); test('handles a click', async () => { - const el = await fixture(html``) as MyElement; + const el = (await fixture(html``)) as MyElement; const button = el.shadowRoot!.querySelector('button')!; button.click(); await el.updateComplete; - assert.shadowDom.equal(el, ` + assert.shadowDom.equal( + el, + `

Hello, World!

- `); + ` + ); }); - }); diff --git a/tsconfig.json b/tsconfig.json index c74ea6d..6c2d84e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -20,7 +20,7 @@ "plugins": [ { "name": "ts-lit-plugin", - "strict": true, + "strict": true } ] },