Skip to content

Commit 2fc216f

Browse files
authored
chore: update prettier config (#130)
1 parent ae3b128 commit 2fc216f

22 files changed

+912
-913
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
module.exports = {
22
root: true,
3-
extends: ['@webpack-contrib/eslint-config-webpack', 'prettier'],
3+
extends: ["@webpack-contrib/eslint-config-webpack", "prettier"],
44
};

.prettierrc.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

README.md

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ npm install schema-utils
4646
```
4747

4848
```js
49-
import schema from './path/to/schema.json';
50-
import { validate } from 'schema-utils';
49+
import schema from "./path/to/schema.json";
50+
import { validate } from "schema-utils";
5151

5252
const options = { option: true };
53-
const configuration = { name: 'Loader Name/Plugin Name/Name' };
53+
const configuration = { name: "Loader Name/Plugin Name/Name" };
5454

5555
validate(schema, options, configuration);
5656
```
@@ -83,12 +83,12 @@ Type: `Object`
8383
Object with options.
8484

8585
```js
86-
import schema from './path/to/schema.json';
87-
import { validate } from 'schema-utils';
86+
import schema from "./path/to/schema.json";
87+
import { validate } from "schema-utils";
8888

89-
const options = { foo: 'bar' };
89+
const options = { foo: "bar" };
9090

91-
validate(schema, { name: 123 }, { name: 'MyPlugin' });
91+
validate(schema, { name: 123 }, { name: "MyPlugin" });
9292
```
9393

9494
### `configuration`
@@ -123,12 +123,12 @@ Default: `"Object"`
123123
Allow to setup name in validation errors.
124124

125125
```js
126-
import schema from './path/to/schema.json';
127-
import { validate } from 'schema-utils';
126+
import schema from "./path/to/schema.json";
127+
import { validate } from "schema-utils";
128128

129-
const options = { foo: 'bar' };
129+
const options = { foo: "bar" };
130130

131-
validate(schema, options, { name: 'MyPlugin' });
131+
validate(schema, options, { name: "MyPlugin" });
132132
```
133133

134134
```shell
@@ -144,12 +144,12 @@ Default: `"configuration"`
144144
Allow to setup base data path in validation errors.
145145

146146
```js
147-
import schema from './path/to/schema.json';
148-
import { validate } from 'schema-utils';
147+
import schema from "./path/to/schema.json";
148+
import { validate } from "schema-utils";
149149

150-
const options = { foo: 'bar' };
150+
const options = { foo: "bar" };
151151

152-
validate(schema, options, { name: 'MyPlugin', baseDataPath: 'options' });
152+
validate(schema, options, { name: "MyPlugin", baseDataPath: "options" });
153153
```
154154

155155
```shell
@@ -165,15 +165,15 @@ Default: `undefined`
165165
Allow to reformat errors.
166166

167167
```js
168-
import schema from './path/to/schema.json';
169-
import { validate } from 'schema-utils';
168+
import schema from "./path/to/schema.json";
169+
import { validate } from "schema-utils";
170170

171-
const options = { foo: 'bar' };
171+
const options = { foo: "bar" };
172172

173173
validate(schema, options, {
174-
name: 'MyPlugin',
174+
name: "MyPlugin",
175175
postFormatter: (formattedError, error) => {
176-
if (error.keyword === 'type') {
176+
if (error.keyword === "type") {
177177
return `${formattedError}\nAdditional Information.`;
178178
}
179179

@@ -220,17 +220,17 @@ Invalid options object. MyPlugin has been initialized using an options object th
220220
### `Loader`
221221

222222
```js
223-
import { getOptions } from 'loader-utils';
224-
import { validate } from 'schema-utils';
223+
import { getOptions } from "loader-utils";
224+
import { validate } from "schema-utils";
225225

226-
import schema from 'path/to/schema.json';
226+
import schema from "path/to/schema.json";
227227

228228
function loader(src, map) {
229229
const options = getOptions(this);
230230

231231
validate(schema, options, {
232-
name: 'Loader Name',
233-
baseDataPath: 'options',
232+
name: "Loader Name",
233+
baseDataPath: "options",
234234
});
235235

236236
// Code...
@@ -242,15 +242,15 @@ export default loader;
242242
### `Plugin`
243243

244244
```js
245-
import { validate } from 'schema-utils';
245+
import { validate } from "schema-utils";
246246

247-
import schema from 'path/to/schema.json';
247+
import schema from "path/to/schema.json";
248248

249249
class Plugin {
250250
constructor(options) {
251251
validate(schema, options, {
252-
name: 'Plugin Name',
253-
baseDataPath: 'options',
252+
name: "Plugin Name",
253+
baseDataPath: "options",
254254
});
255255

256256
this.options = options;

babel.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ module.exports = (api) => {
77
return {
88
presets: [
99
[
10-
'@babel/preset-env',
10+
"@babel/preset-env",
1111
{
1212
targets: {
13-
node: '10.13.0',
13+
node: "10.13.0",
1414
},
1515
},
1616
],

commitlint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = {
2-
extends: ['@commitlint/config-conventional'],
2+
extends: ["@commitlint/config-conventional"],
33
};

declarations/ValidationError.d.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
export default ValidationError;
2-
export type JSONSchema6 = import('json-schema').JSONSchema6;
3-
export type JSONSchema7 = import('json-schema').JSONSchema7;
4-
export type Schema = import('./validate').Schema;
2+
export type JSONSchema6 = import("json-schema").JSONSchema6;
3+
export type JSONSchema7 = import("json-schema").JSONSchema7;
4+
export type Schema = import("./validate").Schema;
55
export type ValidationErrorConfiguration =
6-
import('./validate').ValidationErrorConfiguration;
7-
export type PostFormatter = import('./validate').PostFormatter;
8-
export type SchemaUtilErrorObject = import('./validate').SchemaUtilErrorObject;
6+
import("./validate").ValidationErrorConfiguration;
7+
export type PostFormatter = import("./validate").PostFormatter;
8+
export type SchemaUtilErrorObject = import("./validate").SchemaUtilErrorObject;
99
declare class ValidationError extends Error {
1010
/**
1111
* @param {Array<SchemaUtilErrorObject>} errors

declarations/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import { validate } from './validate';
2-
import { ValidationError } from './validate';
1+
import { validate } from "./validate";
2+
import { ValidationError } from "./validate";
33
export { validate, ValidationError };

declarations/keywords/absolutePath.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export default addAbsolutePathKeyword;
2-
export type Ajv = import('ajv').Ajv;
3-
export type ValidateFunction = import('ajv').ValidateFunction;
4-
export type SchemaUtilErrorObject = import('../validate').SchemaUtilErrorObject;
2+
export type Ajv = import("ajv").Ajv;
3+
export type ValidateFunction = import("ajv").ValidateFunction;
4+
export type SchemaUtilErrorObject = import("../validate").SchemaUtilErrorObject;
55
/**
66
*
77
* @param {Ajv} ajv

declarations/util/Range.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ declare class Range {
1414
* @returns {">" | ">=" | "<" | "<="}
1515
*/
1616
static getOperator(
17-
side: 'left' | 'right',
17+
side: "left" | "right",
1818
exclusive: boolean
19-
): '>' | '>=' | '<' | '<=';
19+
): ">" | ">=" | "<" | "<=";
2020
/**
2121
* @param {number} value
2222
* @param {boolean} logic is not logic applied

declarations/util/hints.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export function stringHints(schema: Schema, logic: boolean): string[];
22
export function numberHints(schema: Schema, logic: boolean): string[];
3-
export type Schema = import('../validate').Schema;
3+
export type Schema = import("../validate").Schema;

declarations/validate.d.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
export type JSONSchema4 = import('json-schema').JSONSchema4;
2-
export type JSONSchema6 = import('json-schema').JSONSchema6;
3-
export type JSONSchema7 = import('json-schema').JSONSchema7;
4-
export type ErrorObject = import('ajv').ErrorObject;
1+
export type JSONSchema4 = import("json-schema").JSONSchema4;
2+
export type JSONSchema6 = import("json-schema").JSONSchema6;
3+
export type JSONSchema7 = import("json-schema").JSONSchema7;
4+
export type ErrorObject = import("ajv").ErrorObject;
55
export type Extend = {
66
formatMinimum?: number | undefined;
77
formatMaximum?: number | undefined;
@@ -32,5 +32,5 @@ export function validate(
3232
options: Array<object> | object,
3333
configuration?: ValidationErrorConfiguration | undefined
3434
): void;
35-
import ValidationError from './ValidationError';
35+
import ValidationError from "./ValidationError";
3636
export { ValidationError };

lint-staged.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
module.exports = {
2-
'*.js': ['eslint --fix', 'prettier --write'],
3-
'*.{json,md,yml,css,ts}': ['prettier --write'],
2+
"*.js": ["eslint --fix", "prettier --write"],
3+
"*.{json,md,yml,css,ts}": ["prettier --write"],
44
};

0 commit comments

Comments
 (0)