chore: fix lint issues
This commit is contained in:
parent
593944b619
commit
64d0451d72
8 changed files with 38 additions and 7 deletions
|
|
@ -14,9 +14,8 @@ By taking out bigger concerns that [a metaframework](https://github.com/ayoayco/
|
|||
It works on current-day browsers without needing compilers, transpilers, or polyfills.
|
||||
|
||||
<Aside type="tip">
|
||||
Have questions or suggestions? There are many ways to get in touch:
|
||||
|
||||
1. Open a [GitHub issue](https://github.com/ayoayco/wcb/issues/new) or [discussion](https://github.com/ayoayco/wcb/discussions)
|
||||
1. Submit a ticket via [SourceHut todo](https://todo.sr.ht/~ayoayco/wcb)
|
||||
1. Email me: [ayo@ayco.io](mailto:ayo@ayco.io)
|
||||
</Aside>
|
||||
Have questions or suggestions? There are many ways to get in touch:
|
||||
1. Open a [GitHub issue](https://github.com/ayoayco/wcb/issues/new) or [discussion](https://github.com/ayoayco/wcb/discussions)
|
||||
1. Submit a ticket via [SourceHut todo](https://todo.sr.ht/~ayoayco/wcb)
|
||||
1. Email me: [ayo@ayco.io](mailto:ayo@ayco.io)
|
||||
</Aside>
|
||||
|
|
|
|||
|
|
@ -13,6 +13,6 @@ export default [
|
|||
},
|
||||
},
|
||||
{
|
||||
ignores: ['site/*', 'dist/*'],
|
||||
ignores: ['site/*', '**/dist/*'],
|
||||
},
|
||||
]
|
||||
|
|
|
|||
|
|
@ -69,6 +69,12 @@ const htm =
|
|||
return f(), o.length > 2 ? o.slice(1) : o[1]
|
||||
})
|
||||
|
||||
/**
|
||||
*
|
||||
* @param type
|
||||
* @param props
|
||||
* @param {...any} children
|
||||
*/
|
||||
function h(type, props, ...children) {
|
||||
return { type, props, children }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,8 @@
|
|||
import { serialize } from './serialize.mjs'
|
||||
/**
|
||||
*
|
||||
* @param tree
|
||||
*/
|
||||
export function createElement(tree) {
|
||||
if (!tree.type) {
|
||||
if (Array.isArray(tree)) {
|
||||
|
|
@ -39,6 +43,11 @@ export function createElement(tree) {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param el
|
||||
* @param styleObj
|
||||
*/
|
||||
function applyStyles(el, styleObj) {
|
||||
Object.entries(styleObj).forEach(([rule, value]) => {
|
||||
if (rule in el.style && value) el.style[rule] = value
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
/**
|
||||
*
|
||||
* @param value
|
||||
* @param type
|
||||
*/
|
||||
export function deserialize(value, type) {
|
||||
switch (type) {
|
||||
case 'number':
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
/**
|
||||
*
|
||||
* @param kebab
|
||||
*/
|
||||
export function getCamelCase(kebab) {
|
||||
return kebab.replace(/-./g, (x) => x[1].toUpperCase())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
/**
|
||||
*
|
||||
* @param str
|
||||
*/
|
||||
export function getKebabCase(str) {
|
||||
return str.replace(
|
||||
/[A-Z]+(?![a-z])|[A-Z]/g,
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
/**
|
||||
*
|
||||
* @param value
|
||||
*/
|
||||
export function serialize(value) {
|
||||
switch (typeof value) {
|
||||
case 'number':
|
||||
|
|
|
|||
Loading…
Reference in a new issue