@dotcom-tool-kit/prettier 2.0.7 → 2.0.9
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.
|
@@ -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;IAEvB,MAAM,CAAC,cAAc,EAAE,eAAe,
|
|
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;IAEvB,MAAM,CAAC,cAAc,EAAE,eAAe,CAUrC;IAEK,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
|
@@ -29,6 +29,10 @@ class Prettier extends types_1.Task {
|
|
|
29
29
|
this.logger.warn(`prettier could not find the specified configFile${options.configFile ? ` (${logger_1.styles.filepath(options.configFile)})` : ''}), using ${logger_1.styles.option('configOptions')} instead`);
|
|
30
30
|
prettierConfig = options.configOptions;
|
|
31
31
|
}
|
|
32
|
+
const { ignored } = await prettier_1.default.getFileInfo(filepath, { ignorePath: this.options.ignoreFile });
|
|
33
|
+
if (ignored) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
32
36
|
const unhook = (0, logger_1.hookConsole)(this.logger, 'prettier');
|
|
33
37
|
try {
|
|
34
38
|
await fs_1.promises.writeFile(filepath, prettier_1.default.format(fileContent, { ...prettierConfig, filepath }));
|
|
@@ -61,6 +65,7 @@ exports.default = Prettier;
|
|
|
61
65
|
Prettier.description = '';
|
|
62
66
|
Prettier.defaultOptions = {
|
|
63
67
|
files: ['**/*.js'],
|
|
68
|
+
ignoreFile: '.prettierignore',
|
|
64
69
|
configOptions: {
|
|
65
70
|
singleQuote: true,
|
|
66
71
|
useTabs: true,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dotcom-tool-kit/prettier",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.9",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib",
|
|
6
6
|
"scripts": {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"@dotcom-tool-kit/error": "^2.0.0",
|
|
14
14
|
"@dotcom-tool-kit/logger": "^2.1.1",
|
|
15
15
|
"@dotcom-tool-kit/package-json-hook": "^2.1.0",
|
|
16
|
-
"@dotcom-tool-kit/types": "^2.
|
|
16
|
+
"@dotcom-tool-kit/types": "^2.6.1",
|
|
17
17
|
"fast-glob": "^3.2.7",
|
|
18
18
|
"hook-std": "^2.0.0",
|
|
19
19
|
"prettier": "^2.2.1"
|