style: format luna charts source
This commit is contained in:
+3
-4
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This is an autogenerated file created by the Stencil compiler.
|
* This is an autogenerated file created by the Stencil compiler.
|
||||||
* DO NOT MODIFY IT MANUALLY
|
* DO NOT MODIFY IT MANUALLY
|
||||||
@@ -29,7 +28,7 @@ interface ComponentCompilerTypeReference {
|
|||||||
* - globally
|
* - globally
|
||||||
* - by importing it into a file (and is defined elsewhere)
|
* - by importing it into a file (and is defined elsewhere)
|
||||||
*/
|
*/
|
||||||
location: "local" | "global" | "import";
|
location: 'local' | 'global' | 'import';
|
||||||
/**
|
/**
|
||||||
* The path to the type reference, if applicable (global types should not need a path associated with them)
|
* The path to the type reference, if applicable (global types should not need a path associated with them)
|
||||||
*/
|
*/
|
||||||
@@ -152,7 +151,7 @@ export interface JsonDocsComponent {
|
|||||||
/**
|
/**
|
||||||
* The encapsulation strategy for a component
|
* The encapsulation strategy for a component
|
||||||
*/
|
*/
|
||||||
encapsulation: "shadow" | "scoped" | "none";
|
encapsulation: 'shadow' | 'scoped' | 'none';
|
||||||
/**
|
/**
|
||||||
* The tag name for the component, for use in HTML
|
* The tag name for the component, for use in HTML
|
||||||
*/
|
*/
|
||||||
@@ -467,7 +466,7 @@ export interface StyleDoc {
|
|||||||
* Used to inform Stencil where the start of a new property's description starts (and where the previous description
|
* Used to inform Stencil where the start of a new property's description starts (and where the previous description
|
||||||
* ends).
|
* ends).
|
||||||
*/
|
*/
|
||||||
annotation: "prop";
|
annotation: 'prop';
|
||||||
/**
|
/**
|
||||||
* The Stencil style-mode that is associated with this property.
|
* The Stencil style-mode that is associated with this property.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -95,11 +95,7 @@ function App() {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div>
|
<div>
|
||||||
<my-component
|
<my-component first="Stencil" middle="'Don't call me a framework'" last="JS"></my-component>
|
||||||
first="Stencil"
|
|
||||||
middle="'Don't call me a framework'"
|
|
||||||
last="JS"
|
|
||||||
></my-component>
|
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
+17
-17
@@ -1,35 +1,33 @@
|
|||||||
|
|
||||||
/* tslint:disable */
|
/* tslint:disable */
|
||||||
/**
|
/**
|
||||||
* This is an autogenerated file created by the Stencil compiler.
|
* This is an autogenerated file created by the Stencil compiler.
|
||||||
* It contains typing information for all components that exist in this project.
|
* It contains typing information for all components that exist in this project.
|
||||||
*/
|
*/
|
||||||
import { HTMLStencilElement, JSXBase } from "@stencil/core/internal";
|
import { HTMLStencilElement, JSXBase } from '@stencil/core/internal';
|
||||||
export namespace Components {
|
export namespace Components {
|
||||||
interface MyComponent {
|
interface MyComponent {
|
||||||
/**
|
/**
|
||||||
* The first name
|
* The first name
|
||||||
*/
|
*/
|
||||||
"first"?: string;
|
first?: string;
|
||||||
/**
|
/**
|
||||||
* The last name
|
* The last name
|
||||||
*/
|
*/
|
||||||
"last"?: string;
|
last?: string;
|
||||||
/**
|
/**
|
||||||
* The middle name
|
* The middle name
|
||||||
*/
|
*/
|
||||||
"middle"?: string;
|
middle?: string;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare global {
|
declare global {
|
||||||
interface HTMLMyComponentElement extends Components.MyComponent, HTMLStencilElement {
|
interface HTMLMyComponentElement extends Components.MyComponent, HTMLStencilElement {}
|
||||||
}
|
|
||||||
var HTMLMyComponentElement: {
|
var HTMLMyComponentElement: {
|
||||||
prototype: HTMLMyComponentElement;
|
prototype: HTMLMyComponentElement;
|
||||||
new (): HTMLMyComponentElement;
|
new (): HTMLMyComponentElement;
|
||||||
};
|
};
|
||||||
interface HTMLElementTagNameMap {
|
interface HTMLElementTagNameMap {
|
||||||
"my-component": HTMLMyComponentElement;
|
'my-component': HTMLMyComponentElement;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare namespace LocalJSX {
|
declare namespace LocalJSX {
|
||||||
@@ -37,32 +35,34 @@ declare namespace LocalJSX {
|
|||||||
/**
|
/**
|
||||||
* The first name
|
* The first name
|
||||||
*/
|
*/
|
||||||
"first"?: string;
|
first?: string;
|
||||||
/**
|
/**
|
||||||
* The last name
|
* The last name
|
||||||
*/
|
*/
|
||||||
"last"?: string;
|
last?: string;
|
||||||
/**
|
/**
|
||||||
* The middle name
|
* The middle name
|
||||||
*/
|
*/
|
||||||
"middle"?: string;
|
middle?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface MyComponentAttributes {
|
interface MyComponentAttributes {
|
||||||
"first": string;
|
first: string;
|
||||||
"middle": string;
|
middle: string;
|
||||||
"last": string;
|
last: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface IntrinsicElements {
|
interface IntrinsicElements {
|
||||||
"my-component": Omit<MyComponent, keyof MyComponentAttributes> & { [K in keyof MyComponent & keyof MyComponentAttributes]?: MyComponent[K] } & { [K in keyof MyComponent & keyof MyComponentAttributes as `attr:${K}`]?: MyComponentAttributes[K] } & { [K in keyof MyComponent & keyof MyComponentAttributes as `prop:${K}`]?: MyComponent[K] };
|
'my-component': Omit<MyComponent, keyof MyComponentAttributes> & { [K in keyof MyComponent & keyof MyComponentAttributes]?: MyComponent[K] } & {
|
||||||
|
[K in keyof MyComponent & keyof MyComponentAttributes as `attr:${K}`]?: MyComponentAttributes[K];
|
||||||
|
} & { [K in keyof MyComponent & keyof MyComponentAttributes as `prop:${K}`]?: MyComponent[K] };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export { LocalJSX as JSX };
|
export { LocalJSX as JSX };
|
||||||
declare module "@stencil/core" {
|
declare module '@stencil/core' {
|
||||||
export namespace JSX {
|
export namespace JSX {
|
||||||
interface IntrinsicElements {
|
interface IntrinsicElements {
|
||||||
"my-component": LocalJSX.IntrinsicElements["my-component"] & JSXBase.HTMLAttributes<HTMLMyComponentElement>;
|
'my-component': LocalJSX.IntrinsicElements['my-component'] & JSXBase.HTMLAttributes<HTMLMyComponentElement>;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ export const Primary: Story = {
|
|||||||
last: 'Doe',
|
last: 'Doe',
|
||||||
middle: 'Michael',
|
middle: 'Michael',
|
||||||
},
|
},
|
||||||
render: (props) => <my-component {...props} />,
|
render: props => <my-component {...props} />,
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
# my-component
|
# my-component
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Auto Generated Below -->
|
<!-- Auto Generated Below -->
|
||||||
|
|
||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
| Property | Attribute | Description | Type | Default |
|
| Property | Attribute | Description | Type | Default |
|
||||||
@@ -13,7 +10,6 @@
|
|||||||
| `last` | `last` | The last name | `string \| undefined` | `undefined` |
|
| `last` | `last` | The last name | `string \| undefined` | `undefined` |
|
||||||
| `middle` | `middle` | The middle name | `string \| undefined` | `undefined` |
|
| `middle` | `middle` | The middle name | `string \| undefined` | `undefined` |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
----------------------------------------------
|
_Built with [StencilJS](https://stenciljs.com/)_
|
||||||
|
|
||||||
*Built with [StencilJS](https://stenciljs.com/)*
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<!DOCTYPE html>
|
<!doctype html>
|
||||||
<html dir="ltr" lang="en">
|
<html dir="ltr" lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
|
|||||||
@@ -9,12 +9,12 @@ export const axeCoreChecker: A11yChecker = {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
checkerName: 'axe-core',
|
checkerName: 'axe-core',
|
||||||
violations: results.violations.map((violations) => ({
|
violations: results.violations.map(violations => ({
|
||||||
id: violations.id,
|
id: violations.id,
|
||||||
impact: violations.impact ?? null,
|
impact: violations.impact ?? null,
|
||||||
description: violations.help,
|
description: violations.help,
|
||||||
helpUrl: violations.helpUrl,
|
helpUrl: violations.helpUrl,
|
||||||
nodes: violations.nodes.map((node) => node.target.join(' ')),
|
nodes: violations.nodes.map(node => node.target.join(' ')),
|
||||||
})),
|
})),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
import type { A11yChecker, A11yCheckResult } from './checkers/types';
|
import type { A11yChecker, A11yCheckResult } from './checkers/types';
|
||||||
import { axeCoreChecker } from './checkers/axe-core.checker';
|
import { axeCoreChecker } from './checkers/axe-core.checker';
|
||||||
|
|
||||||
const a11yCheckerRegistry: A11yChecker[] = [
|
const a11yCheckerRegistry: A11yChecker[] = [axeCoreChecker];
|
||||||
axeCoreChecker,
|
|
||||||
];
|
|
||||||
|
|
||||||
export async function runA11yChecks(rootElement: Element): Promise<A11yCheckResult[]> {
|
export async function runA11yChecks(rootElement: Element): Promise<A11yCheckResult[]> {
|
||||||
return Promise.all(a11yCheckerRegistry.map((a11yChecker) => a11yChecker.run(rootElement)));
|
return Promise.all(a11yCheckerRegistry.map(a11yChecker => a11yChecker.run(rootElement)));
|
||||||
}
|
}
|
||||||
|
|
||||||
export type { A11yChecker, A11yCheckResult, A11yViolation } from './checkers/types';
|
export type { A11yChecker, A11yCheckResult, A11yViolation } from './checkers/types';
|
||||||
@@ -3,7 +3,7 @@ import type { A11yCheckResult } from './checkers/types';
|
|||||||
|
|
||||||
expect.extend({
|
expect.extend({
|
||||||
toHaveNoA11yViolations(results: A11yCheckResult[]) {
|
toHaveNoA11yViolations(results: A11yCheckResult[]) {
|
||||||
const failing = results.filter((results) => results.violations.length > 0);
|
const failing = results.filter(results => results.violations.length > 0);
|
||||||
|
|
||||||
if (failing.length === 0) {
|
if (failing.length === 0) {
|
||||||
return {
|
return {
|
||||||
@@ -14,11 +14,9 @@ expect.extend({
|
|||||||
|
|
||||||
const message = failing
|
const message = failing
|
||||||
.map(
|
.map(
|
||||||
(results) =>
|
results =>
|
||||||
`[${results.checkerName}] ${results.violations.length} violation(s):\n` +
|
`[${results.checkerName}] ${results.violations.length} violation(s):\n` +
|
||||||
results.violations
|
results.violations.map(validation => ` - ${validation.id} (${validation.impact}): ${validation.description}\n affected: ${validation.nodes.join(', ')}`).join('\n'),
|
||||||
.map((validation) => ` - ${validation.id} (${validation.impact}): ${validation.description}\n affected: ${validation.nodes.join(', ')}`)
|
|
||||||
.join('\n')
|
|
||||||
)
|
)
|
||||||
.join('\n\n');
|
.join('\n\n');
|
||||||
|
|
||||||
|
|||||||
@@ -5,10 +5,7 @@
|
|||||||
"allowUnreachableCode": false,
|
"allowUnreachableCode": false,
|
||||||
"declaration": false,
|
"declaration": false,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"lib": [
|
"lib": ["dom", "es2022"],
|
||||||
"dom",
|
|
||||||
"es2022"
|
|
||||||
],
|
|
||||||
"moduleResolution": "bundler",
|
"moduleResolution": "bundler",
|
||||||
"module": "esnext",
|
"module": "esnext",
|
||||||
"target": "es2022",
|
"target": "es2022",
|
||||||
@@ -18,14 +15,8 @@
|
|||||||
"jsx": "react",
|
"jsx": "react",
|
||||||
"jsxFactory": "h",
|
"jsxFactory": "h",
|
||||||
"jsxFragmentFactory": "h.Fragment",
|
"jsxFragmentFactory": "h.Fragment",
|
||||||
"types": [
|
"types": ["@stencil/vitest/globals"]
|
||||||
"@stencil/vitest/globals"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"include": [
|
"include": ["src"],
|
||||||
"src"
|
"exclude": ["node_modules"]
|
||||||
],
|
|
||||||
"exclude": [
|
|
||||||
"node_modules"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { defineCustomElements } from "./loader";
|
import { defineCustomElements } from './loader';
|
||||||
import './src/testing/a11y/matchers';
|
import './src/testing/a11y/matchers';
|
||||||
|
|
||||||
defineCustomElements();
|
defineCustomElements();
|
||||||
Reference in New Issue
Block a user