-
Notifications
You must be signed in to change notification settings - Fork 143
JSON Schemas should be added to tsconfig.json and package.json #2329
Copy link
Copy link
Labels
[Type] EnhancementA suggestion for improvement of an existing featureA suggestion for improvement of an existing feature
Description
In #2325, JSON Schema validation was introduced for the project. This is currently doing:
Validating .wp-env.json against schema: https://schemas.wp.org/trunk/wp-env.json
Validating .wp-env.override.json against schema: https://schemas.wp.org/trunk/wp-env.json
Validating plugins/performance-lab/.wordpress-org/blueprints/blueprint.json against schema: https://playground.wordpress.net/blueprint-schema.json
I thought about adding a Schema to tsconfig.json as well:
diff --git a/tsconfig.json b/tsconfig.json
index 70c47f9e..c40ded42 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -1,4 +1,5 @@
{
+ "$schema": "https://www.schemastore.org/tsconfig.json",
"compilerOptions": {
"checkJs": true,
"noEmit": true,But for some reason this just hangs indefinitely:
npm run lint-json tsconfig.jsonI found it seems work endlessly at this line:
performance/bin/validate-json-schema.js
Line 77 in 1510693
| const validate = await ajv.compileAsync( { $ref: data.$schema } ); |
However, it works for the package.json when I do this:
diff --git a/tsconfig.json b/tsconfig.json
index 70c47f9e..c40ded42 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -1,4 +1,5 @@
{
+ "$schema": "https://www.schemastore.org/tsconfig.json",
"compilerOptions": {
"checkJs": true,
"noEmit": true,This would be a nice if all the JSON files with JSON Schemas available could be validated.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
[Type] EnhancementA suggestion for improvement of an existing featureA suggestion for improvement of an existing feature
Type
Fields
Give feedbackNo fields configured for Enhancement.
Projects
Status
Done 😃