Skip to content

Commit edadf7d

Browse files
committed
chore: enable prettier-plugin-pkg correctly
1 parent e689908 commit edadf7d

File tree

11 files changed

+67
-62
lines changed

11 files changed

+67
-62
lines changed

.prettierrc.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
{}
1+
{
2+
"plugins": ["prettier-plugin-pkg"]
3+
}

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,9 @@ The rules with the following star :star: are included in the configs.
144144

145145
### Rules
146146

147-
| Rule ID | Description | Fixable | RECOMMENDED |
148-
|:--------|:------------|:-------:|:-----------:|
149-
| [json-schema-validator/no-invalid](https://ota-meshi.github.io/eslint-plugin-json-schema-validator/rules/no-invalid.html) | validate object with JSON Schema. | | :star: |
147+
| Rule ID | Description | Fixable | RECOMMENDED |
148+
| :------------------------------------------------------------------------------------------------------------------------ | :-------------------------------- | :-----: | :---------: |
149+
| [json-schema-validator/no-invalid](https://ota-meshi.github.io/eslint-plugin-json-schema-validator/rules/no-invalid.html) | validate object with JSON Schema. | | :star: |
150150

151151
<!--RULES_TABLE_END-->
152152
<!--RULES_SECTION_END-->

docs/rules/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ The rules with the following star :star: are included in the `plugin:json-schema
1111

1212
## Rules
1313

14-
| Rule ID | Description | Fixable | RECOMMENDED |
15-
|:--------|:------------|:-------:|:-----------:|
16-
| [json-schema-validator/no-invalid](./no-invalid.md) | validate object with JSON Schema. | | :star: |
14+
| Rule ID | Description | Fixable | RECOMMENDED |
15+
| :-------------------------------------------------- | :-------------------------------- | :-----: | :---------: |
16+
| [json-schema-validator/no-invalid](./no-invalid.md) | validate object with JSON Schema. | | :star: |

docs/rules/no-invalid.md

Lines changed: 42 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -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

@@ -81,19 +83,19 @@ This option can also be given a JSON schema file or URL. This is useful for conf
8183
*/
8284

8385
module.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

docs/user-guide/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ npm install --save-dev eslint eslint-plugin-json-schema-validator
1010

1111
- ESLint v6.0.0 and above
1212
- Node.js v14.17.x, v16.x and above
13-
:::
13+
:::
1414

1515
## :book: Usage
1616

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"author": "Yosuke Ota",
88
"funding": "https://github.com/sponsors/ota-meshi",
99
"license": "MIT",
10+
"packageManager": "[email protected]",
1011
"engines": {
1112
"node": "^14.18.0 || >=16.0.0"
1213
},
@@ -28,15 +29,16 @@
2829
"build:ts": "tsc --project ./tsconfig.build.json",
2930
"clean": "rimraf .nyc_output dist coverage",
3031
"cover": "nyc --reporter=lcov yarn test",
31-
"docs:watch": "vitepress dev docs",
3232
"docs:build": "yarn build && vitepress build docs",
3333
"docs:build-and-preview": "yarn docs:build && npx http-server docs/.vitepress/dist",
34+
"docs:watch": "vitepress dev docs",
3435
"lint": "eslint .",
3536
"lint-fix": "yarn lint --fix",
3637
"mocha": "yarn ts node_modules/mocha/bin/mocha",
3738
"new": "yarn ts ./tools/new-rule",
3839
"prebuild": "yarn -s clean",
3940
"predocs:watch": "yarn build",
41+
"prelint": "yarn build",
4042
"prerelease": "yarn test && yarn build",
4143
"preversion": "yarn test && git add .",
4244
"release": "clean-pkg-json && changeset publish",
@@ -121,6 +123,5 @@
121123
},
122124
"publishConfig": {
123125
"access": "public"
124-
},
125-
"packageManager": "[email protected]"
126+
}
126127
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
var a = {foo: 'bar'}
1+
var a = { foo: "bar" }
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"foo": "bar"}
1+
{ "foo": "bar" }
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
var a = {foo: 'bar'}
1+
var a = { foo: "bar" }
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"foo": "bar"}
1+
{ "foo": "bar" }

0 commit comments

Comments
 (0)