Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add json schema validation to aglintrc.json file for autocompletion #211

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

royhadad
Copy link

@royhadad royhadad commented Jul 1, 2024

Closes #210

After this is approved, the next step would be to add it to schema store in this file.

@@ -2,6 +2,8 @@
.DS_Store
.eslintcache
.vscode
.idea
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ignore InteliJ IDEA configuration files

@@ -68,6 +68,7 @@
"@types/text-table": "^0.2.2",
"@typescript-eslint/eslint-plugin": "^5.60.1",
"@typescript-eslint/parser": "^5.60.1",
"ajv": "^8.16.0",
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dev dependency for tests

@@ -84,15 +86,30 @@ describe('Linter config', () => {
});
});

test('check custom Superstruct validation', () => {
const assertSuperStruct = (value: unknown) => {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

running the tests both on superstruct and the json schema, because they are duplicated.
In the future, we could migrate from Superstruct to Zod and automatically convert it to json schema using zod-to-json-schema, as @scripthunter7 suggested in AdguardTeam/VscodeAdblockSyntax#136

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

.aglintrc.json file json schema for autocompletion
1 participant