Socket
Socket
Sign inDemoInstall

eslint-config-prettier

Package Overview
Dependencies
88
Maintainers
2
Versions
72
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 8.8.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) =>

3

index.js

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

"linebreak-style": "off",
"max-statements-per-line": "off",
"multiline-ternary": "off",

@@ -80,3 +81,2 @@ "newline-per-chained-call": "off",

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

@@ -140,2 +140,3 @@ "wrap-regex": "off",

"vue/array-bracket-spacing": "off",
"vue/array-element-newline": "off",
"vue/arrow-spacing": "off",

@@ -142,0 +143,0 @@ "vue/block-spacing": "off",

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

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

@@ -9,2 +9,4 @@ # eslint-config-prettier

[prettier]: https://github.com/prettier/prettier
**[➡️ Full readme](https://github.com/prettier/eslint-config-prettier/)**
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc