Skip to content

Commit 7e7e990

Browse files
committed
Add prettier to flavor
1 parent e421311 commit 7e7e990

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

package.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44
"description": "create-cycle-one-fits-all flavor",
55
"main": "index.js",
66
"lint-staged": {
7-
"./**/*.{js,jsx,ts,tsx}": [
8-
"npm run format",
9-
"git add"
10-
]
7+
"./**/*.{js,jsx,jsx,ts,tsx}": ["npm run format", "git add"]
118
},
129
"scripts": {
1310
"precommit": "lint-staged",
@@ -19,9 +16,7 @@
1916
"url": "git+https://github.com/cyclejs-community/create-cycle-app-flavors.git"
2017
},
2118
"author": "Jan van Brügge <supermantiu@gmail.com>",
22-
"contributors": [
23-
"Steve Lee <steve@opendirective.com>"
24-
],
19+
"contributors": ["Steve Lee <steve@opendirective.com>"],
2520
"license": "MIT",
2621
"bugs": {
2722
"url": "https://github.com/cyclejs-community/create-cycle-app-flavors/issues"

scripts/init.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,19 @@ module.exports = function init(appPath, appName, verbose, originalDirectory) {
9797
appPackage.dependencies = appPackage.dependencies || {};
9898
appPackage.devDependencies = appPackage.devDependencies || {};
9999
appPackage.scripts = {
100+
precommit: 'lint-staged',
101+
format:
102+
"prettier --tab-width 4 --single-quote --write './**/*.{js,jsx,ts,tsx}'",
100103
start: 'cycle-scripts start',
101104
test: 'cycle-scripts test',
102105
build: 'cycle-scripts build',
103106
eject: 'cycle-scripts eject',
104107
clean: 'cycle-scripts clean'
105108
};
106109

110+
appPackage.lintStaged = {
111+
'./**/*.{js,jsx,ts,tsx}': ['npm run format', 'git add']
112+
};
107113
appPackage.nyc = {
108114
instrument: false,
109115
sourceMap: false,

0 commit comments

Comments
 (0)