babel-plugin-tester
Advanced tools
@@ -13,10 +13,10 @@ "use strict"; | ||
| const configDirectoryCache = Object.create(null); | ||
| const getCachedConfig = directory => { | ||
| if (!(directory in configDirectoryCache)) { | ||
| debug(`caching prettier configuration resolved from ${directory}: %O`, configDirectoryCache[directory]); | ||
| configDirectoryCache[directory] = _prettier.resolveConfig.sync(directory); | ||
| const getCachedConfig = filepath => { | ||
| if (!(filepath in configDirectoryCache)) { | ||
| configDirectoryCache[filepath] = _prettier.resolveConfig.sync(filepath); | ||
| debug(`caching prettier configuration resolved from ${filepath}: %O`, configDirectoryCache[filepath]); | ||
| } else { | ||
| debug(`using cached prettier configuration resolved from ${directory}`); | ||
| debug(`using cached prettier configuration resolved from ${filepath}`); | ||
| } | ||
| return configDirectoryCache[directory]; | ||
| return configDirectoryCache[filepath]; | ||
| }; | ||
@@ -28,3 +28,3 @@ const prettierFormatter = (code, { | ||
| config, | ||
| prettierOptions = config || getCachedConfig(cwd) | ||
| prettierOptions = config || getCachedConfig(filepath) | ||
| } = {}) => { | ||
@@ -31,0 +31,0 @@ const finalPrettierOptions = { |
+5
-4
| { | ||
| "name": "babel-plugin-tester", | ||
| "version": "11.0.2", | ||
| "version": "11.0.3", | ||
| "description": "Utilities for testing babel plugins", | ||
@@ -97,5 +97,6 @@ "keywords": [ | ||
| "all-contributors-cli": "^6.24.0", | ||
| "babel-jest": "^29.3.1", | ||
| "babel-jest": "^29.4.0", | ||
| "babel-loader": "^9.1.2", | ||
| "babel-plugin-explicit-exports-references": "^1.0.2", | ||
| "browserslist": "^4.21.4", | ||
| "conventional-changelog-cli": "https://xunn.at/conventional-changelog-cli", | ||
@@ -112,4 +113,4 @@ "doctoc": "^2.2.1", | ||
| "husky": "^8.0.3", | ||
| "jest": "^29.3.1", | ||
| "jest-circus": "^29.3.1", | ||
| "jest": "^29.4.0", | ||
| "jest-circus": "^29.4.0", | ||
| "jest-extended": "^3.2.3", | ||
@@ -116,0 +117,0 @@ "lint-staged": "^13.1.0", |
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 4 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 4 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
192026
0.01%92
1.1%