From 0ee0c6f4b3bc81a612085b1318d7e7001baf30fb Mon Sep 17 00:00:00 2001 From: evilebottnawi Date: Fri, 26 Apr 2019 17:27:17 +0300 Subject: [PATCH] chore(defaults): update --- .github/ISSUE_TEMPLATE/BUG.md | 2 +- .prettierrc.js | 5 +++ babel.config.js | 19 +++++++++++ commitlint.config.js | 3 ++ husky.config.js | 6 ++++ lint-staged.config.js | 6 ++++ package-lock.json | 63 ++++++++++++++++++++++------------- package.json | 40 ++-------------------- 8 files changed, 82 insertions(+), 62 deletions(-) create mode 100644 .prettierrc.js create mode 100644 babel.config.js create mode 100644 commitlint.config.js create mode 100644 husky.config.js create mode 100644 lint-staged.config.js diff --git a/.github/ISSUE_TEMPLATE/BUG.md b/.github/ISSUE_TEMPLATE/BUG.md index 03e2b302..02f70e98 100644 --- a/.github/ISSUE_TEMPLATE/BUG.md +++ b/.github/ISSUE_TEMPLATE/BUG.md @@ -33,7 +33,7 @@ about: Something went awry and you'd like to tell us about it. ```js // webpack.config.js - // If your bitchin' code blocks are over 20 lines, please paste a link to a gist + // If your code blocks are over 20 lines, please paste a link to a gist // (https://gist.github.com). ``` diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 00000000..1934550a --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,5 @@ +module.exports = { + singleQuote: true, + trailingComma: 'es5', + arrowParens: 'always', +}; diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 00000000..4c9ccbc8 --- /dev/null +++ b/babel.config.js @@ -0,0 +1,19 @@ +const MIN_BABEL_VERSION = 7; + +module.exports = (api) => { + api.assertVersion(MIN_BABEL_VERSION); + api.cache(true); + + return { + presets: [ + [ + '@babel/preset-env', + { + targets: { + node: '6.9.0', + }, + }, + ], + ], + }; +}; diff --git a/commitlint.config.js b/commitlint.config.js new file mode 100644 index 00000000..84dcb122 --- /dev/null +++ b/commitlint.config.js @@ -0,0 +1,3 @@ +module.exports = { + extends: ['@commitlint/config-conventional'], +}; diff --git a/husky.config.js b/husky.config.js new file mode 100644 index 00000000..4c2ec3ae --- /dev/null +++ b/husky.config.js @@ -0,0 +1,6 @@ +module.exports = { + hooks: { + 'pre-commit': 'lint-staged', + 'commit-msg': 'commitlint -E HUSKY_GIT_PARAMS', + }, +}; diff --git a/lint-staged.config.js b/lint-staged.config.js new file mode 100644 index 00000000..10576d8d --- /dev/null +++ b/lint-staged.config.js @@ -0,0 +1,6 @@ +module.exports = { + ignore: ['package-lock.json'], + linters: { + '*.js': ['eslint --fix', 'git add'], + }, +}; diff --git a/package-lock.json b/package-lock.json index bd93faac..9f6ffeb5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1304,9 +1304,15 @@ } }, "@types/istanbul-lib-coverage": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.0.tgz", - "integrity": "sha512-eAtOAFZefEnfJiRFQBGw1eYqa5GTLCZ1y86N0XSI/D6EB+E8z6VPV/UL7Gi5UEclFqoQk+6NRqEDsfmDLXn8sg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz", + "integrity": "sha512-hRJD2ahnnpLgsj6KWMYSrmXkM3rm2Dl1qkx6IOFD5FnuNPXJIG5L0dhgKXCYTRMGzU4n0wImQ/xfmRc4POUFlg==", + "dev": true + }, + "@types/normalize-package-data": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==", "dev": true }, "@types/stack-utils": { @@ -1498,15 +1504,17 @@ } }, "@webpack-contrib/defaults": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@webpack-contrib/defaults/-/defaults-3.1.2.tgz", - "integrity": "sha512-deEq3YaVmhov0nJjpZzyURau3Plixy5RgwXc9f9kJb58TF9fj2jQo0FHibn5k/M9DpzTO3+4ezYo5KV1VuGuAQ==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@webpack-contrib/defaults/-/defaults-4.0.1.tgz", + "integrity": "sha512-dZibEgansCUXiiXbkpFypjFqa89eOIjKmRo8KaqF++nyFNRmfIBC4nS3z8uihGyu+EYEUdcFGNjUBKuJjzwQPA==", "dev": true, "requires": { "chalk": "^2.3.0", "git-username": "^1.0.0", + "loader-utils": "^1.2.3", "mrm-core": "^3.1.1", "path-exists": "^3.0.0", + "schema-utils": "^1.0.0", "user-meta": "^1.0.0" } }, @@ -6506,19 +6514,19 @@ "dev": true }, "husky": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/husky/-/husky-1.3.1.tgz", - "integrity": "sha512-86U6sVVVf4b5NYSZ0yvv88dRgBSSXXmHaiq5pP4KDj5JVzdwKgBjEtUPOm8hcoytezFwbU+7gotXNhpHdystlg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/husky/-/husky-2.1.0.tgz", + "integrity": "sha512-FHsqdIJPmQX/89Xg/761RMFCPSNNG2eiQMxChGP081NTohHexEuu/4nYh5m4TcFKq4xm+DqaGp8J/EUnkzL1Aw==", "dev": true, "requires": { - "cosmiconfig": "^5.0.7", + "cosmiconfig": "^5.2.0", "execa": "^1.0.0", "find-up": "^3.0.0", - "get-stdin": "^6.0.0", + "get-stdin": "^7.0.0", "is-ci": "^2.0.0", - "pkg-dir": "^3.0.0", + "pkg-dir": "^4.1.0", "please-upgrade-node": "^3.1.1", - "read-pkg": "^4.0.1", + "read-pkg": "^5.0.0", "run-node": "^1.0.0", "slash": "^2.0.0" }, @@ -6545,9 +6553,9 @@ } }, "get-stdin": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", - "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-7.0.0.tgz", + "integrity": "sha512-zRKcywvrXlXsA0v0i9Io4KDRaAw7+a1ZpjRwl9Wox8PFlVCCHra7E9c4kqXCoCM9nR5tBkaTTZRBoCm60bFqTQ==", "dev": true }, "import-fresh": { @@ -6595,23 +6603,24 @@ "dev": true }, "pkg-dir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", - "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.1.0.tgz", + "integrity": "sha512-55k9QN4saZ8q518lE6EFgYiu95u3BWkSajCifhdQjvLvmr8IpnRbhI+UGpWJQfa0KzDguHeeWT1ccO1PmkOi3A==", "dev": true, "requires": { "find-up": "^3.0.0" } }, "read-pkg": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-4.0.1.tgz", - "integrity": "sha1-ljYlN48+HE1IyFhytabsfV0JMjc=", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.1.0.tgz", + "integrity": "sha512-NjNkqf8hlMuSxh+p8h8x8sCIfEv/MoRs/nYDmSRSAk879F9C94ADq+kHUJ4LTy5Nn0PYSmMYsy1mD4+lcXiBKg==", "dev": true, "requires": { - "normalize-package-data": "^2.3.2", + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^2.5.0", "parse-json": "^4.0.0", - "pify": "^3.0.0" + "type-fest": "^0.4.1" } }, "resolve-from": { @@ -12033,6 +12042,12 @@ "prelude-ls": "~1.1.2" } }, + "type-fest": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.4.1.tgz", + "integrity": "sha512-IwzA/LSfD2vC1/YDYMv/zHP4rDF1usCwllsDpbolT3D4fUepIO7f9K70jjmUewU/LmGUKJcwcVtDCpnKk4BPMw==", + "dev": true + }, "typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", diff --git a/package.json b/package.json index f847f16f..8b432a7c 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "@babel/preset-env": "^7.1.6", "@commitlint/cli": "^7.2.1", "@commitlint/config-conventional": "^7.1.2", - "@webpack-contrib/defaults": "^3.0.0", + "@webpack-contrib/defaults": "^4.0.1", "@webpack-contrib/eslint-config-webpack": "^3.0.0", "babel-jest": "^24.1.0", "cross-env": "^5.2.0", @@ -70,7 +70,7 @@ "eslint-plugin-import": "^2.14.0", "eslint-plugin-prettier": "^3.0.0", "file-loader": "^3.0.1", - "husky": "^1.2.0", + "husky": "^2.1.0", "jest": "^24.1.0", "jest-junit": "^6.3.0", "lint-staged": "^8.1.0", @@ -90,39 +90,5 @@ "loader", "url", "import" - ], - "babel": { - "presets": [ - [ - "@babel/preset-env", - { - "targets": { - "node": "6.9.0" - } - } - ] - ] - }, - "husky": { - "hooks": { - "pre-commit": "lint-staged", - "commit-msg": "commitlint -E HUSKY_GIT_PARAMS" - } - }, - "lint-staged": { - "*.js": [ - "eslint --fix", - "git add" - ] - }, - "commitlint": { - "extends": [ - "@commitlint/config-conventional" - ] - }, - "prettier": { - "singleQuote": true, - "trailingComma": "es5", - "arrowParens": "always" - } + ] }