Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-config-prettier

Package Overview
Dependencies
Maintainers
2
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-config-prettier - npm Package Compare versions

Comparing version 8.10.0 to 9.0.0

37

bin/cli.js

@@ -11,6 +11,16 @@ #!/usr/bin/env node

// with no local eslint-config-prettier installation.
const { ESLint } = require(require.resolve("eslint", {
paths: [process.cwd(), ...require.resolve.paths("eslint")],
}));
const localRequire = (request) =>
require(require.resolve(request, {
paths: [process.cwd(), ...require.resolve.paths("eslint")],
}));
let experimentalApi = {};
try {
experimentalApi = localRequire("eslint/use-at-your-own-risk");
// eslint-disable-next-line unicorn/prefer-optional-catch-binding
} catch (_error) {}
const { ESLint, FlatESLint = experimentalApi.FlatESLint } =
localRequire("eslint");
const SPECIAL_RULES_URL =

@@ -31,4 +41,23 @@ "https://github.com/prettier/eslint-config-prettier#special-rules";

const eslint = new ESLint();
const flatESLint = FlatESLint === undefined ? undefined : new FlatESLint();
Promise.all(args.map((file) => eslint.calculateConfigForFile(file)))
Promise.all(
args.map((file) => {
switch (process.env.ESLINT_USE_FLAT_CONFIG) {
case "true": {
return flatESLint.calculateConfigForFile(file);
}
case "false": {
return eslint.calculateConfigForFile(file);
}
default: {
// This turns synchronous errors (such as `.calculateConfigForFile` not existing)
// and turns them into promise rejections.
return Promise.resolve()
.then(() => flatESLint.calculateConfigForFile(file))
.catch(() => eslint.calculateConfigForFile(file));
}
}
})
)
.then((configs) => {

@@ -35,0 +64,0 @@ const rules = configs.flatMap(({ rules }, index) =>

1

index.js

@@ -80,3 +80,2 @@ "use strict";

"template-tag-spacing": "off",
"unicode-bom": "off",
"wrap-iife": "off",

@@ -83,0 +82,0 @@ "wrap-regex": "off",

{
"name": "eslint-config-prettier",
"version": "8.10.0",
"version": "9.0.0",
"license": "MIT",

@@ -5,0 +5,0 @@ "author": "Simon Lydell",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc