feat[react]: Linting with eslint 9
This commit is contained in:
parent
14eab04d5b
commit
f69093b0dc
99 changed files with 1260 additions and 956 deletions
|
@ -37,6 +37,7 @@ export const useEditorState = (init = {}, setEphemeralState, config) => {
|
|||
if (typeof data.s === 'object') setState(data.s)
|
||||
else setState(init)
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
setState(init)
|
||||
}
|
||||
}
|
||||
|
@ -45,31 +46,6 @@ export const useEditorState = (init = {}, setEphemeralState, config) => {
|
|||
return [state, setState, update]
|
||||
}
|
||||
|
||||
/*
|
||||
* Our URL state library does not support storing Javascript objects out of the box.
|
||||
* But it allows us to pass a customer parser to handle them, so this is that parser
|
||||
*/
|
||||
const pojoParser = {
|
||||
parse: (v) => {
|
||||
let val
|
||||
try {
|
||||
val = JSON.parse(v)
|
||||
} catch (err) {
|
||||
val = null
|
||||
}
|
||||
return val
|
||||
},
|
||||
serialize: (v) => {
|
||||
let val
|
||||
try {
|
||||
val = JSON.stringify(v)
|
||||
} catch (err) {
|
||||
val = null
|
||||
}
|
||||
return val
|
||||
},
|
||||
}
|
||||
|
||||
function getHashData() {
|
||||
if (!window) return false
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue