New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

prettier-eslint

Package Overview
Dependencies
Maintainers
2
Versions
104
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prettier-eslint - npm Package Compare versions

Comparing version

to
14.0.3

23

dist/index.js

@@ -70,3 +70,3 @@ "use strict";

} = options;
const eslintConfig = (0, _lodash.default)({}, options.eslintConfig, await getESLintConfig(filePath, eslintPath));
const eslintConfig = (0, _lodash.default)({}, options.eslintConfig, await getESLintConfig(filePath, eslintPath, options.eslintConfig || {}));
const prettierOptions = (0, _lodash.default)({}, filePath && {

@@ -225,5 +225,20 @@ filepath: filePath

async function getESLintConfig(filePath, eslintPath) {
const eslintOptions = {};
function getESLintApiOptions(eslintConfig) {
// https://eslint.org/docs/developer-guide/nodejs-api
// these options affect what calculateConfigForFile produces
return {
ignore: eslintConfig.ignore || true,
ignorePath: eslintConfig.ignorePath || null,
allowInlineConfig: eslintConfig.allowInlineConfig || true,
baseConfig: eslintConfig.baseConfig || null,
overrideConfig: eslintConfig.overrideConfig || null,
overrideConfigFile: eslintConfig.overrideConfigFile || null,
plugins: eslintConfig.plugins || null,
resolvePluginsRelativeTo: eslintConfig.resolvePluginsRelativeTo || null,
rulePaths: eslintConfig.rulePaths || [],
useEslintrc: eslintConfig.useEslintrc || true
};
}
async function getESLintConfig(filePath, eslintPath, eslintOptions) {
if (filePath) {

@@ -237,3 +252,3 @@ eslintOptions.cwd = _path.default.dirname(filePath);

`);
const eslint = (0, _utils.getESLint)(eslintPath, eslintOptions);
const eslint = (0, _utils.getESLint)(eslintPath, getESLintApiOptions(eslintOptions));

@@ -240,0 +255,0 @@ try {

3

dist/utils.js

@@ -109,5 +109,2 @@ "use strict";

useEslintrc: false,
baseConfig: {
settings: eslintConfig.settings || {}
},
...eslintConfig,

@@ -114,0 +111,0 @@ // overrides

{
"name": "prettier-eslint",
"version": "14.0.2",
"version": "14.0.3",
"description": "Formats your JavaScript using prettier followed by eslint --fix",

@@ -5,0 +5,0 @@ "main": "dist/index.js",