From a89ba5dee7ece0826421b39988f998d99d63ff3a Mon Sep 17 00:00:00 2001 From: Masafumi Koba <473530+ybiquitous@users.noreply.github.com> Date: Sun, 18 Nov 2018 07:44:58 -0800 Subject: [PATCH] feat(prettier): extend Prettier target files (#273) BREAKING CHANGE: `lint:md:fix` was replaced with `prettier:write` --- package.json | 10 ++++------ test/fixtures/package-empty_expected.json | 6 +++--- test/fixtures/package-normal_expected.json | 6 +++--- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index c871f9a4..30c2fe01 100644 --- a/package.json +++ b/package.json @@ -46,13 +46,13 @@ }, "scripts": { "test": "nyc --check-coverage --lines 100 --branches 90 tape \"test/**/*.test.js\"", - "test:watch": "nodemon --ext js --watch . --exec \"tape test/**/*.test.js\"", + "test:watch": "nodemon --ext js,json --watch . --exec \"tape test/**/*.test.js\"", "test:coverage": "nyc report --reporter=text-lcov > coverage.lcov", "lint:js": "eslint --ignore-path .gitignore --ext .js,.jsx,.mjs .", "lint:js:fix": "npm run lint:js -- --fix", "lint:md": "markdownlint --ignore node_modules --ignore CHANGELOG.md \"**/*.md\"", - "lint:md:fix": "prettier --write \"**/*.md\"", "lint": "npm-run-all --print-label --parallel lint:*", + "prettier:write": "prettier --write --ignore-path .gitignore \"**/*.{html,json,md,yaml,yml}\"", "release": "standard-version --sign", "release:dry-run": "npm run release -- --dry-run" }, @@ -69,11 +69,9 @@ "git add" ], "*.md": [ - "prettier --write", - "markdownlint", - "git add" + "markdownlint" ], - "*.{yml,yaml,json}": [ + "*.{html,json,md,yaml,yml}": [ "prettier --write", "git add" ] diff --git a/test/fixtures/package-empty_expected.json b/test/fixtures/package-empty_expected.json index 7e2fad7a..b04a0d1e 100644 --- a/test/fixtures/package-empty_expected.json +++ b/test/fixtures/package-empty_expected.json @@ -6,8 +6,8 @@ "lint:js": "eslint --ignore-path .gitignore --ext .js,.jsx,.mjs .", "lint:js:fix": "npm run lint:js -- --fix", "lint:md": "markdownlint --ignore node_modules --ignore CHANGELOG.md \"**/*.md\"", - "lint:md:fix": "prettier --write \"**/*.md\"", "lint": "npm-run-all --print-label --parallel lint:*", + "prettier:write": "prettier --write --ignore-path .gitignore \"**/*.{html,json,md,yaml,yml}\"", "release": "standard-version --sign", "release:dry-run": "npm run release -- --dry-run" }, @@ -20,8 +20,8 @@ "lint-staged": { "linters": { "*.{js,jsx,mjs}": ["eslint --fix --no-ignore", "git add"], - "*.md": ["prettier --write", "markdownlint", "git add"], - "*.{yml,yaml,json}": ["prettier --write", "git add"] + "*.md": ["markdownlint"], + "*.{html,json,md,yaml,yml}": ["prettier --write", "git add"] }, "ignore": ["CHANGELOG.md"] } diff --git a/test/fixtures/package-normal_expected.json b/test/fixtures/package-normal_expected.json index 0bb21e8f..fbf66afd 100644 --- a/test/fixtures/package-normal_expected.json +++ b/test/fixtures/package-normal_expected.json @@ -6,8 +6,8 @@ "test:coverage": "echo \"unsupported.\" && exit 1", "lint:js:fix": "npm run lint:js -- --fix", "lint:md": "markdownlint --ignore node_modules --ignore CHANGELOG.md \"**/*.md\"", - "lint:md:fix": "prettier --write \"**/*.md\"", "lint": "npm-run-all --print-label --parallel lint:*", + "prettier:write": "prettier --write --ignore-path .gitignore \"**/*.{html,json,md,yaml,yml}\"", "release": "standard-version --sign", "release:dry-run": "npm run release -- --dry-run" }, @@ -21,8 +21,8 @@ "*.css": "xyz", "linters": { "*.{js,jsx,mjs}": ["eslint --fix --no-ignore", "git add"], - "*.md": ["prettier --write", "markdownlint", "git add"], - "*.{yml,yaml,json}": ["prettier --write", "git add"] + "*.md": ["markdownlint"], + "*.{html,json,md,yaml,yml}": ["prettier --write", "git add"] }, "ignore": ["CHANGELOG.md"] }