Fixed lint errors

This commit is contained in:
Isaiah 2023-11-27 16:59:56 -05:00
parent 84934504c7
commit 4f69621a9d
4 changed files with 37 additions and 37 deletions

View file

@ -140,7 +140,7 @@ export const toolsByCategory: ToolCategory[] = [
chmodCalculator, chmodCalculator,
dockerRunToDockerComposeConverter, dockerRunToDockerComposeConverter,
xmlFormatter, xmlFormatter,
yamlViewer yamlViewer,
], ],
}, },
{ {

View file

@ -1,6 +1,6 @@
import { type MaybeRef, get } from '@vueuse/core'; import { type MaybeRef, get } from '@vueuse/core';
import yaml from "js-yaml"; import yaml from 'js-yaml';
export { formatYaml }; export { formatYaml };
@ -8,7 +8,7 @@ function formatYaml({
rawYaml, rawYaml,
sortKeys = false, sortKeys = false,
indentSize = 2, indentSize = 2,
}: { }: {
rawYaml: MaybeRef<string> rawYaml: MaybeRef<string>
sortKeys?: MaybeRef<boolean> sortKeys?: MaybeRef<boolean>
indentSize?: MaybeRef<number> indentSize?: MaybeRef<number>
@ -17,8 +17,8 @@ function formatYaml({
const formattedYAML = yaml.dump(parsedYaml, { const formattedYAML = yaml.dump(parsedYaml, {
sortKeys: get(sortKeys), sortKeys: get(sortKeys),
indent: get(indentSize) indent: get(indentSize),
}); });
return formattedYAML return formattedYAML;
} }

View file

@ -1,5 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import yaml from 'js-yaml' import yaml from 'js-yaml';
import { useStorage } from '@vueuse/core'; import { useStorage } from '@vueuse/core';
import { formatYaml } from './yaml-models'; import { formatYaml } from './yaml-models';
import { withDefaultOnError } from '@/utils/defaults'; import { withDefaultOnError } from '@/utils/defaults';
@ -12,7 +12,7 @@ const rawYaml = useStorage('yaml-prettify:raw-yaml', '');
const indentSize = useStorage('yaml-prettify:indent-size', 2); const indentSize = useStorage('yaml-prettify:indent-size', 2);
const sortKeys = useStorage('yaml-prettify:sort-keys', false); const sortKeys = useStorage('yaml-prettify:sort-keys', false);
const cleanYaml = computed(() => withDefaultOnError(() => formatYaml({ rawYaml: rawYaml, indentSize, sortKeys }), '')); const cleanYaml = computed(() => withDefaultOnError(() => formatYaml({ rawYaml, indentSize, sortKeys }), ''));
const rawYamlValidation = useValidation({ const rawYamlValidation = useValidation({
source: rawYaml, source: rawYaml,