-
-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: make the cli work with/without
prettier-eslint
peer (#438)
BREAKING CHANGE: bump all upgradable (dev)Dependencies except pure ESM
- Loading branch information
Showing
5 changed files
with
29 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,16 @@ | |
"JounQin (https://www.1stG.me) <[email protected]>" | ||
], | ||
"license": "MIT", | ||
"peerDependencies": { | ||
"prettier-eslint": "*" | ||
}, | ||
"peerDependenciesMeta": { | ||
"prettier-eslint": { | ||
"optional": true | ||
} | ||
}, | ||
"dependencies": { | ||
"@prettier/eslint": "npm:prettier-eslint@^15.0.1", | ||
"arrify": "^2.0.1", | ||
"boolify": "^1.0.1", | ||
"camelcase-keys": "^7.0.2", | ||
|
@@ -42,7 +51,6 @@ | |
"lodash.memoize": "^4.1.2", | ||
"loglevel-colored-level-prefix": "^1.0.0", | ||
"messageformat": "^2.3.0", | ||
"prettier-eslint": "^15.0.1", | ||
"rxjs": "^7.5.6", | ||
"yargs": "^13.1.1" | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const getLogger = require('loglevel-colored-level-prefix'); | ||
|
||
const logger = getLogger({ prefix: 'prettier-eslint-cli' }); | ||
|
||
try { | ||
// if `prettier-eslint` is installed by the user manually | ||
module.exports = require('prettier-eslint'); | ||
} catch (err) /* istanbul ignore next */ { | ||
logger.info('We detected that no `prettier-eslint` is installed.'); | ||
logger.info('We will use our internal fallback one instead.'); | ||
logger.info( | ||
'You can install `prettier-eslint` as dependency to skip this message.' | ||
); | ||
|
||
// it is an internal dependency using `prettier-eslint` as fallback | ||
module.exports = require('@prettier/eslint'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters