@twostoryrobot/prettier-config
Advanced tools
Comparing version 4.0.0 to 5.0.0
{ | ||
"name": "@twostoryrobot/prettier-config", | ||
"version": "4.0.0", | ||
"version": "5.0.0", | ||
"description": "Prettier configuration for Two Story Robot", | ||
@@ -11,3 +11,3 @@ "main": "index.js", | ||
"peerDependencies": { | ||
"prettier": "^2.4.1" | ||
"prettier": "^3.2.5" | ||
}, | ||
@@ -14,0 +14,0 @@ "author": "Chad Fawcett <me@chadf.ca>", |
[![npm (scoped)](https://img.shields.io/npm/v/@twostoryrobot/prettier-config.svg)](https://www.npmjs.com/package/@twostoryrobot/prettier-config) | ||
# TSR prettier | ||
# 2SR prettier | ||
Get pretty code with prettier the way Two Story Robot likes it. | ||
@@ -20,18 +19,2 @@ | ||
Or if you want to override the default at all (Note: please consider making a PR | ||
if you think the override will be useful for other projects). | ||
```js | ||
const prettierConfig = require('@twostoryrobot/prettier-config') | ||
module.exports = Object.assign({}, prettierConfig, { semi: true }) | ||
``` | ||
Make sure to install the peer dependencies | ||
```bash | ||
npx install-peerdeps --dev @twostoryrobot/prettier-config | ||
``` | ||
### Scripts | ||
Now you can add a script to your project's package.json that calls prettier and | ||
@@ -42,18 +25,17 @@ it will reference the config file in the root of your project directory. | ||
"scripts": { | ||
"prettier": "prettier --write '**/*.js'" | ||
"prettier": "prettier --write 'src/**/*.js'", | ||
"prettier-check": "prettier --list-different 'src/**/*.js'" | ||
} | ||
``` | ||
### Hooks | ||
## Custom configuration | ||
If you install [husky](https://github.com/typicode/husky) you can invoke | ||
prettier as a hook for various actions (precommit, prepush, etc) | ||
If you want to override the defaults at all, use this method: | ||
```json | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "prettier --list-different '**/*.js'" | ||
} | ||
} | ||
} | ||
```js | ||
const prettierConfig = require('@twostoryrobot/prettier-config') | ||
module.exports = Object.assign({}, prettierConfig, { semi: true }) | ||
``` | ||
_Note: please consider making a PR if you think the override will be useful for | ||
other projects._ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2801
40
2