@@ -24,18 +24,18 @@ This rule validates the file with JSON Schema and reports errors.
2424// File name is ".eslintrc.json"
2525/* eslint json-schema-validator/no-invalid: 'error' */
2626{
27- " overrides" : [
28- {
29- " files" : [" good" ],
30- /* ✓ GOOD */
31- " extends" : [" foo" ]
32- },
33- {
34- " files" : [" bad" ],
35- /* ✗ BAD */
36- " extends" : [42 ]
37- }
38- ]
27+ overrides: [
28+ {
29+ files: [" good" ],
30+ /* ✓ GOOD */
31+ extends: [" foo" ],
32+ },
33+ {
34+ files: [" bad" ],
35+ /* ✗ BAD */
36+ extends: [42 ],
37+ },
38+ ],
3939}
4040```
4141
@@ -45,19 +45,21 @@ This rule validates the file with JSON Schema and reports errors.
4545
4646``` json5
4747{
48- " json-schema-validator/no-invalid" : [
49- " error" ,
48+ " json-schema-validator/no-invalid" : [
49+ " error" ,
50+ {
51+ schemas: [
5052 {
51- " schemas " : [
52- {
53- " fileMatch " : [ " .eslintrc.json " ],
54- " schema " : { /* JSON Schema Definition */ } // or string
55- }
56- ],
57- " useSchemastoreCatalog" : true ,
58- " mergeSchemas" : true // or ["$schema", "options", "catalog"]
59- }
60- ]
53+ fileMatch : [" .eslintrc.json " ],
54+ schema : {
55+ /* JSON Schema Definition */
56+ }, // or string
57+ },
58+ ],
59+ useSchemastoreCatalog: true ,
60+ mergeSchemas: true , // or ["$schema", "options", "catalog"]
61+ },
62+ ],
6163}
6264```
6365
@@ -76,24 +78,24 @@ This option can also be given a JSON schema file or URL. This is useful for conf
7678``` js
7779/* eslint json-schema-validator/no-invalid: [
7880 "error",
79- "https://json .schemastore.org/eslintrc"
81+ "https://www .schemastore.org/eslintrc"
8082 ]
8183*/
8284
8385module .exports = {
84- overrides: [
85- {
86- files: [" good" ],
87- /* ✓ GOOD */
88- extends: [" foo" ]
89- },
90- {
91- files: [" bad" ],
92- /* ✗ BAD */
93- extends: [42 ]
94- }
95- ]
96- }
86+ overrides: [
87+ {
88+ files: [" good" ],
89+ /* ✓ GOOD */
90+ extends: [" foo" ],
91+ },
92+ {
93+ files: [" bad" ],
94+ /* ✗ BAD */
95+ extends: [42 ],
96+ },
97+ ],
98+ };
9799```
98100
99101</eslint-code-block >
@@ -120,9 +122,9 @@ To match a custom block, use a glob like this:
120122
121123``` json5
122124{
123- // If you want to match the <i18n> block.
124- " fileMatch" : [" **/*blockType=i18n*" ],
125- " schema" : { " type" : " object" /* JSON Schema Definition */ }
125+ // If you want to match the <i18n> block.
126+ fileMatch: [" **/*blockType=i18n*" ],
127+ schema: { type: " object" /* JSON Schema Definition */ },
126128}
127129```
128130
0 commit comments