@dotcom-tool-kit/prettier 2.1.3 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +1 -1
- package/lib/tasks/prettier.d.ts +0 -1
- package/lib/tasks/prettier.d.ts.map +1 -1
- package/lib/tasks/prettier.js +2 -13
- package/package.json +4 -4
- package/readme.md +5 -21
package/lib/index.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.hooks = exports.tasks = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const package_json_hook_1 = require("@dotcom-tool-kit/package-json-hook");
|
|
6
|
-
const prettier_1 =
|
|
6
|
+
const prettier_1 = tslib_1.__importDefault(require("./tasks/prettier"));
|
|
7
7
|
exports.tasks = [prettier_1.default];
|
|
8
8
|
class FormatLocal extends package_json_hook_1.PackageJsonScriptHook {
|
|
9
9
|
constructor() {
|
package/lib/tasks/prettier.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { PrettierOptions, PrettierSchema } from '@dotcom-tool-kit/types/lib/sche
|
|
|
2
2
|
import { Task } from '@dotcom-tool-kit/types';
|
|
3
3
|
export default class Prettier extends Task<typeof PrettierSchema> {
|
|
4
4
|
static description: string;
|
|
5
|
-
static defaultOptions: PrettierOptions;
|
|
6
5
|
run(files?: string[]): Promise<void>;
|
|
7
6
|
formatFile: (filepath: string, options: PrettierOptions) => Promise<void>;
|
|
8
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prettier.d.ts","sourceRoot":"","sources":["../../src/tasks/prettier.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAA;AAI5F,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAG7C,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,IAAI,CAAC,OAAO,cAAc,CAAC;IAC/D,MAAM,CAAC,WAAW,SAAK;
|
|
1
|
+
{"version":3,"file":"prettier.d.ts","sourceRoot":"","sources":["../../src/tasks/prettier.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAA;AAI5F,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAG7C,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,IAAI,CAAC,OAAO,cAAc,CAAC;IAC/D,MAAM,CAAC,WAAW,SAAK;IAEjB,GAAG,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAkB1C,UAAU,aAAoB,MAAM,WAAW,eAAe,KAAG,QAAQ,IAAI,CAAC,CAsC7E;CACF"}
|
package/lib/tasks/prettier.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const prettier_1 =
|
|
4
|
+
const prettier_1 = tslib_1.__importDefault(require("prettier"));
|
|
5
5
|
const fs_1 = require("fs");
|
|
6
|
-
const fast_glob_1 =
|
|
6
|
+
const fast_glob_1 = tslib_1.__importDefault(require("fast-glob"));
|
|
7
7
|
const logger_1 = require("@dotcom-tool-kit/logger");
|
|
8
8
|
const types_1 = require("@dotcom-tool-kit/types");
|
|
9
9
|
const error_1 = require("@dotcom-tool-kit/error");
|
|
@@ -63,14 +63,3 @@ class Prettier extends types_1.Task {
|
|
|
63
63
|
}
|
|
64
64
|
exports.default = Prettier;
|
|
65
65
|
Prettier.description = '';
|
|
66
|
-
Prettier.defaultOptions = {
|
|
67
|
-
files: ['**/*.{js,jsx,ts,tsx}'],
|
|
68
|
-
ignoreFile: '.prettierignore',
|
|
69
|
-
configOptions: {
|
|
70
|
-
singleQuote: true,
|
|
71
|
-
useTabs: true,
|
|
72
|
-
bracketSpacing: true,
|
|
73
|
-
arrowParens: 'always',
|
|
74
|
-
trailingComma: 'none'
|
|
75
|
-
}
|
|
76
|
-
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dotcom-tool-kit/prettier",
|
|
3
|
-
"version": "2.1
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib",
|
|
6
6
|
"scripts": {
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
"license": "ISC",
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@dotcom-tool-kit/error": "^2.0.1",
|
|
14
|
-
"@dotcom-tool-kit/logger": "^2.2.
|
|
14
|
+
"@dotcom-tool-kit/logger": "^2.2.1",
|
|
15
15
|
"@dotcom-tool-kit/package-json-hook": "^3.0.0",
|
|
16
|
-
"@dotcom-tool-kit/types": "^2.
|
|
16
|
+
"@dotcom-tool-kit/types": "^2.9.1",
|
|
17
17
|
"fast-glob": "^3.2.7",
|
|
18
18
|
"hook-std": "^2.0.0",
|
|
19
19
|
"prettier": "^2.2.1",
|
|
@@ -40,6 +40,6 @@
|
|
|
40
40
|
"extends": "../../package.json"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"dotcom-tool-kit": "2.
|
|
43
|
+
"dotcom-tool-kit": "^2.6.0"
|
|
44
44
|
}
|
|
45
45
|
}
|
package/readme.md
CHANGED
|
@@ -27,26 +27,10 @@ This will modify your `package.json`. You should commit this change.
|
|
|
27
27
|
|
|
28
28
|
### Options
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
A required Array of strings of filepath(s) or filepath pattern(s) to be formatted
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
An optional prettier configuration object. Defaults to:
|
|
37
|
-
|
|
38
|
-
```js
|
|
39
|
-
{
|
|
40
|
-
singleQuote: true,
|
|
41
|
-
useTabs: true,
|
|
42
|
-
bracketSpacing: true,
|
|
43
|
-
arrowParens: 'always',
|
|
44
|
-
trailingComma: 'none'
|
|
45
|
-
}
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
#### `configFile`
|
|
49
|
-
|
|
50
|
-
An optional String that specifies the prettier configuration file (.prettierrc.json). The configuration file will be resolved starting from the location of the file being formatted, and searching up the file tree until a config file is (or isn’t) found. If the configFile is not found the prettier plugin will default to configOptions.
|
|
30
|
+
| Key | Description | Default value |
|
|
31
|
+
|-|-|-|
|
|
32
|
+
| `files` | A required Array of strings of filepath(s) or filepath pattern(s) to be formatted | `['{,!(node_modules)/**/}*.js']` |
|
|
33
|
+
| `configOptions` | An optional prettier configuration object | <br>`{`<br>` singleQuote: true,`<br>` useTabs: true,`<br>` bracketSpacing: true,`<br>` arrowParens: 'always',`<br>` trailingComma: 'none'`<br>`}`<br> |
|
|
34
|
+
| `configFile` | An optional String that specifies the prettier configuration file (.prettierrc.json). The configuration file will be resolved starting from the location of the file being formatted, and searching up the file tree until a config file is (or isn’t) found. If the configFile is not found the prettier plugin will default to configOptions. | `configOptions` value |
|
|
51
35
|
|
|
52
36
|
For more information on prettier configuration, visit the [Prettier docs](https://prettier.io/docs/en/configuration.html).
|