Skip to content

Commit

Permalink
eslint config up-to-date
Browse files Browse the repository at this point in the history
  • Loading branch information
danny007in committed Oct 3, 2021
1 parent 63d0c2b commit 0c06dd6
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
14 changes: 11 additions & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@
"properties": false
}
],
// "no-eq-null": "off",
// "no-negated-condition": "off",
"no-console": "error",
"object-curly-spacing": [
"error",
Expand All @@ -47,7 +45,6 @@
"error",
"after"
],
// "prefer-object-spread": "off",
"semi": [
"error",
"never"
Expand Down Expand Up @@ -88,6 +85,17 @@
"SwitchCase": 1
}
],
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "variable",
"format": ["camelCase", "StrictPascalCase", "UPPER_CASE"]
}
],
"@typescript-eslint/object-curly-spacing": [
"error",
"always"
],
"@typescript-eslint/semi": [
"error",
"never"
Expand Down
2 changes: 1 addition & 1 deletion src/ts/card-widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class CardWidget {
this._parent = element
}

this._config = {...Default, ...config}
this._config = { ...Default, ...config }
}

collapse() {
Expand Down
8 changes: 4 additions & 4 deletions src/ts/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
* ------------------------------------------------------------------------
*/

const CLASS_NAME_HOLD_TRANSITIONs = 'hold-transition'
const CLASS_NAME_HOLD_TRANSITIONS = 'hold-transition'

const SELECTOR_SIDEBAR = '.sidebar'

Expand All @@ -40,16 +40,16 @@ class Layout {

constructor(element: HTMLElement, config: Config) {
this._element = element
this._config = {...Default, ...config}
this._config = { ...Default, ...config }
}

holdTransition(): void {
let resizeTimer: number | undefined
window.addEventListener('resize', () => {
document.body.classList.add(CLASS_NAME_HOLD_TRANSITIONs)
document.body.classList.add(CLASS_NAME_HOLD_TRANSITIONS)
clearTimeout(resizeTimer)
resizeTimer = setTimeout(() => {
document.body.classList.remove(CLASS_NAME_HOLD_TRANSITIONs)
document.body.classList.remove(CLASS_NAME_HOLD_TRANSITIONS)
}, 400)
})
}
Expand Down
2 changes: 1 addition & 1 deletion src/ts/treeview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class Treeview {
this._navItem = this._element?.closest(SELECTOR_NAV_ITEM)
this._childNavItem = this._navItem?.querySelector(SELECTOR_TREEVIEW_MENU)

this._config = {...Default, ...config}
this._config = { ...Default, ...config }
}

open(): void {
Expand Down
2 changes: 1 addition & 1 deletion src/ts/util/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const slideUp = (target: HTMLElement, duration = 500) => {
/* SLIDE DOWN */
const slideDown = (target: HTMLElement, duration = 500) => {
target.style.removeProperty('display')
let {display} = window.getComputedStyle(target)
let { display } = window.getComputedStyle(target)

if (display === 'none') {
display = 'block'
Expand Down

0 comments on commit 0c06dd6

Please sign in to comment.