chore: fixed linter warnings
This commit is contained in:
parent
89a489bb9f
commit
4da86eb643
6 changed files with 8 additions and 12 deletions
|
@ -1,11 +1,9 @@
|
|||
import { useState } from 'react'
|
||||
import set from 'lodash.set'
|
||||
// Stores state in local storage
|
||||
import useLocalStorage from 'shared/hooks/useLocalStorage.js'
|
||||
// Patterns
|
||||
import patterns from 'site/patterns.json'
|
||||
// Locale and translation
|
||||
import { useRouter } from 'next/router'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
import { capitalize } from 'shared/utils'
|
||||
|
||||
|
@ -54,8 +52,6 @@ const initialNavigation = (t) => {
|
|||
function useApp(full = true) {
|
||||
|
||||
// Locale (aka language)
|
||||
const router = useRouter()
|
||||
const { locale } = router
|
||||
const { t } = useTranslation(['app'])
|
||||
|
||||
// User color scheme preference
|
||||
|
|
|
@ -7,7 +7,7 @@ const XrayPart = props => {
|
|||
// Don't bother if this is the only part on display
|
||||
if (props.gist.only && props.gist.only.length === 1) return null
|
||||
const i = props.gist.xray?.reveal
|
||||
? Object.keys(props.gist.xray?.reveal).indexOf(props.partName)%10
|
||||
? Object.keys(props.gist.xray.reveal).indexOf(props.partName)%10
|
||||
: 0
|
||||
const { topLeft, bottomRight } = props.part
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { linkClasses, Chevron } from 'shared/components/navigation/primary.js'
|
||||
import { Chevron } from 'shared/components/navigation/primary.js'
|
||||
import Option from './option'
|
||||
import { Li, Ul, Details, Summary, SumButton, SumDiv, Deg } from 'shared/components/workbench/menu'
|
||||
import { Li, Ul, Details, Summary, SumDiv, Deg } from 'shared/components/workbench/menu'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
||||
const OptionSubGroup = props => {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { linkClasses } from 'shared/components/navigation/primary.js'
|
||||
import { Li, Ul, Details, Summary, Deg } from 'shared/components/workbench/menu'
|
||||
import { Li } from 'shared/components/workbench/menu'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
||||
const SumButton = props => (
|
||||
|
|
|
@ -82,7 +82,7 @@ const WorkbenchWrapper = ({ app, pattern }) => {
|
|||
let draft = false
|
||||
if (['draft', 'events', 'test'].indexOf(gist?._state?.view) !== -1) {
|
||||
draft = new pattern(gist)
|
||||
if (gist?.renderer === 'svg') draft.use(theme)
|
||||
if (gist.renderer === 'svg') draft.use(theme)
|
||||
try {
|
||||
if (gist._state.view !== 'test') draft.draft()
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import yaml from 'js-yaml'
|
||||
import path from 'path'
|
||||
import rdir from 'recursive-readdir'
|
||||
import { readdir, readFile, writeFile } from 'fs/promises'
|
||||
import { readFile, writeFile } from 'fs/promises'
|
||||
import { fileURLToPath } from 'url'
|
||||
import { dirname } from 'path'
|
||||
|
||||
|
@ -131,7 +131,7 @@ const ${name} = ${JSON.stringify(data, null ,2)}
|
|||
|
||||
export default ${name}
|
||||
`
|
||||
const localeFile = (locale, namespaces) => `${header}
|
||||
const localeFile = (namespaces) => `${header}
|
||||
${namespaces
|
||||
.map(ns => 'import '+ns+' from "./'+ns+'.mjs"')
|
||||
.join("\n")
|
||||
|
@ -180,7 +180,7 @@ const writeFiles = async allNamespaces => {
|
|||
promises.push(
|
||||
writeFile(
|
||||
path.resolve(__dirname, 'next', locale, 'index.mjs', ),
|
||||
localeFile(locale, Object.keys(namespaces))
|
||||
localeFile(Object.keys(namespaces))
|
||||
)
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue