feat(new tool): JSON Linter

Fix part of #605
This commit is contained in:
sharevb 2024-04-28 12:51:16 +02:00 committed by ShareVB
parent 75269c8cd7
commit 9390435366
5 changed files with 51 additions and 22 deletions

View file

@ -1,12 +1,12 @@
import { ArrowsShuffle } from '@vicons/tabler';
import { Braces } from '@vicons/tabler';
import { defineTool } from '../tool';
export const tool = defineTool({
name: 'Json linter',
name: 'JSON Linter',
path: '/json-linter',
description: '',
keywords: ['json', 'linter'],
description: 'Check and lint JSON content',
keywords: ['json', 'linter', 'check'],
component: () => import('./json-linter.vue'),
icon: ArrowsShuffle,
createdAt: new Date('2024-03-27'),
});
icon: Braces,
createdAt: new Date('2024-03-20'),
});

11
src/tools/json-linter/jsonlint-mod.d.ts vendored Normal file
View file

@ -0,0 +1,11 @@
declare module 'jsonlint-mod'{
/**
* Parse a JSON string to Typescript Object. If there is an error will print it
* as human readible.
*
* Please use `import * as jsonlint from 'jsonlint';`. Instead of,
* `import {parse} from 'jsonlint';`. Otherwise, it cannot reference to the
* correct instance.
*/
export function parse(str: string): Record<string, unknown>;
}