diff --git a/package.json b/package.json index 256e6e9c64..1f357a62b3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,7 @@ { "name": "prettierx-rebase-branch-001", "version": "0.1.0-dev", + "prettier-version": "2.4.0", "description": "prettierx-rebase-branch-001 version branch", "bin": "./bin/prettier.js", "license": "MIT", diff --git a/src/main/support.js b/src/main/support.js index 3f9a6d914f..78aeedfa57 100644 --- a/src/main/support.js +++ b/src/main/support.js @@ -6,10 +6,12 @@ const semver = { gte: require("semver/functions/gte"), }; const arrayify = require("../utils/arrayify"); +// [prettierx] read info from package.json: +const pkg = require("../../package.json"); const coreOptions = require("./core-options").options; -// [prettierx] quick workaround: -const currentVersion = "2.2.0"; +// [prettierx] get info from package.json: +const currentVersion = pkg["prettier-version"]; /** * Strings in `plugins` and `pluginSearchDirs` are handled by a wrapped version