mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-04-29 02:49:13 -04:00
chore(lint): switched to a better lint config
This commit is contained in:
parent
4d2b037dbe
commit
33c9b6643f
178 changed files with 4105 additions and 3371 deletions
|
@ -1,4 +1,4 @@
|
|||
import { test, expect } from '@playwright/test';
|
||||
import { expect, test } from '@playwright/test';
|
||||
|
||||
test.describe('Tool - json to yaml', () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
|
@ -14,6 +14,6 @@ test.describe('Tool - json to yaml', () => {
|
|||
|
||||
const generatedJson = await page.getByTestId('area-content').innerText();
|
||||
|
||||
expect(generatedJson.trim()).toEqual(`foo: bar\nlist:\n - item\n - key: value`.trim());
|
||||
expect(generatedJson.trim()).toEqual('foo: bar\nlist:\n - item\n - key: value'.trim());
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,20 +1,9 @@
|
|||
<template>
|
||||
<format-transformer
|
||||
input-label="Your JSON"
|
||||
input-placeholder="Paste your JSON here..."
|
||||
output-label="YAML from your JSON"
|
||||
output-language="yaml"
|
||||
:input-validation-rules="rules"
|
||||
:transformer="transformer"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { stringify } from 'yaml';
|
||||
import JSON5 from 'json5';
|
||||
import type { UseValidationRule } from '@/composable/validation';
|
||||
import { isNotThrowing } from '@/utils/boolean';
|
||||
import { withDefaultOnError } from '@/utils/defaults';
|
||||
import { stringify } from 'yaml';
|
||||
import JSON5 from 'json5';
|
||||
|
||||
const transformer = (value: string) => withDefaultOnError(() => stringify(JSON5.parse(value)), '');
|
||||
|
||||
|
@ -26,4 +15,13 @@ const rules: UseValidationRule<string>[] = [
|
|||
];
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
<template>
|
||||
<format-transformer
|
||||
input-label="Your JSON"
|
||||
input-placeholder="Paste your JSON here..."
|
||||
output-label="YAML from your JSON"
|
||||
output-language="yaml"
|
||||
:input-validation-rules="rules"
|
||||
:transformer="transformer"
|
||||
/>
|
||||
</template>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue