From 4e00e6d04f2f9b1e37be741e291f2ed7c60fafd9 Mon Sep 17 00:00:00 2001 From: Simon Lydell Date: Wed, 24 Feb 2021 17:58:06 +0100 Subject: [PATCH] Add dummy legacy configs --- .eslintrc.js | 2 +- scripts/build.js | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/.eslintrc.js b/.eslintrc.js index 2d96178..6a90f58 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -13,7 +13,7 @@ module.exports = { }, overrides: [ { - files: ["{bin,test}/**/*.js"], + files: ["{bin,test,scripts}/**/*.js"], rules: { "no-undef": "error", "no-restricted-syntax": [ diff --git a/scripts/build.js b/scripts/build.js index 44e6970..f691260 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -41,3 +41,25 @@ for (const { src, dest = src, transform } of FILES_TO_COPY) { fs.copyFileSync(path.join(DIR, src), path.join(BUILD, dest)); } } + +const LEGACY_CONFIGS = [ + "@typescript-eslint", + "babel", + "flowtype", + "react", + "standard", + "unicorn", + "vue", +]; + +function legacyConfigStub(name) { + return ` +throw new Error( + '"prettier/${name}" has been merged into "prettier" in eslint-config-prettier 8.0.0. See: https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md#version-800-2021-02-21' +); + `.trim(); +} + +for (const name of LEGACY_CONFIGS) { + fs.writeFileSync(path.join(BUILD, `${name}.js`), legacyConfigStub(name)); +}