Skip to content

Commit

Permalink
fix: suppress [svelte] reactive_declaration_non_reactive_property w…
Browse files Browse the repository at this point in the history
…arnings during development
  • Loading branch information
josdejong committed Dec 11, 2024
1 parent 1a478b6 commit 5e05768
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/lib/components/controls/SearchBox.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
$: onSearch(searchResult)
// eslint-disable-next-line svelte/no-unused-svelte-ignore
// svelte-ignore reactive_declaration_non_reactive_property
$: applyChangedShowSearch(showSearch)
const applyChangedSearchTextDebounced = debounce(applyChangedSearchText, DEBOUNCE_DELAY)
Expand Down
2 changes: 2 additions & 0 deletions src/lib/components/modes/JSONEditorRoot.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@
mode = externalMode
}
// eslint-disable-next-line svelte/no-unused-svelte-ignore
// svelte-ignore reactive_declaration_non_reactive_property
$: applyExternalMode(externalMode)
function handleUndo(item: HistoryItem | undefined) {
Expand Down
2 changes: 2 additions & 0 deletions src/lib/components/modes/textmode/TextMode.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,8 @@
escapeUnicodeCharacters
})
// eslint-disable-next-line svelte/no-unused-svelte-ignore
// svelte-ignore reactive_declaration_non_reactive_property
$: setCodeMirrorContent(externalContent, false, false)
$: applyExternalSelection(externalSelection)
$: updateLinter(validator)
Expand Down
2 changes: 2 additions & 0 deletions src/lib/components/modes/textmode/menu/TextMenu.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@
}
]
// eslint-disable-next-line svelte/no-unused-svelte-ignore
// svelte-ignore reactive_declaration_non_reactive_property
$: items = onRenderMenu(defaultItems) || defaultItems
</script>

Expand Down
2 changes: 2 additions & 0 deletions src/lib/components/modes/treemode/JSONNode.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@
$: validationError = validationErrors?.validationError
let isNodeSelected: boolean
// eslint-disable-next-line svelte/no-unused-svelte-ignore
// svelte-ignore reactive_declaration_non_reactive_property
$: isNodeSelected = pathInSelection(context.getJson(), selection, path)
$: root = path.length === 0
Expand Down
15 changes: 10 additions & 5 deletions src/lib/components/modes/treemode/TreeMode.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,8 @@
}
}
// eslint-disable-next-line svelte/no-unused-svelte-ignore
// svelte-ignore reactive_declaration_non_reactive_property
$: emitOnSelect(selection)
let normalization: ValueNormalization
Expand All @@ -281,6 +283,8 @@
let showSearch = false
let showReplace = false
// eslint-disable-next-line svelte/no-unused-svelte-ignore
// svelte-ignore reactive_declaration_non_reactive_property
$: applySearchBoxSpacing(showSearch)
function applySearchBoxSpacing(showSearch: boolean) {
Expand Down Expand Up @@ -344,15 +348,21 @@
// two-way binding of externalContent and internal json and text (
// when receiving an updated prop, we have to update state for example
// eslint-disable-next-line svelte/no-unused-svelte-ignore
// svelte-ignore reactive_declaration_non_reactive_property
$: applyExternalContent(externalContent)
// eslint-disable-next-line svelte/no-unused-svelte-ignore
// svelte-ignore reactive_declaration_non_reactive_property
$: applyExternalSelection(externalSelection)
let textIsRepaired = false
let validationErrorList: ValidationError[] = []
let validationErrors: ValidationErrors | undefined
// eslint-disable-next-line svelte/no-unused-svelte-ignore
// svelte-ignore reactive_declaration_non_reactive_property
$: updateValidationErrors(json, validator, parser, validationParser)
// because onChange returns the validation errors and there is also a separate listener,
Expand Down Expand Up @@ -654,11 +664,6 @@
}
}
// TODO: cleanup logging
// $: debug('json', json)
// $: debug('state', state)
// $: debug('selection', selection)
function handleEditKey() {
if (readOnly || !selection) {
return
Expand Down
2 changes: 2 additions & 0 deletions src/lib/components/modes/treemode/menu/TreeMenu.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@
}
]
// eslint-disable-next-line svelte/no-unused-svelte-ignore
// svelte-ignore reactive_declaration_non_reactive_property
$: items = onRenderMenu(defaultItems) || defaultItems
</script>

Expand Down

0 comments on commit 5e05768

Please sign in to comment.