diff --git a/.editorconfig b/.editorconfig index 0e00241..a6efbd9 100644 --- a/.editorconfig +++ b/.editorconfig @@ -10,6 +10,7 @@ indent_size = 2 indent_style = space insert_final_newline = true trim_trailing_whitespace = true +max_line_length = 120 [*.md] max_line_length = off diff --git a/packages/browserslist-config/package.json b/packages/browserslist-config/package.json index 1aed7bf..95fe83e 100644 --- a/packages/browserslist-config/package.json +++ b/packages/browserslist-config/package.json @@ -36,6 +36,7 @@ "postinstall": "node scripts/postinstall.js" }, "dependencies": { + "@ivuorinen/config-checker": "^1.1.0", "browserslist": "4.22.1" }, "gitHead": "23d15f15743fb59c1dbe658615ef2ed51c54d230" diff --git a/packages/browserslist-config/scripts/postinstall.js b/packages/browserslist-config/scripts/postinstall.js index c3f9887..0682f7d 100644 --- a/packages/browserslist-config/scripts/postinstall.js +++ b/packages/browserslist-config/scripts/postinstall.js @@ -2,9 +2,18 @@ const fs = require('fs') const path = require('path') +const process = require('process') +const checkConfig = require('@ivuorinen/config-checker') +const foundConfig = checkConfig('browserslist') + +if (foundConfig.length > 0) { + console.log('browserslist-config: Found existing browserslist config file, skipping creation.') + console.log('browserslist-config: If you want to create a new config file, please remove the existing one.') + console.log(`browserslist-config: Found config files at: ${foundConfig.join(', ')}`) + process.exit(0) +} const filePath = path.join(process.env.INIT_CWD, '.browserslistrc') - const fileConfigObject = 'extends @ivuorinen/browserslist-config' if (!fs.existsSync(filePath)) { diff --git a/packages/browserslist-config/yarn.lock b/packages/browserslist-config/yarn.lock index 7d3a6e7..f2b3188 100644 --- a/packages/browserslist-config/yarn.lock +++ b/packages/browserslist-config/yarn.lock @@ -2,6 +2,11 @@ # yarn lockfile v1 +"@ivuorinen/config-checker@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@ivuorinen/config-checker/-/config-checker-1.1.0.tgz#73a996445a917627cb558ea69f616978ff97da9d" + integrity sha512-YHQSF2yt4YZM0W9jdFXdPUB4X1AicweDJWSJtFw58GVI4+wI8+CJtoKL/Dmbn8F3B6H6gngQHwzENqw80Zsskg== + browserslist@4.22.1: version "4.22.1" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.22.1.tgz#ba91958d1a59b87dab6fed8dfbcb3da5e2e9c619" diff --git a/packages/commitlint-config/package.json b/packages/commitlint-config/package.json index bc5896c..653a8b3 100644 --- a/packages/commitlint-config/package.json +++ b/packages/commitlint-config/package.json @@ -36,7 +36,8 @@ }, "dependencies": { "@commitlint/cli": "18.0.0", - "@commitlint/config-conventional": "18.0.0" + "@commitlint/config-conventional": "18.0.0", + "@ivuorinen/config-checker": "^1.1.0" }, "gitHead": "23d15f15743fb59c1dbe658615ef2ed51c54d230" } diff --git a/packages/commitlint-config/scripts/postinstall.js b/packages/commitlint-config/scripts/postinstall.js index eb60409..288c779 100644 --- a/packages/commitlint-config/scripts/postinstall.js +++ b/packages/commitlint-config/scripts/postinstall.js @@ -2,9 +2,18 @@ const fs = require('fs') const path = require('path') +const process = require('process') +const checkConfig = require('@ivuorinen/config-checker') +const foundConfig = checkConfig('commitlint') + +if (foundConfig.length > 0) { + console.log('commitlint-config: Found existing commitlint config file, skipping creation.') + console.log('commitlint-config: If you want to create a new config file, please remove the existing one.') + console.log(`commitlint-config: Found config files at: ${foundConfig.join(', ')}`) + process.exit(0) +} const filePath = path.join(process.env.INIT_CWD, '.commitlintrc.json') - const fileConfigObject = { extends: ['@ivuorinen/commitlint-config'] } diff --git a/packages/commitlint-config/yarn.lock b/packages/commitlint-config/yarn.lock index 9708c4c..3f36b6a 100644 --- a/packages/commitlint-config/yarn.lock +++ b/packages/commitlint-config/yarn.lock @@ -192,6 +192,11 @@ dependencies: "@jridgewell/trace-mapping" "0.3.9" +"@ivuorinen/config-checker@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@ivuorinen/config-checker/-/config-checker-1.1.0.tgz#73a996445a917627cb558ea69f616978ff97da9d" + integrity sha512-YHQSF2yt4YZM0W9jdFXdPUB4X1AicweDJWSJtFw58GVI4+wI8+CJtoKL/Dmbn8F3B6H6gngQHwzENqw80Zsskg== + "@jridgewell/resolve-uri@^3.0.3": version "3.1.1" resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz#c08679063f279615a3326583ba3a90d1d82cc721" diff --git a/packages/eslint-config/package.json b/packages/eslint-config/package.json index 34f86e2..1a45fa8 100644 --- a/packages/eslint-config/package.json +++ b/packages/eslint-config/package.json @@ -36,6 +36,7 @@ "postinstall": "node scripts/postinstall.js" }, "dependencies": { + "@ivuorinen/config-checker": "^1.1.0", "eslint": "8.52.0", "eslint-config-standard": "17.1.0", "eslint-plugin-import": "2.28.1", diff --git a/packages/eslint-config/scripts/postinstall.js b/packages/eslint-config/scripts/postinstall.js index f0e4c72..abc3e24 100644 --- a/packages/eslint-config/scripts/postinstall.js +++ b/packages/eslint-config/scripts/postinstall.js @@ -2,9 +2,18 @@ const fs = require('fs') const path = require('path') +const process = require('process') +const checkConfig = require('@ivuorinen/config-checker') +const foundConfig = checkConfig('eslint') + +if (foundConfig.length > 0) { + console.log('eslint-config: Found existing eslint config file, skipping creation.') + console.log('eslint-config: If you want to create a new config file, please remove the existing one.') + console.log(`eslint-config: Found config files at: ${foundConfig.join(', ')}`) + process.exit(0) +} const filePath = path.join(process.env.INIT_CWD, '.eslintrc.json') - const fileConfigObject = { extends: ['@ivuorinen'] } diff --git a/packages/eslint-config/yarn.lock b/packages/eslint-config/yarn.lock index fd4eabe..d4b2c1a 100644 --- a/packages/eslint-config/yarn.lock +++ b/packages/eslint-config/yarn.lock @@ -58,6 +58,11 @@ resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-2.0.1.tgz#e5211452df060fa8522b55c7b3c0c4d1981cb044" integrity sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw== +"@ivuorinen/config-checker@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@ivuorinen/config-checker/-/config-checker-1.1.0.tgz#73a996445a917627cb558ea69f616978ff97da9d" + integrity sha512-YHQSF2yt4YZM0W9jdFXdPUB4X1AicweDJWSJtFw58GVI4+wI8+CJtoKL/Dmbn8F3B6H6gngQHwzENqw80Zsskg== + "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" diff --git a/packages/markdownlint-config/package.json b/packages/markdownlint-config/package.json index 74b9bbd..6c5d601 100644 --- a/packages/markdownlint-config/package.json +++ b/packages/markdownlint-config/package.json @@ -36,6 +36,7 @@ "postinstall": "node scripts/postinstall.js" }, "dependencies": { + "@ivuorinen/config-checker": "^1.1.0", "markdownlint-cli": "0.37.0" }, "gitHead": "23d15f15743fb59c1dbe658615ef2ed51c54d230" diff --git a/packages/markdownlint-config/scripts/postinstall.js b/packages/markdownlint-config/scripts/postinstall.js index 3d21851..aded3b8 100644 --- a/packages/markdownlint-config/scripts/postinstall.js +++ b/packages/markdownlint-config/scripts/postinstall.js @@ -2,9 +2,18 @@ const fs = require('fs') const path = require('path') +const process = require('process') +const checkConfig = require('@ivuorinen/config-checker') +const foundConfig = checkConfig('markdownlint') + +if (foundConfig.length > 0) { + console.log('markdownlint-config: Found existing markdownlint config file, skipping creation.') + console.log('markdownlint-config: If you want to create a new config file, please remove the existing one.') + console.log(`markdownlint-config: Found config files at: ${foundConfig.join(', ')}`) + process.exit(0) +} const filePath = path.join(process.env.INIT_CWD, '.markdownlint.json') - const fileConfigObject = { extends: '@ivuorinen/markdownlint-config' } diff --git a/packages/markdownlint-config/yarn.lock b/packages/markdownlint-config/yarn.lock index 9f96e76..66dfa83 100644 --- a/packages/markdownlint-config/yarn.lock +++ b/packages/markdownlint-config/yarn.lock @@ -14,6 +14,11 @@ wrap-ansi "^8.1.0" wrap-ansi-cjs "npm:wrap-ansi@^7.0.0" +"@ivuorinen/config-checker@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@ivuorinen/config-checker/-/config-checker-1.1.0.tgz#73a996445a917627cb558ea69f616978ff97da9d" + integrity sha512-YHQSF2yt4YZM0W9jdFXdPUB4X1AicweDJWSJtFw58GVI4+wI8+CJtoKL/Dmbn8F3B6H6gngQHwzENqw80Zsskg== + "@pkgjs/parseargs@^0.11.0": version "0.11.0" resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" diff --git a/packages/prettier-config/package.json b/packages/prettier-config/package.json index 81ae2ba..3e623fd 100644 --- a/packages/prettier-config/package.json +++ b/packages/prettier-config/package.json @@ -36,6 +36,7 @@ "postinstall": "node scripts/postinstall.js" }, "dependencies": { + "@ivuorinen/config-checker": "^1.1.0", "prettier": "2.8.8" }, "gitHead": "23d15f15743fb59c1dbe658615ef2ed51c54d230" diff --git a/packages/prettier-config/scripts/postinstall.js b/packages/prettier-config/scripts/postinstall.js index 9468418..f12c9fe 100644 --- a/packages/prettier-config/scripts/postinstall.js +++ b/packages/prettier-config/scripts/postinstall.js @@ -2,9 +2,18 @@ const fs = require('fs') const path = require('path') +const process = require('process') +const checkConfig = require('@ivuorinen/config-checker') +const foundConfig = checkConfig('prettier') + +if (foundConfig.length > 0) { + console.log('prettier-config: Found existing prettier config file, skipping creation.') + console.log('prettier-config: If you want to create a new config file, please remove the existing one.') + console.log(`prettier-config: Found config files at: ${foundConfig.join(', ')}`) + process.exit(0) +} const filePath = path.join(process.env.INIT_CWD, '.prettierrc.json') - const fileConfigObject = '@ivuorinen/prettier-config' if (!fs.existsSync(filePath)) { diff --git a/packages/prettier-config/yarn.lock b/packages/prettier-config/yarn.lock index 7c65ca6..dcb5736 100644 --- a/packages/prettier-config/yarn.lock +++ b/packages/prettier-config/yarn.lock @@ -2,6 +2,11 @@ # yarn lockfile v1 +"@ivuorinen/config-checker@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@ivuorinen/config-checker/-/config-checker-1.1.0.tgz#73a996445a917627cb558ea69f616978ff97da9d" + integrity sha512-YHQSF2yt4YZM0W9jdFXdPUB4X1AicweDJWSJtFw58GVI4+wI8+CJtoKL/Dmbn8F3B6H6gngQHwzENqw80Zsskg== + prettier@2.8.8: version "2.8.8" resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da" diff --git a/packages/semantic-release-config/package.json b/packages/semantic-release-config/package.json index ba2b714..324d073 100644 --- a/packages/semantic-release-config/package.json +++ b/packages/semantic-release-config/package.json @@ -36,6 +36,7 @@ "postinstall": "node scripts/postinstall.js" }, "dependencies": { + "@ivuorinen/config-checker": "^1.1.0", "@semantic-release/changelog": "6.0.3", "@semantic-release/git": "10.0.1", "semantic-release": "22.0.5" diff --git a/packages/semantic-release-config/scripts/postinstall.js b/packages/semantic-release-config/scripts/postinstall.js index f2b122d..a1b2347 100644 --- a/packages/semantic-release-config/scripts/postinstall.js +++ b/packages/semantic-release-config/scripts/postinstall.js @@ -2,9 +2,18 @@ const fs = require('fs') const path = require('path') +const process = require('process') +const checkConfig = require('@ivuorinen/config-checker') +const foundConfig = checkConfig('release') + +if (foundConfig.length > 0) { + console.log('semantic-release-config: Found existing semantic-release config file, skipping creation.') + console.log('semantic-release-config: If you want to create a new config file, please remove the existing one.') + console.log(`semantic-release-config: Found config files at: ${foundConfig.join(', ')}`) + process.exit(0) +} const filePath = path.join(process.env.INIT_CWD, '.releaserc.json') - const fileConfigObject = { extends: ['@ivuorinen/semantic-release-config'] } diff --git a/packages/semantic-release-config/yarn.lock b/packages/semantic-release-config/yarn.lock index 57eca8e..832f5d7 100644 --- a/packages/semantic-release-config/yarn.lock +++ b/packages/semantic-release-config/yarn.lock @@ -46,6 +46,11 @@ resolved "https://registry.yarnpkg.com/@isaacs/string-locale-compare/-/string-locale-compare-1.1.0.tgz#291c227e93fd407a96ecd59879a35809120e432b" integrity sha512-SQ7Kzhh9+D+ZW9MA0zkYv3VXhIDNx+LzM6EJ+/65I3QY+enU6Itte7E5XX7EWrqLW2FN4n06GWzBnPoC3th2aQ== +"@ivuorinen/config-checker@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@ivuorinen/config-checker/-/config-checker-1.1.0.tgz#73a996445a917627cb558ea69f616978ff97da9d" + integrity sha512-YHQSF2yt4YZM0W9jdFXdPUB4X1AicweDJWSJtFw58GVI4+wI8+CJtoKL/Dmbn8F3B6H6gngQHwzENqw80Zsskg== + "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" diff --git a/packages/stylelint-config/package.json b/packages/stylelint-config/package.json index fb1008f..b596484 100644 --- a/packages/stylelint-config/package.json +++ b/packages/stylelint-config/package.json @@ -37,6 +37,7 @@ "postinstall": "node scripts/postinstall.js" }, "dependencies": { + "@ivuorinen/config-checker": "^1.1.0", "postcss": "^8.4.2", "stylelint": "15.11.0", "stylelint-config-recommended-scss": "13.0.0", diff --git a/packages/stylelint-config/scripts/postinstall.js b/packages/stylelint-config/scripts/postinstall.js index 48ff2a8..cc36559 100644 --- a/packages/stylelint-config/scripts/postinstall.js +++ b/packages/stylelint-config/scripts/postinstall.js @@ -2,9 +2,18 @@ const fs = require('fs') const path = require('path') +const process = require('process') +const checkConfig = require('@ivuorinen/config-checker') +const foundConfig = checkConfig('stylelint') + +if (foundConfig.length > 0) { + console.log('stylelint-config: Found existing stylelint config file, skipping creation.') + console.log('stylelint-config: If you want to create a new config file, please remove the existing one.') + console.log(`stylelint-config: Found config files at: ${foundConfig.join(', ')}`) + process.exit(0) +} const filePath = path.join(process.env.INIT_CWD, '.stylelintrc.json') - const fileConfigObject = { extends: ['@ivuorinen/stylelint-config/css'] } diff --git a/packages/stylelint-config/yarn.lock b/packages/stylelint-config/yarn.lock index f43a774..97b7fe1 100644 --- a/packages/stylelint-config/yarn.lock +++ b/packages/stylelint-config/yarn.lock @@ -44,6 +44,11 @@ resolved "https://registry.yarnpkg.com/@csstools/selector-specificity/-/selector-specificity-3.0.0.tgz#798622546b63847e82389e473fd67f2707d82247" integrity sha512-hBI9tfBtuPIi885ZsZ32IMEU/5nlZH/KOVYJCOh7gyMxaVLGmLedYqFN6Ui1LXkI8JlC8IsuC0rF0btcRZKd5g== +"@ivuorinen/config-checker@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@ivuorinen/config-checker/-/config-checker-1.1.0.tgz#73a996445a917627cb558ea69f616978ff97da9d" + integrity sha512-YHQSF2yt4YZM0W9jdFXdPUB4X1AicweDJWSJtFw58GVI4+wI8+CJtoKL/Dmbn8F3B6H6gngQHwzENqw80Zsskg== + "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5"