babel-plugin-tester
Advanced tools
Comparing version 11.0.0 to 11.0.1
@@ -15,4 +15,14 @@ import { type Options as PrettierOptions } from 'prettier'; | ||
export declare const prettierFormatter: ResultFormatter<{ | ||
/** | ||
* Options passed directly to prettier, allowing you to override the defaults. | ||
*/ | ||
prettierOptions: MaybePrettierOptions; | ||
/** | ||
* If this deprecated parameter is given as an argument, treat it as the value | ||
* of `prettierOptions`. Otherwise, it should not be used. | ||
* | ||
* @deprecated Use `prettierOptions` instead. | ||
*/ | ||
config: MaybePrettierOptions; | ||
}>; | ||
export default prettierFormatter; |
@@ -26,11 +26,14 @@ "use strict"; | ||
filepath = filename || _nodePath.default.join(cwd, 'dummy.js'), | ||
prettierOptions = getCachedConfig(cwd) | ||
config, | ||
prettierOptions = config || getCachedConfig(cwd) | ||
} = {}) => { | ||
const finalPrettierOptions = { | ||
filepath, | ||
...prettierOptions | ||
}; | ||
debug('cwd: %O', cwd); | ||
debug('filepath: %O', filepath); | ||
debug('original code: %O', code); | ||
const formattedCode = (0, _prettier.format)(code, { | ||
filepath, | ||
...prettierOptions | ||
}); | ||
debug('prettier options: %O', finalPrettierOptions); | ||
debug('original code: %O', code); | ||
const formattedCode = (0, _prettier.format)(code, finalPrettierOptions); | ||
debug('formatted code: %O', code); | ||
@@ -37,0 +40,0 @@ return formattedCode; |
@@ -15,2 +15,3 @@ import { prettierFormatter } from './formatters/prettier'; | ||
prettierOptions: import("prettier").Options | null; | ||
config: import("prettier").Options | null; | ||
}>; | ||
@@ -17,0 +18,0 @@ export var unstringSnapshotSerializer: import("pretty-format").Plugin; |
@@ -44,2 +44,3 @@ import { prettierFormatter } from './formatters/prettier'; | ||
prettierOptions: import("prettier").Options | null; | ||
config: import("prettier").Options | null; | ||
}>; | ||
@@ -46,0 +47,0 @@ export var unstringSnapshotSerializer: import("pretty-format").Plugin; |
{ | ||
"name": "babel-plugin-tester", | ||
"version": "11.0.0", | ||
"version": "11.0.1", | ||
"description": "Utilities for testing babel plugins", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
191333
2332
2019