diff --git a/bin/cli.js b/bin/cli.js index e0da87d..9e16cfb 100755 --- a/bin/cli.js +++ b/bin/cli.js @@ -4,9 +4,14 @@ const fs = require("fs"); const path = require("path"); -const { ESLint } = require("eslint"); const validators = require("./validators"); +// Require locally installed eslint, for `npx eslint-config-prettier` support +// with no local eslint-config-prettier installation. +const { ESLint } = require(require.resolve("eslint", { + paths: [process.cwd(), ...require.resolve.paths("eslint")], +})); + const SPECIAL_RULES_URL = "https://github.com/prettier/eslint-config-prettier#special-rules";