From 54169e36d6014c558129a83d24a29f57057f04f1 Mon Sep 17 00:00:00 2001 From: d-yokoi Date: Sat, 23 Mar 2019 19:59:31 +0900 Subject: [PATCH] install prettier and add config files --- .prettierignore | 0 .prettierrc.json | 4 ++++ package-lock.json | 6 ++++++ package.json | 4 ++++ 4 files changed, 14 insertions(+) create mode 100644 .prettierignore create mode 100644 .prettierrc.json diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..e69de29 diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000..a20502b --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,4 @@ +{ + "singleQuote": true, + "trailingComma": "all" +} diff --git a/package-lock.json b/package-lock.json index 3c73496..95e652b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2754,6 +2754,12 @@ "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", "dev": true }, + "prettier": { + "version": "1.16.4", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.16.4.tgz", + "integrity": "sha512-ZzWuos7TI5CKUeQAtFd6Zhm2s6EpAD/ZLApIhsF9pRvRtM1RFo61dM/4MSRUA0SuLugA/zgrZD8m0BaY46Og7g==", + "dev": true + }, "process-nextick-args": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", diff --git a/package.json b/package.json index 9245ddb..b7abb88 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,9 @@ "main": "index.js", "scripts": { "coverage": "nyc --branches 100 --functions 100 --check-coverage npm run unit", + "format": "npm run prettier -- --write", + "format:ci": "npm run prettier -- --check", + "prettier": "prettier 'ts_src/**/*.ts' --ignore-path ./.prettierignore", "standard": "standard", "test": "npm run standard && npm run unit", "unit": "tape test/*.js", @@ -33,6 +36,7 @@ "devDependencies": { "node-fetch": "^1.6.3", "nyc": "^13.1.0", + "prettier": "^1.16.4", "proxyquire": "^1.7.10", "standard": "^10.0.2", "tape": "^4.6.2",