Skip to content

Commit

Permalink
fix: add postinstall script for copying .prettierrc to consumer pro…
Browse files Browse the repository at this point in the history
…ject
  • Loading branch information
adrianschmidt committed Oct 31, 2023
1 parent d65896a commit 6481d5f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"main": "index.js",
"scripts": {
"lint": "eslint \"**/*.{ts,tsx,js}\" --max-warnings=0 && prettier -c \"{!(package*).json,.prettierrc}\"",
"lint:fix": "eslint \"**/*.{ts,tsx,js}\" --fix --max-warnings=0 && prettier --write \"{!(package*).json,.prettierrc}\""
"lint:fix": "eslint \"**/*.{ts,tsx,js}\" --fix --max-warnings=0 && prettier --write \"{!(package*).json,.prettierrc}\"",
"postinstall": "node ./post-install.js"
},
"repository": {
"type": "git",
Expand Down
7 changes: 7 additions & 0 deletions post-install.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/* eslint-env node */
const gentlyCopy = require('gently-copy');

const filesToCopy = ['.prettierrc'];
const userPath = process.env.INIT_CWD;

gentlyCopy(filesToCopy, userPath);

0 comments on commit 6481d5f

Please sign in to comment.