From b65ffc6655411d53d089fdf2809cfed8c5ab5636 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Connor=20B=C3=A4r?= Date: Tue, 23 Jan 2024 11:00:42 +0000 Subject: [PATCH 1/7] Remove framework plugins from dependencies --- package-lock.json | 711 +--------------------------------------------- package.json | 7 - 2 files changed, 4 insertions(+), 714 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3e243a98..7e0b7456 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,17 +1,16 @@ { "name": "@sumup/foundry", - "version": "7.0.0-next.0", + "version": "7.0.0-next.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@sumup/foundry", - "version": "7.0.0-next.0", + "version": "7.0.0-next.1", "license": "Apache-2.0", "dependencies": { "@babel/core": "^7.23.5", "@babel/eslint-parser": "^7.23.3", - "@emotion/eslint-plugin": "^11.11.0", "@typescript-eslint/eslint-plugin": "^6.13.1", "@typescript-eslint/parser": "^6.13.1", "chalk": "^4.1.2", @@ -20,23 +19,17 @@ "eslint": "^8.54.0", "eslint-config-airbnb-base": "^15.0.0", "eslint-config-airbnb-typescript": "^17.1.0", - "eslint-config-next": "^14.0.3", "eslint-config-prettier": "^9.0.0", "eslint-plugin-compat": "^4.2.0", - "eslint-plugin-cypress": "^2.15.1", "eslint-plugin-import": "^2.29.0", - "eslint-plugin-jest": "^27.6.0", "eslint-plugin-json": "^3.1.0", "eslint-plugin-jsx-a11y": "^6.8.0", "eslint-plugin-node": "^11.1.0", "eslint-plugin-notice": "^0.9.10", - "eslint-plugin-playwright": "^0.19.0", "eslint-plugin-prettier": "^5.0.1", "eslint-plugin-react": "^7.33.2", "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-security": "^1.7.1", - "eslint-plugin-storybook": "^0.6.15", - "eslint-plugin-testing-library": "^6.2.0", "husky": "^4.3.8", "inquirer": "^8.2.6", "is-ci": "^3.0.1", @@ -1218,17 +1211,6 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, - "node_modules/@emotion/eslint-plugin": { - "version": "11.11.0", - "resolved": "https://registry.npmjs.org/@emotion/eslint-plugin/-/eslint-plugin-11.11.0.tgz", - "integrity": "sha512-jCOYqU/0Sqm+g+6D7QuIlG99q8YAF0T7BP98zQF/MPZKfbcm46z5mizXn0YlhZ9AYZfNtZ1DeODXdncYxZzR4Q==", - "engines": { - "node": ">=6" - }, - "peerDependencies": { - "eslint": "6 || 7 || 8" - } - }, "node_modules/@esbuild/android-arm": { "version": "0.19.8", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.8.tgz", @@ -1940,14 +1922,6 @@ "resolved": "https://registry.npmjs.org/@mdn/browser-compat-data/-/browser-compat-data-5.4.2.tgz", "integrity": "sha512-KuBlKNjbZyU3jCTNGsJl+accdAZRUVVyMBeIXAUT+oMUQ64Uq2mxKajzonFJOXkhaAvTac+sDtJSLhaOzKIo2Q==" }, - "node_modules/@next/eslint-plugin-next": { - "version": "14.0.3", - "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-14.0.3.tgz", - "integrity": "sha512-j4K0n+DcmQYCVnSAM+UByTVfIHnYQy2ODozfQP+4RdwtRDfobrIvKq1K4Exb2koJ79HSSa7s6B2SA8T/1YR3RA==", - "dependencies": { - "glob": "7.1.7" - } - }, "node_modules/@nicolo-ribaudo/eslint-scope-5-internals": { "version": "5.1.1-v1", "resolved": "https://registry.npmjs.org/@nicolo-ribaudo/eslint-scope-5-internals/-/eslint-scope-5-internals-5.1.1-v1.tgz", @@ -2173,11 +2147,6 @@ "win32" ] }, - "node_modules/@rushstack/eslint-patch": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.6.0.tgz", - "integrity": "sha512-2/U3GXA6YiPYQDLGwtGlnNgKYBSwCFIHf8Y9LUY5VATHdtbLlU0Y1R3QoBnT0aB4qv/BEiVVsj7LJXoQCgJ2vA==" - }, "node_modules/@samverschueren/stream-to-observable": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.1.tgz", @@ -2203,14 +2172,6 @@ "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", "dev": true }, - "node_modules/@storybook/csf": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/@storybook/csf/-/csf-0.0.1.tgz", - "integrity": "sha512-USTLkZze5gkel8MYCujSRBVIrUQ3YPBrLOx7GNk/0wttvVtlzWXAq9eLbQ4p/NicGxP+3T7KPEMVV//g+yubpw==", - "dependencies": { - "lodash": "^4.17.15" - } - }, "node_modules/@tootallnate/once": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", @@ -4043,18 +4004,6 @@ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" }, - "node_modules/enhanced-resolve": { - "version": "5.15.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.15.0.tgz", - "integrity": "sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg==", - "dependencies": { - "graceful-fs": "^4.2.4", - "tapable": "^2.2.0" - }, - "engines": { - "node": ">=10.13.0" - } - }, "node_modules/enquirer": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.4.1.tgz", @@ -4328,31 +4277,6 @@ "eslint-plugin-import": "^2.25.3" } }, - "node_modules/eslint-config-next": { - "version": "14.0.3", - "resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-14.0.3.tgz", - "integrity": "sha512-IKPhpLdpSUyKofmsXUfrvBC49JMUTdeaD8ZIH4v9Vk0sC1X6URTuTJCLtA0Vwuj7V/CQh0oISuSTvNn5//Buew==", - "dependencies": { - "@next/eslint-plugin-next": "14.0.3", - "@rushstack/eslint-patch": "^1.3.3", - "@typescript-eslint/parser": "^5.4.2 || ^6.0.0", - "eslint-import-resolver-node": "^0.3.6", - "eslint-import-resolver-typescript": "^3.5.2", - "eslint-plugin-import": "^2.28.1", - "eslint-plugin-jsx-a11y": "^6.7.1", - "eslint-plugin-react": "^7.33.2", - "eslint-plugin-react-hooks": "^4.5.0 || 5.0.0-canary-7118f5dd7-20230705" - }, - "peerDependencies": { - "eslint": "^7.23.0 || ^8.0.0", - "typescript": ">=3.3.1" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, "node_modules/eslint-config-prettier": { "version": "9.0.0", "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.0.0.tgz", @@ -4382,30 +4306,6 @@ "ms": "^2.1.1" } }, - "node_modules/eslint-import-resolver-typescript": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-3.6.1.tgz", - "integrity": "sha512-xgdptdoi5W3niYeuQxKmzVDTATvLYqhpwmykwsh7f6HIOStGWEIL9iqZgQDF9u9OEzrRwR8no5q2VT+bjAujTg==", - "dependencies": { - "debug": "^4.3.4", - "enhanced-resolve": "^5.12.0", - "eslint-module-utils": "^2.7.4", - "fast-glob": "^3.3.1", - "get-tsconfig": "^4.5.0", - "is-core-module": "^2.11.0", - "is-glob": "^4.0.3" - }, - "engines": { - "node": "^14.18.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/unts/projects/eslint-import-resolver-ts" - }, - "peerDependencies": { - "eslint": "*", - "eslint-plugin-import": "*" - } - }, "node_modules/eslint-module-utils": { "version": "2.8.0", "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.0.tgz", @@ -4548,42 +4448,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint-plugin-cypress": { - "version": "2.15.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-cypress/-/eslint-plugin-cypress-2.15.1.tgz", - "integrity": "sha512-eLHLWP5Q+I4j2AWepYq0PgFEei9/s5LvjuSqWrxurkg1YZ8ltxdvMNmdSf0drnsNo57CTgYY/NIHHLRSWejR7w==", - "dependencies": { - "globals": "^13.20.0" - }, - "peerDependencies": { - "eslint": ">= 3.2.1" - } - }, - "node_modules/eslint-plugin-cypress/node_modules/globals": { - "version": "13.23.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz", - "integrity": "sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==", - "dependencies": { - "type-fest": "^0.20.2" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/eslint-plugin-cypress/node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/eslint-plugin-es": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-3.0.1.tgz", @@ -4651,166 +4515,6 @@ "node": ">=0.10.0" } }, - "node_modules/eslint-plugin-jest": { - "version": "27.6.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-27.6.0.tgz", - "integrity": "sha512-MTlusnnDMChbElsszJvrwD1dN3x6nZl//s4JD23BxB6MgR66TZlL064su24xEIS3VACfAoHV1vgyMgPw8nkdng==", - "dependencies": { - "@typescript-eslint/utils": "^5.10.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "peerDependencies": { - "@typescript-eslint/eslint-plugin": "^5.0.0 || ^6.0.0", - "eslint": "^7.0.0 || ^8.0.0", - "jest": "*" - }, - "peerDependenciesMeta": { - "@typescript-eslint/eslint-plugin": { - "optional": true - }, - "jest": { - "optional": true - } - } - }, - "node_modules/eslint-plugin-jest/node_modules/@typescript-eslint/scope-manager": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz", - "integrity": "sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==", - "dependencies": { - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/visitor-keys": "5.62.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/eslint-plugin-jest/node_modules/@typescript-eslint/types": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz", - "integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==", - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/eslint-plugin-jest/node_modules/@typescript-eslint/typescript-estree": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz", - "integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==", - "dependencies": { - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/visitor-keys": "5.62.0", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/eslint-plugin-jest/node_modules/@typescript-eslint/utils": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.62.0.tgz", - "integrity": "sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==", - "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", - "@types/json-schema": "^7.0.9", - "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.62.0", - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/typescript-estree": "5.62.0", - "eslint-scope": "^5.1.1", - "semver": "^7.3.7" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, - "node_modules/eslint-plugin-jest/node_modules/@typescript-eslint/visitor-keys": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz", - "integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==", - "dependencies": { - "@typescript-eslint/types": "5.62.0", - "eslint-visitor-keys": "^3.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/eslint-plugin-jest/node_modules/eslint-visitor-keys": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", - "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint-plugin-jest/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/eslint-plugin-jest/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/eslint-plugin-jest/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - }, "node_modules/eslint-plugin-json": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/eslint-plugin-json/-/eslint-plugin-json-3.1.0.tgz", @@ -4884,48 +4588,6 @@ "eslint": ">=3.0.0" } }, - "node_modules/eslint-plugin-playwright": { - "version": "0.19.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-playwright/-/eslint-plugin-playwright-0.19.0.tgz", - "integrity": "sha512-/pk5oDxusdPnsPNo16o7kWk4Pq8e0Jw7vM0xI/G4wDHhYw1ImQpclB3fQGbjKAO1eauGRLWtJAq5l1Xq3oF16A==", - "dependencies": { - "globals": "^13.23.0" - }, - "peerDependencies": { - "eslint": ">=7", - "eslint-plugin-jest": ">=25" - }, - "peerDependenciesMeta": { - "eslint-plugin-jest": { - "optional": true - } - } - }, - "node_modules/eslint-plugin-playwright/node_modules/globals": { - "version": "13.23.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz", - "integrity": "sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==", - "dependencies": { - "type-fest": "^0.20.2" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/eslint-plugin-playwright/node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/eslint-plugin-prettier": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.0.1.tgz", @@ -5029,310 +4691,6 @@ "safe-regex": "^2.1.1" } }, - "node_modules/eslint-plugin-storybook": { - "version": "0.6.15", - "resolved": "https://registry.npmjs.org/eslint-plugin-storybook/-/eslint-plugin-storybook-0.6.15.tgz", - "integrity": "sha512-lAGqVAJGob47Griu29KXYowI4G7KwMoJDOkEip8ujikuDLxU+oWJ1l0WL6F2oDO4QiyUFXvtDkEkISMOPzo+7w==", - "dependencies": { - "@storybook/csf": "^0.0.1", - "@typescript-eslint/utils": "^5.45.0", - "requireindex": "^1.1.0", - "ts-dedent": "^2.2.0" - }, - "engines": { - "node": "12.x || 14.x || >= 16" - }, - "peerDependencies": { - "eslint": ">=6" - } - }, - "node_modules/eslint-plugin-storybook/node_modules/@typescript-eslint/scope-manager": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz", - "integrity": "sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==", - "dependencies": { - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/visitor-keys": "5.62.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/eslint-plugin-storybook/node_modules/@typescript-eslint/types": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz", - "integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==", - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/eslint-plugin-storybook/node_modules/@typescript-eslint/typescript-estree": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz", - "integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==", - "dependencies": { - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/visitor-keys": "5.62.0", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/eslint-plugin-storybook/node_modules/@typescript-eslint/utils": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.62.0.tgz", - "integrity": "sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==", - "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", - "@types/json-schema": "^7.0.9", - "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.62.0", - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/typescript-estree": "5.62.0", - "eslint-scope": "^5.1.1", - "semver": "^7.3.7" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, - "node_modules/eslint-plugin-storybook/node_modules/@typescript-eslint/visitor-keys": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz", - "integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==", - "dependencies": { - "@typescript-eslint/types": "5.62.0", - "eslint-visitor-keys": "^3.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/eslint-plugin-storybook/node_modules/eslint-visitor-keys": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", - "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint-plugin-storybook/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/eslint-plugin-storybook/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/eslint-plugin-storybook/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - }, - "node_modules/eslint-plugin-testing-library": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-testing-library/-/eslint-plugin-testing-library-6.2.0.tgz", - "integrity": "sha512-+LCYJU81WF2yQ+Xu4A135CgK8IszcFcyMF4sWkbiu6Oj+Nel0TrkZq/HvDw0/1WuO3dhDQsZA/OpEMGd0NfcUw==", - "dependencies": { - "@typescript-eslint/utils": "^5.58.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0", - "npm": ">=6" - }, - "peerDependencies": { - "eslint": "^7.5.0 || ^8.0.0" - } - }, - "node_modules/eslint-plugin-testing-library/node_modules/@typescript-eslint/scope-manager": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz", - "integrity": "sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==", - "dependencies": { - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/visitor-keys": "5.62.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/eslint-plugin-testing-library/node_modules/@typescript-eslint/types": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz", - "integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==", - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/eslint-plugin-testing-library/node_modules/@typescript-eslint/typescript-estree": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz", - "integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==", - "dependencies": { - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/visitor-keys": "5.62.0", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/eslint-plugin-testing-library/node_modules/@typescript-eslint/utils": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.62.0.tgz", - "integrity": "sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==", - "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", - "@types/json-schema": "^7.0.9", - "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.62.0", - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/typescript-estree": "5.62.0", - "eslint-scope": "^5.1.1", - "semver": "^7.3.7" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, - "node_modules/eslint-plugin-testing-library/node_modules/@typescript-eslint/visitor-keys": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz", - "integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==", - "dependencies": { - "@typescript-eslint/types": "5.62.0", - "eslint-visitor-keys": "^3.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/eslint-plugin-testing-library/node_modules/eslint-visitor-keys": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", - "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint-plugin-testing-library/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/eslint-plugin-testing-library/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/eslint-plugin-testing-library/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - }, "node_modules/eslint-scope": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", @@ -6016,17 +5374,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/get-tsconfig": { - "version": "4.7.2", - "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.2.tgz", - "integrity": "sha512-wuMsz4leaj5hbGgg4IvDU0bqJagpftG5l5cXIAvo8uZrqn0NJqwtfupTN00VnkQJPcIRrxYrm1Ue24btpCha2A==", - "dependencies": { - "resolve-pkg-maps": "^1.0.0" - }, - "funding": { - "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" - } - }, "node_modules/glob": { "version": "7.1.7", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", @@ -6112,7 +5459,8 @@ "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true }, "node_modules/grapheme-splitter": { "version": "1.0.4", @@ -9748,14 +9096,6 @@ "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", "dev": true }, - "node_modules/requireindex": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/requireindex/-/requireindex-1.2.0.tgz", - "integrity": "sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww==", - "engines": { - "node": ">=0.10.5" - } - }, "node_modules/resolve": { "version": "1.22.8", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", @@ -9781,14 +9121,6 @@ "node": ">=8" } }, - "node_modules/resolve-pkg-maps": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", - "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", - "funding": { - "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" - } - }, "node_modules/restore-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", @@ -10802,14 +10134,6 @@ "url": "https://opencollective.com/unts" } }, - "node_modules/tapable": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", - "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", - "engines": { - "node": ">=6" - } - }, "node_modules/teeny-request": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/teeny-request/-/teeny-request-7.1.1.tgz", @@ -10962,14 +10286,6 @@ "typescript": ">=4.2.0" } }, - "node_modules/ts-dedent": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/ts-dedent/-/ts-dedent-2.2.0.tgz", - "integrity": "sha512-q5W7tVM71e2xjHZTlgfTDoPF/SmqKG5hddq9SzR49CH2hayqRKJtQ4mtRlSxKaJlR/+9rEM+mnBHf7I2/BQcpQ==", - "engines": { - "node": ">=6.10" - } - }, "node_modules/tsconfig-paths": { "version": "3.14.2", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.2.tgz", @@ -10997,25 +10313,6 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, - "node_modules/tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dependencies": { - "tslib": "^1.8.1" - }, - "engines": { - "node": ">= 6" - }, - "peerDependencies": { - "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" - } - }, - "node_modules/tsutils/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" - }, "node_modules/tty-table": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/tty-table/-/tty-table-4.2.3.tgz", diff --git a/package.json b/package.json index b71fd620..cf4c0e9c 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,6 @@ "dependencies": { "@babel/core": "^7.23.5", "@babel/eslint-parser": "^7.23.3", - "@emotion/eslint-plugin": "^11.11.0", "@typescript-eslint/eslint-plugin": "^6.13.1", "@typescript-eslint/parser": "^6.13.1", "chalk": "^4.1.2", @@ -52,23 +51,17 @@ "eslint": "^8.54.0", "eslint-config-airbnb-base": "^15.0.0", "eslint-config-airbnb-typescript": "^17.1.0", - "eslint-config-next": "^14.0.3", "eslint-config-prettier": "^9.0.0", "eslint-plugin-compat": "^4.2.0", - "eslint-plugin-cypress": "^2.15.1", "eslint-plugin-import": "^2.29.0", - "eslint-plugin-jest": "^27.6.0", "eslint-plugin-json": "^3.1.0", "eslint-plugin-jsx-a11y": "^6.8.0", "eslint-plugin-node": "^11.1.0", "eslint-plugin-notice": "^0.9.10", - "eslint-plugin-playwright": "^0.19.0", "eslint-plugin-prettier": "^5.0.1", "eslint-plugin-react": "^7.33.2", "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-security": "^1.7.1", - "eslint-plugin-storybook": "^0.6.15", - "eslint-plugin-testing-library": "^6.2.0", "husky": "^4.3.8", "inquirer": "^8.2.6", "is-ci": "^3.0.1", From dd125890e237dff01a72cb7a8612c1387a331297 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Connor=20B=C3=A4r?= Date: Tue, 23 Jan 2024 11:01:37 +0000 Subject: [PATCH 2/7] Split off most frameworks into plugins --- .../eslint/__snapshots__/config.spec.ts.snap | 8274 +++++++++++++++-- src/configs/eslint/config.spec.ts | 3 +- src/configs/eslint/config.ts | 66 +- src/lib/options.spec.ts | 32 +- src/lib/options.ts | 38 +- src/types/shared.ts | 5 + 6 files changed, 7754 insertions(+), 664 deletions(-) diff --git a/src/configs/eslint/__snapshots__/config.spec.ts.snap b/src/configs/eslint/__snapshots__/config.spec.ts.snap index 3f390966..ef6a4f54 100644 --- a/src/configs/eslint/__snapshots__/config.spec.ts.snap +++ b/src/configs/eslint/__snapshots__/config.spec.ts.snap @@ -1,6 +1,6 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`eslint > with options > should return a config for { language: 'JavaScript', environments: [ 'Browser' ], frameworks: [ 'Cypress' ] } 1`] = ` +exports[`eslint > with options > should return a config for { language: 'JavaScript', environments: [ 'Browser' ], frameworks: [ 'Next.js' ], plugins: [ 'Cypress' ] } 1`] = ` { "env": { "browser": true, @@ -167,12 +167,59 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr "lintAllEsApis": true, "polyfills": [ "document.body", + "Array.prototype.copyWithin", + "Array.prototype.fill", + "Array.prototype.find", + "Array.prototype.findIndex", + "Array.prototype.flagMap", + "Array.prototype.flat", + "Array.from", + "Array.prototype.includes", + "Array.of", + "Function.name", + "Map", + "Number.EPSILON", + "Number.isFinite", + "Number.isInteger", + "Number.isNaN", + "Number.isSafeInteger", + "Number.MAX_SAFE_INTEGER", + "Number.MIN_SAFE_INTEGER", + "Number.parseFloat", + "Number.parseInt", + "Object.assign", + "Object.entries", + "Object.getOwnPropertyDescriptors", + "Object.keys", + "Object.is", + "Object.values", + "Reflect", + "RegExp", + "Set", + "Symbol", + "String.prototype.codePointAt", + "String.prototype.endsWith", + "String.prototype.fromCodePoint", + "String.prototype.includes", + "String.prototype.padStart", + "String.prototype.padEnd", + "String.prototype.raw", + "String.prototype.repeat", + "String.prototype.startsWith", + "String.prototype.trimLeft", + "String.prototype.trimRight", + "URL", + "URLSearchParams", + "WeakMap", + "WeakSet", + "Promise", + "fetch", ], }, } `; -exports[`eslint > with options > should return a config for { language: 'JavaScript', environments: [ 'Browser' ], frameworks: [ 'Emotion' ] } 1`] = ` +exports[`eslint > with options > should return a config for { language: 'JavaScript', environments: [ 'Browser' ], frameworks: [ 'Next.js' ], plugins: [ 'Emotion' ] } 1`] = ` { "env": { "browser": true, @@ -337,12 +384,59 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr "lintAllEsApis": true, "polyfills": [ "document.body", + "Array.prototype.copyWithin", + "Array.prototype.fill", + "Array.prototype.find", + "Array.prototype.findIndex", + "Array.prototype.flagMap", + "Array.prototype.flat", + "Array.from", + "Array.prototype.includes", + "Array.of", + "Function.name", + "Map", + "Number.EPSILON", + "Number.isFinite", + "Number.isInteger", + "Number.isNaN", + "Number.isSafeInteger", + "Number.MAX_SAFE_INTEGER", + "Number.MIN_SAFE_INTEGER", + "Number.parseFloat", + "Number.parseInt", + "Object.assign", + "Object.entries", + "Object.getOwnPropertyDescriptors", + "Object.keys", + "Object.is", + "Object.values", + "Reflect", + "RegExp", + "Set", + "Symbol", + "String.prototype.codePointAt", + "String.prototype.endsWith", + "String.prototype.fromCodePoint", + "String.prototype.includes", + "String.prototype.padStart", + "String.prototype.padEnd", + "String.prototype.raw", + "String.prototype.repeat", + "String.prototype.startsWith", + "String.prototype.trimLeft", + "String.prototype.trimRight", + "URL", + "URLSearchParams", + "WeakMap", + "WeakSet", + "Promise", + "fetch", ], }, } `; -exports[`eslint > with options > should return a config for { language: 'JavaScript', environments: [ 'Browser' ], frameworks: [ 'Jest' ] } 1`] = ` +exports[`eslint > with options > should return a config for { language: 'JavaScript', environments: [ 'Browser' ], frameworks: [ 'Next.js' ], plugins: [ 'Jest' ] } 1`] = ` { "env": { "browser": true, @@ -513,12 +607,59 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr "lintAllEsApis": true, "polyfills": [ "document.body", + "Array.prototype.copyWithin", + "Array.prototype.fill", + "Array.prototype.find", + "Array.prototype.findIndex", + "Array.prototype.flagMap", + "Array.prototype.flat", + "Array.from", + "Array.prototype.includes", + "Array.of", + "Function.name", + "Map", + "Number.EPSILON", + "Number.isFinite", + "Number.isInteger", + "Number.isNaN", + "Number.isSafeInteger", + "Number.MAX_SAFE_INTEGER", + "Number.MIN_SAFE_INTEGER", + "Number.parseFloat", + "Number.parseInt", + "Object.assign", + "Object.entries", + "Object.getOwnPropertyDescriptors", + "Object.keys", + "Object.is", + "Object.values", + "Reflect", + "RegExp", + "Set", + "Symbol", + "String.prototype.codePointAt", + "String.prototype.endsWith", + "String.prototype.fromCodePoint", + "String.prototype.includes", + "String.prototype.padStart", + "String.prototype.padEnd", + "String.prototype.raw", + "String.prototype.repeat", + "String.prototype.startsWith", + "String.prototype.trimLeft", + "String.prototype.trimRight", + "URL", + "URLSearchParams", + "WeakMap", + "WeakSet", + "Promise", + "fetch", ], }, } `; -exports[`eslint > with options > should return a config for { language: 'JavaScript', environments: [ 'Browser' ], frameworks: [ 'Next.js' ] } 1`] = ` +exports[`eslint > with options > should return a config for { language: 'JavaScript', environments: [ 'Browser' ], frameworks: [ 'Next.js' ], plugins: [ 'Next.js' ] } 1`] = ` { "env": { "browser": true, @@ -722,7 +863,7 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr } `; -exports[`eslint > with options > should return a config for { language: 'JavaScript', environments: [ 'Browser' ], frameworks: [ 'Playwright' ] } 1`] = ` +exports[`eslint > with options > should return a config for { language: 'JavaScript', environments: [ 'Browser' ], frameworks: [ 'Next.js' ], plugins: [ 'Playwright' ] } 1`] = ` { "env": { "browser": true, @@ -883,12 +1024,59 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr "lintAllEsApis": true, "polyfills": [ "document.body", + "Array.prototype.copyWithin", + "Array.prototype.fill", + "Array.prototype.find", + "Array.prototype.findIndex", + "Array.prototype.flagMap", + "Array.prototype.flat", + "Array.from", + "Array.prototype.includes", + "Array.of", + "Function.name", + "Map", + "Number.EPSILON", + "Number.isFinite", + "Number.isInteger", + "Number.isNaN", + "Number.isSafeInteger", + "Number.MAX_SAFE_INTEGER", + "Number.MIN_SAFE_INTEGER", + "Number.parseFloat", + "Number.parseInt", + "Object.assign", + "Object.entries", + "Object.getOwnPropertyDescriptors", + "Object.keys", + "Object.is", + "Object.values", + "Reflect", + "RegExp", + "Set", + "Symbol", + "String.prototype.codePointAt", + "String.prototype.endsWith", + "String.prototype.fromCodePoint", + "String.prototype.includes", + "String.prototype.padStart", + "String.prototype.padEnd", + "String.prototype.raw", + "String.prototype.repeat", + "String.prototype.startsWith", + "String.prototype.trimLeft", + "String.prototype.trimRight", + "URL", + "URLSearchParams", + "WeakMap", + "WeakSet", + "Promise", + "fetch", ], }, } `; -exports[`eslint > with options > should return a config for { language: 'JavaScript', environments: [ 'Browser' ], frameworks: [ 'React' ] } 1`] = ` +exports[`eslint > with options > should return a config for { language: 'JavaScript', environments: [ 'Browser' ], frameworks: [ 'Next.js' ], plugins: [ 'Storybook' ] } 1`] = ` { "env": { "browser": true, @@ -898,9 +1086,7 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr "plugin:prettier/recommended", "airbnb-base", "plugin:compat/recommended", - "plugin:react/recommended", - "plugin:react-hooks/recommended", - "plugin:jsx-a11y/recommended", + "plugin:storybook/recommended", ], "overrides": [ { @@ -970,7 +1156,6 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr "allowImportExportEverywhere": true, "ecmaFeatures": { "impliedStrict": true, - "jsx": true, "modules": true, }, "ecmaVersion": 6, @@ -978,9 +1163,6 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr }, "plugins": [ "prettier", - "react", - "react-hooks", - "jsx-a11y", ], "root": true, "rules": { @@ -1031,8 +1213,6 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr "object-curly-newline": "off", "operator-linebreak": "off", "quote-props": "off", - "react/display-name": "off", - "react/react-in-jsx-scope": "off", }, "settings": { "import/resolver": { @@ -1048,15 +1228,59 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr "lintAllEsApis": true, "polyfills": [ "document.body", + "Array.prototype.copyWithin", + "Array.prototype.fill", + "Array.prototype.find", + "Array.prototype.findIndex", + "Array.prototype.flagMap", + "Array.prototype.flat", + "Array.from", + "Array.prototype.includes", + "Array.of", + "Function.name", + "Map", + "Number.EPSILON", + "Number.isFinite", + "Number.isInteger", + "Number.isNaN", + "Number.isSafeInteger", + "Number.MAX_SAFE_INTEGER", + "Number.MIN_SAFE_INTEGER", + "Number.parseFloat", + "Number.parseInt", + "Object.assign", + "Object.entries", + "Object.getOwnPropertyDescriptors", + "Object.keys", + "Object.is", + "Object.values", + "Reflect", + "RegExp", + "Set", + "Symbol", + "String.prototype.codePointAt", + "String.prototype.endsWith", + "String.prototype.fromCodePoint", + "String.prototype.includes", + "String.prototype.padStart", + "String.prototype.padEnd", + "String.prototype.raw", + "String.prototype.repeat", + "String.prototype.startsWith", + "String.prototype.trimLeft", + "String.prototype.trimRight", + "URL", + "URLSearchParams", + "WeakMap", + "WeakSet", + "Promise", + "fetch", ], - "react": { - "version": "detect", - }, }, } `; -exports[`eslint > with options > should return a config for { language: 'JavaScript', environments: [ 'Browser' ], frameworks: [ 'Storybook' ] } 1`] = ` +exports[`eslint > with options > should return a config for { language: 'JavaScript', environments: [ 'Browser' ], frameworks: [ 'Next.js' ], plugins: [ 'Testing Library' ] } 1`] = ` { "env": { "browser": true, @@ -1066,7 +1290,6 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr "plugin:prettier/recommended", "airbnb-base", "plugin:compat/recommended", - "plugin:storybook/recommended", ], "overrides": [ { @@ -1130,13 +1353,30 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr "compat/compat": "off", }, }, - ], - "parser": "@babel/eslint-parser", - "parserOptions": { - "allowImportExportEverywhere": true, - "ecmaFeatures": { - "impliedStrict": true, - "modules": true, + { + "extends": [ + "plugin:testing-library/react", + ], + "files": [ + "**/*.spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + "**/*Fixtures.*", + "**/__fixtures__/**/*", + "**/__mocks__/**/*", + ], + "plugins": [ + "testing-library", + ], + }, + ], + "parser": "@babel/eslint-parser", + "parserOptions": { + "allowImportExportEverywhere": true, + "ecmaFeatures": { + "impliedStrict": true, + "modules": true, }, "ecmaVersion": 6, "sourceType": "module", @@ -1208,12 +1448,59 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr "lintAllEsApis": true, "polyfills": [ "document.body", + "Array.prototype.copyWithin", + "Array.prototype.fill", + "Array.prototype.find", + "Array.prototype.findIndex", + "Array.prototype.flagMap", + "Array.prototype.flat", + "Array.from", + "Array.prototype.includes", + "Array.of", + "Function.name", + "Map", + "Number.EPSILON", + "Number.isFinite", + "Number.isInteger", + "Number.isNaN", + "Number.isSafeInteger", + "Number.MAX_SAFE_INTEGER", + "Number.MIN_SAFE_INTEGER", + "Number.parseFloat", + "Number.parseInt", + "Object.assign", + "Object.entries", + "Object.getOwnPropertyDescriptors", + "Object.keys", + "Object.is", + "Object.values", + "Reflect", + "RegExp", + "Set", + "Symbol", + "String.prototype.codePointAt", + "String.prototype.endsWith", + "String.prototype.fromCodePoint", + "String.prototype.includes", + "String.prototype.padStart", + "String.prototype.padEnd", + "String.prototype.raw", + "String.prototype.repeat", + "String.prototype.startsWith", + "String.prototype.trimLeft", + "String.prototype.trimRight", + "URL", + "URLSearchParams", + "WeakMap", + "WeakSet", + "Promise", + "fetch", ], }, } `; -exports[`eslint > with options > should return a config for { language: 'JavaScript', environments: [ 'Browser' ], frameworks: [ 'Testing Library' ] } 1`] = ` +exports[`eslint > with options > should return a config for { language: 'JavaScript', environments: [ 'Browser' ], frameworks: [ 'React' ], plugins: [ 'Cypress' ] } 1`] = ` { "env": { "browser": true, @@ -1223,6 +1510,9 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr "plugin:prettier/recommended", "airbnb-base", "plugin:compat/recommended", + "plugin:react/recommended", + "plugin:react-hooks/recommended", + "plugin:jsx-a11y/recommended", ], "overrides": [ { @@ -1287,20 +1577,19 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr }, }, { + "env": { + "cypress/globals": true, + }, "extends": [ - "plugin:testing-library/react", + "plugin:cypress/recommended", ], "files": [ - "**/*.spec.*", - "**/jest*", - "**/setupTests.*", - "**/test-utils.*", - "**/*Fixtures.*", - "**/__fixtures__/**/*", - "**/__mocks__/**/*", + "**/*spec.*", + "e2e/**/*", + "tests/**/*", ], "plugins": [ - "testing-library", + "cypress", ], }, ], @@ -1309,6 +1598,7 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr "allowImportExportEverywhere": true, "ecmaFeatures": { "impliedStrict": true, + "jsx": true, "modules": true, }, "ecmaVersion": 6, @@ -1316,6 +1606,9 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr }, "plugins": [ "prettier", + "react", + "react-hooks", + "jsx-a11y", ], "root": true, "rules": { @@ -1366,6 +1659,8 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr "object-curly-newline": "off", "operator-linebreak": "off", "quote-props": "off", + "react/display-name": "off", + "react/react-in-jsx-scope": "off", }, "settings": { "import/resolver": { @@ -1382,21 +1677,26 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr "polyfills": [ "document.body", ], + "react": { + "version": "detect", + }, }, } `; -exports[`eslint > with options > should return a config for { language: 'JavaScript', environments: [ 'Node' ], frameworks: [ 'Cypress' ] } 1`] = ` +exports[`eslint > with options > should return a config for { language: 'JavaScript', environments: [ 'Browser' ], frameworks: [ 'React' ], plugins: [ 'Emotion' ] } 1`] = ` { "env": { - "node": true, + "browser": true, }, "extends": [ "eslint:recommended", "plugin:prettier/recommended", "airbnb-base", - "plugin:node/recommended", - "plugin:security/recommended", + "plugin:compat/recommended", + "plugin:react/recommended", + "plugin:react-hooks/recommended", + "plugin:jsx-a11y/recommended", ], "overrides": [ { @@ -1449,29 +1749,16 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr "**/jest*", "**/setupTests.*", "**/test-utils.*", + "**/*Fixtures.*", + "**/__fixtures__/**/*", + "**/__mocks__/**/*", + "api/**/*", + "pages/api/**/*", + "src/pages/api/**/*", ], "rules": { - "node/no-extraneous-require": "off", - "node/no-missing-require": "off", - "node/no-unpublished-import": "off", - "node/no-unpublished-require": "off", - }, - }, - { - "env": { - "cypress/globals": true, + "compat/compat": "off", }, - "extends": [ - "plugin:cypress/recommended", - ], - "files": [ - "**/*spec.*", - "e2e/**/*", - "tests/**/*", - ], - "plugins": [ - "cypress", - ], }, ], "parser": "@babel/eslint-parser", @@ -1479,6 +1766,7 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr "allowImportExportEverywhere": true, "ecmaFeatures": { "impliedStrict": true, + "jsx": true, "modules": true, }, "ecmaVersion": 6, @@ -1486,9 +1774,18 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr }, "plugins": [ "prettier", + "react", + "react-hooks", + "jsx-a11y", + "@emotion", ], "root": true, "rules": { + "@emotion/import-from-emotion": "error", + "@emotion/jsx-import": "off", + "@emotion/no-vanilla": "error", + "@emotion/pkg-renaming": "error", + "@emotion/styled-import": "error", "comma-dangle": "off", "curly": [ "error", @@ -1533,12 +1830,19 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr "allowAsStatement": true, }, ], - "node/no-extraneous-import": "off", - "node/no-missing-import": "off", - "node/no-unsupported-features/es-syntax": "off", "object-curly-newline": "off", "operator-linebreak": "off", "quote-props": "off", + "react/display-name": "off", + "react/no-unknown-property": [ + "error", + { + "ignore": [ + "css", + ], + }, + ], + "react/react-in-jsx-scope": "off", }, "settings": { "import/resolver": { @@ -1551,21 +1855,30 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr ], }, }, + "lintAllEsApis": true, + "polyfills": [ + "document.body", + ], + "react": { + "version": "detect", + }, }, } `; -exports[`eslint > with options > should return a config for { language: 'JavaScript', environments: [ 'Node' ], frameworks: [ 'Emotion' ] } 1`] = ` +exports[`eslint > with options > should return a config for { language: 'JavaScript', environments: [ 'Browser' ], frameworks: [ 'React' ], plugins: [ 'Jest' ] } 1`] = ` { "env": { - "node": true, + "browser": true, }, "extends": [ "eslint:recommended", "plugin:prettier/recommended", "airbnb-base", - "plugin:node/recommended", - "plugin:security/recommended", + "plugin:compat/recommended", + "plugin:react/recommended", + "plugin:react-hooks/recommended", + "plugin:jsx-a11y/recommended", ], "overrides": [ { @@ -1618,20 +1931,44 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr "**/jest*", "**/setupTests.*", "**/test-utils.*", + "**/*Fixtures.*", + "**/__fixtures__/**/*", + "**/__mocks__/**/*", + "api/**/*", + "pages/api/**/*", + "src/pages/api/**/*", ], "rules": { - "node/no-extraneous-require": "off", - "node/no-missing-require": "off", - "node/no-unpublished-import": "off", - "node/no-unpublished-require": "off", + "compat/compat": "off", }, }, + { + "env": { + "jest/globals": true, + }, + "extends": [ + "plugin:jest/recommended", + ], + "files": [ + "**/*.spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + "**/*Fixtures.*", + "**/__fixtures__/**/*", + "**/__mocks__/**/*", + ], + "plugins": [ + "jest", + ], + }, ], "parser": "@babel/eslint-parser", "parserOptions": { "allowImportExportEverywhere": true, "ecmaFeatures": { "impliedStrict": true, + "jsx": true, "modules": true, }, "ecmaVersion": 6, @@ -1639,15 +1976,12 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr }, "plugins": [ "prettier", - "@emotion", + "react", + "react-hooks", + "jsx-a11y", ], "root": true, "rules": { - "@emotion/import-from-emotion": "error", - "@emotion/jsx-import": "off", - "@emotion/no-vanilla": "error", - "@emotion/pkg-renaming": "error", - "@emotion/styled-import": "error", "comma-dangle": "off", "curly": [ "error", @@ -1692,20 +2026,11 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr "allowAsStatement": true, }, ], - "node/no-extraneous-import": "off", - "node/no-missing-import": "off", - "node/no-unsupported-features/es-syntax": "off", "object-curly-newline": "off", "operator-linebreak": "off", "quote-props": "off", - "react/no-unknown-property": [ - "error", - { - "ignore": [ - "css", - ], - }, - ], + "react/display-name": "off", + "react/react-in-jsx-scope": "off", }, "settings": { "import/resolver": { @@ -1718,21 +2043,31 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr ], }, }, + "lintAllEsApis": true, + "polyfills": [ + "document.body", + ], + "react": { + "version": "detect", + }, }, } `; -exports[`eslint > with options > should return a config for { language: 'JavaScript', environments: [ 'Node' ], frameworks: [ 'Jest' ] } 1`] = ` +exports[`eslint > with options > should return a config for { language: 'JavaScript', environments: [ 'Browser' ], frameworks: [ 'React' ], plugins: [ 'Next.js' ] } 1`] = ` { "env": { - "node": true, + "browser": true, }, "extends": [ "eslint:recommended", "plugin:prettier/recommended", "airbnb-base", - "plugin:node/recommended", - "plugin:security/recommended", + "plugin:compat/recommended", + "plugin:react/recommended", + "plugin:react-hooks/recommended", + "plugin:jsx-a11y/recommended", + "next", ], "overrides": [ { @@ -1785,40 +2120,24 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr "**/jest*", "**/setupTests.*", "**/test-utils.*", + "**/*Fixtures.*", + "**/__fixtures__/**/*", + "**/__mocks__/**/*", + "api/**/*", + "pages/api/**/*", + "src/pages/api/**/*", ], "rules": { - "node/no-extraneous-require": "off", - "node/no-missing-require": "off", - "node/no-unpublished-import": "off", - "node/no-unpublished-require": "off", + "compat/compat": "off", }, }, - { - "env": { - "jest/globals": true, - }, - "extends": [ - "plugin:jest/recommended", - ], - "files": [ - "**/*.spec.*", - "**/jest*", - "**/setupTests.*", - "**/test-utils.*", - "**/*Fixtures.*", - "**/__fixtures__/**/*", - "**/__mocks__/**/*", - ], - "plugins": [ - "jest", - ], - }, ], "parser": "@babel/eslint-parser", "parserOptions": { "allowImportExportEverywhere": true, "ecmaFeatures": { "impliedStrict": true, + "jsx": true, "modules": true, }, "ecmaVersion": 6, @@ -1826,6 +2145,9 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr }, "plugins": [ "prettier", + "react", + "react-hooks", + "jsx-a11y", ], "root": true, "rules": { @@ -1873,12 +2195,11 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr "allowAsStatement": true, }, ], - "node/no-extraneous-import": "off", - "node/no-missing-import": "off", - "node/no-unsupported-features/es-syntax": "off", "object-curly-newline": "off", "operator-linebreak": "off", "quote-props": "off", + "react/display-name": "off", + "react/react-in-jsx-scope": "off", }, "settings": { "import/resolver": { @@ -1891,22 +2212,30 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr ], }, }, + "lintAllEsApis": true, + "polyfills": [ + "document.body", + ], + "react": { + "version": "detect", + }, }, } `; -exports[`eslint > with options > should return a config for { language: 'JavaScript', environments: [ 'Node' ], frameworks: [ 'Next.js' ] } 1`] = ` +exports[`eslint > with options > should return a config for { language: 'JavaScript', environments: [ 'Browser' ], frameworks: [ 'React' ], plugins: [ 'Playwright' ] } 1`] = ` { "env": { - "node": true, + "browser": true, }, "extends": [ "eslint:recommended", "plugin:prettier/recommended", "airbnb-base", - "plugin:node/recommended", - "plugin:security/recommended", - "next", + "plugin:compat/recommended", + "plugin:react/recommended", + "plugin:react-hooks/recommended", + "plugin:jsx-a11y/recommended", ], "overrides": [ { @@ -1959,20 +2288,34 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr "**/jest*", "**/setupTests.*", "**/test-utils.*", + "**/*Fixtures.*", + "**/__fixtures__/**/*", + "**/__mocks__/**/*", + "api/**/*", + "pages/api/**/*", + "src/pages/api/**/*", ], "rules": { - "node/no-extraneous-require": "off", - "node/no-missing-require": "off", - "node/no-unpublished-import": "off", - "node/no-unpublished-require": "off", + "compat/compat": "off", }, }, + { + "extends": [ + "plugin:playwright/playwright-test", + ], + "files": [ + "**/*spec.*", + "e2e/**/*", + "tests/**/*", + ], + }, ], "parser": "@babel/eslint-parser", "parserOptions": { "allowImportExportEverywhere": true, "ecmaFeatures": { "impliedStrict": true, + "jsx": true, "modules": true, }, "ecmaVersion": 6, @@ -1980,6 +2323,9 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr }, "plugins": [ "prettier", + "react", + "react-hooks", + "jsx-a11y", ], "root": true, "rules": { @@ -2027,12 +2373,11 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr "allowAsStatement": true, }, ], - "node/no-extraneous-import": "off", - "node/no-missing-import": "off", - "node/no-unsupported-features/es-syntax": "off", "object-curly-newline": "off", "operator-linebreak": "off", "quote-props": "off", + "react/display-name": "off", + "react/react-in-jsx-scope": "off", }, "settings": { "import/resolver": { @@ -2045,70 +2390,31 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr ], }, }, + "lintAllEsApis": true, "polyfills": [ - "Array.prototype.copyWithin", - "Array.prototype.fill", - "Array.prototype.find", - "Array.prototype.findIndex", - "Array.prototype.flagMap", - "Array.prototype.flat", - "Array.from", - "Array.prototype.includes", - "Array.of", - "Function.name", - "Map", - "Number.EPSILON", - "Number.isFinite", - "Number.isInteger", - "Number.isNaN", - "Number.isSafeInteger", - "Number.MAX_SAFE_INTEGER", - "Number.MIN_SAFE_INTEGER", - "Number.parseFloat", - "Number.parseInt", - "Object.assign", - "Object.entries", - "Object.getOwnPropertyDescriptors", - "Object.keys", - "Object.is", - "Object.values", - "Reflect", - "RegExp", - "Set", - "Symbol", - "String.prototype.codePointAt", - "String.prototype.endsWith", - "String.prototype.fromCodePoint", - "String.prototype.includes", - "String.prototype.padStart", - "String.prototype.padEnd", - "String.prototype.raw", - "String.prototype.repeat", - "String.prototype.startsWith", - "String.prototype.trimLeft", - "String.prototype.trimRight", - "URL", - "URLSearchParams", - "WeakMap", - "WeakSet", - "Promise", - "fetch", + "document.body", ], + "react": { + "version": "detect", + }, }, } `; -exports[`eslint > with options > should return a config for { language: 'JavaScript', environments: [ 'Node' ], frameworks: [ 'Playwright' ] } 1`] = ` +exports[`eslint > with options > should return a config for { language: 'JavaScript', environments: [ 'Browser' ], frameworks: [ 'React' ], plugins: [ 'Storybook' ] } 1`] = ` { "env": { - "node": true, + "browser": true, }, "extends": [ "eslint:recommended", "plugin:prettier/recommended", "airbnb-base", - "plugin:node/recommended", - "plugin:security/recommended", + "plugin:compat/recommended", + "plugin:react/recommended", + "plugin:react-hooks/recommended", + "plugin:jsx-a11y/recommended", + "plugin:storybook/recommended", ], "overrides": [ { @@ -2161,30 +2467,24 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr "**/jest*", "**/setupTests.*", "**/test-utils.*", + "**/*Fixtures.*", + "**/__fixtures__/**/*", + "**/__mocks__/**/*", + "api/**/*", + "pages/api/**/*", + "src/pages/api/**/*", ], "rules": { - "node/no-extraneous-require": "off", - "node/no-missing-require": "off", - "node/no-unpublished-import": "off", - "node/no-unpublished-require": "off", + "compat/compat": "off", }, }, - { - "extends": [ - "plugin:playwright/playwright-test", - ], - "files": [ - "**/*spec.*", - "e2e/**/*", - "tests/**/*", - ], - }, ], "parser": "@babel/eslint-parser", "parserOptions": { "allowImportExportEverywhere": true, "ecmaFeatures": { "impliedStrict": true, + "jsx": true, "modules": true, }, "ecmaVersion": 6, @@ -2192,6 +2492,9 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr }, "plugins": [ "prettier", + "react", + "react-hooks", + "jsx-a11y", ], "root": true, "rules": { @@ -2239,12 +2542,11 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr "allowAsStatement": true, }, ], - "node/no-extraneous-import": "off", - "node/no-missing-import": "off", - "node/no-unsupported-features/es-syntax": "off", "object-curly-newline": "off", "operator-linebreak": "off", "quote-props": "off", + "react/display-name": "off", + "react/react-in-jsx-scope": "off", }, "settings": { "import/resolver": { @@ -2257,21 +2559,27 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr ], }, }, + "lintAllEsApis": true, + "polyfills": [ + "document.body", + ], + "react": { + "version": "detect", + }, }, } `; -exports[`eslint > with options > should return a config for { language: 'JavaScript', environments: [ 'Node' ], frameworks: [ 'React' ] } 1`] = ` +exports[`eslint > with options > should return a config for { language: 'JavaScript', environments: [ 'Browser' ], frameworks: [ 'React' ], plugins: [ 'Testing Library' ] } 1`] = ` { "env": { - "node": true, + "browser": true, }, "extends": [ "eslint:recommended", "plugin:prettier/recommended", "airbnb-base", - "plugin:node/recommended", - "plugin:security/recommended", + "plugin:compat/recommended", "plugin:react/recommended", "plugin:react-hooks/recommended", "plugin:jsx-a11y/recommended", @@ -2327,14 +2635,34 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr "**/jest*", "**/setupTests.*", "**/test-utils.*", + "**/*Fixtures.*", + "**/__fixtures__/**/*", + "**/__mocks__/**/*", + "api/**/*", + "pages/api/**/*", + "src/pages/api/**/*", ], "rules": { - "node/no-extraneous-require": "off", - "node/no-missing-require": "off", - "node/no-unpublished-import": "off", - "node/no-unpublished-require": "off", + "compat/compat": "off", }, }, + { + "extends": [ + "plugin:testing-library/react", + ], + "files": [ + "**/*.spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + "**/*Fixtures.*", + "**/__fixtures__/**/*", + "**/__mocks__/**/*", + ], + "plugins": [ + "testing-library", + ], + }, ], "parser": "@babel/eslint-parser", "parserOptions": { @@ -2399,9 +2727,6 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr "allowAsStatement": true, }, ], - "node/no-extraneous-import": "off", - "node/no-missing-import": "off", - "node/no-unsupported-features/es-syntax": "off", "object-curly-newline": "off", "operator-linebreak": "off", "quote-props": "off", @@ -2419,6 +2744,10 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr ], }, }, + "lintAllEsApis": true, + "polyfills": [ + "document.body", + ], "react": { "version": "detect", }, @@ -2426,7 +2755,7 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr } `; -exports[`eslint > with options > should return a config for { language: 'JavaScript', environments: [ 'Node' ], frameworks: [ 'Storybook' ] } 1`] = ` +exports[`eslint > with options > should return a config for { language: 'JavaScript', environments: [ 'Node' ], frameworks: [ 'Next.js' ], plugins: [ 'Cypress' ] } 1`] = ` { "env": { "node": true, @@ -2437,7 +2766,6 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr "airbnb-base", "plugin:node/recommended", "plugin:security/recommended", - "plugin:storybook/recommended", ], "overrides": [ { @@ -2486,132 +2814,6503 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr }, { "files": [ - "**/*.spec.*", - "**/jest*", - "**/setupTests.*", - "**/test-utils.*", + "**/*.spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + ], + "rules": { + "node/no-extraneous-require": "off", + "node/no-missing-require": "off", + "node/no-unpublished-import": "off", + "node/no-unpublished-require": "off", + }, + }, + { + "env": { + "cypress/globals": true, + }, + "extends": [ + "plugin:cypress/recommended", + ], + "files": [ + "**/*spec.*", + "e2e/**/*", + "tests/**/*", + ], + "plugins": [ + "cypress", + ], + }, + ], + "parser": "@babel/eslint-parser", + "parserOptions": { + "allowImportExportEverywhere": true, + "ecmaFeatures": { + "impliedStrict": true, + "modules": true, + }, + "ecmaVersion": 6, + "sourceType": "module", + }, + "plugins": [ + "prettier", + ], + "root": true, + "rules": { + "comma-dangle": "off", + "curly": [ + "error", + "all", + ], + "function-paren-newline": "off", + "implicit-arrow-linebreak": "off", + "import/extensions": "off", + "import/no-cycle": [ + "error", + { + "maxDepth": 7, + }, + ], + "import/order": [ + "error", + { + "newlines-between": "always", + }, + ], + "import/prefer-default-export": "off", + "indent": "off", + "max-len": [ + "error", + { + "code": 80, + "ignoreComments": true, + "ignorePattern": "^(?:import\\s|export\\s|\\s*it(?:\\.(?:skip|only))?\\()", + "ignoreRegExpLiterals": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true, + "ignoreUrls": true, + "tabWidth": 2, + }, + ], + "no-confusing-arrow": "off", + "no-underscore-dangle": "error", + "no-use-before-define": "off", + "no-void": [ + "error", + { + "allowAsStatement": true, + }, + ], + "node/no-extraneous-import": "off", + "node/no-missing-import": "off", + "node/no-unsupported-features/es-syntax": "off", + "object-curly-newline": "off", + "operator-linebreak": "off", + "quote-props": "off", + }, + "settings": { + "import/resolver": { + "node": { + "extensions": [ + ".js", + ".jsx", + ".ts", + ".tsx", + ], + }, + }, + "polyfills": [ + "Array.prototype.copyWithin", + "Array.prototype.fill", + "Array.prototype.find", + "Array.prototype.findIndex", + "Array.prototype.flagMap", + "Array.prototype.flat", + "Array.from", + "Array.prototype.includes", + "Array.of", + "Function.name", + "Map", + "Number.EPSILON", + "Number.isFinite", + "Number.isInteger", + "Number.isNaN", + "Number.isSafeInteger", + "Number.MAX_SAFE_INTEGER", + "Number.MIN_SAFE_INTEGER", + "Number.parseFloat", + "Number.parseInt", + "Object.assign", + "Object.entries", + "Object.getOwnPropertyDescriptors", + "Object.keys", + "Object.is", + "Object.values", + "Reflect", + "RegExp", + "Set", + "Symbol", + "String.prototype.codePointAt", + "String.prototype.endsWith", + "String.prototype.fromCodePoint", + "String.prototype.includes", + "String.prototype.padStart", + "String.prototype.padEnd", + "String.prototype.raw", + "String.prototype.repeat", + "String.prototype.startsWith", + "String.prototype.trimLeft", + "String.prototype.trimRight", + "URL", + "URLSearchParams", + "WeakMap", + "WeakSet", + "Promise", + "fetch", + ], + }, +} +`; + +exports[`eslint > with options > should return a config for { language: 'JavaScript', environments: [ 'Node' ], frameworks: [ 'Next.js' ], plugins: [ 'Emotion' ] } 1`] = ` +{ + "env": { + "node": true, + }, + "extends": [ + "eslint:recommended", + "plugin:prettier/recommended", + "airbnb-base", + "plugin:node/recommended", + "plugin:security/recommended", + ], + "overrides": [ + { + "extends": [ + "plugin:json/recommended", + ], + "files": [ + "**/*.json", + ], + "rules": { + "notice/notice": "off", + }, + }, + { + "files": [ + "api/**/*", + "pages/api/**/*", + "src/pages/api/**/*", + ], + "rules": { + "no-console": "off", + }, + }, + { + "files": [ + "**/*.{story,stories}.*", + ], + "rules": { + "import/no-anonymous-default-export": "off", + "import/no-extraneous-dependencies": "off", + "no-alert": "off", + }, + }, + { + "files": [ + "**/*spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + ], + "rules": { + "import/no-extraneous-dependencies": "off", + "react/display-name": "off", + "react/prop-types": "off", + }, + }, + { + "files": [ + "**/*.spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + ], + "rules": { + "node/no-extraneous-require": "off", + "node/no-missing-require": "off", + "node/no-unpublished-import": "off", + "node/no-unpublished-require": "off", + }, + }, + ], + "parser": "@babel/eslint-parser", + "parserOptions": { + "allowImportExportEverywhere": true, + "ecmaFeatures": { + "impliedStrict": true, + "modules": true, + }, + "ecmaVersion": 6, + "sourceType": "module", + }, + "plugins": [ + "prettier", + "@emotion", + ], + "root": true, + "rules": { + "@emotion/import-from-emotion": "error", + "@emotion/jsx-import": "off", + "@emotion/no-vanilla": "error", + "@emotion/pkg-renaming": "error", + "@emotion/styled-import": "error", + "comma-dangle": "off", + "curly": [ + "error", + "all", + ], + "function-paren-newline": "off", + "implicit-arrow-linebreak": "off", + "import/extensions": "off", + "import/no-cycle": [ + "error", + { + "maxDepth": 7, + }, + ], + "import/order": [ + "error", + { + "newlines-between": "always", + }, + ], + "import/prefer-default-export": "off", + "indent": "off", + "max-len": [ + "error", + { + "code": 80, + "ignoreComments": true, + "ignorePattern": "^(?:import\\s|export\\s|\\s*it(?:\\.(?:skip|only))?\\()", + "ignoreRegExpLiterals": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true, + "ignoreUrls": true, + "tabWidth": 2, + }, + ], + "no-confusing-arrow": "off", + "no-underscore-dangle": "error", + "no-use-before-define": "off", + "no-void": [ + "error", + { + "allowAsStatement": true, + }, + ], + "node/no-extraneous-import": "off", + "node/no-missing-import": "off", + "node/no-unsupported-features/es-syntax": "off", + "object-curly-newline": "off", + "operator-linebreak": "off", + "quote-props": "off", + "react/no-unknown-property": [ + "error", + { + "ignore": [ + "css", + ], + }, + ], + }, + "settings": { + "import/resolver": { + "node": { + "extensions": [ + ".js", + ".jsx", + ".ts", + ".tsx", + ], + }, + }, + "polyfills": [ + "Array.prototype.copyWithin", + "Array.prototype.fill", + "Array.prototype.find", + "Array.prototype.findIndex", + "Array.prototype.flagMap", + "Array.prototype.flat", + "Array.from", + "Array.prototype.includes", + "Array.of", + "Function.name", + "Map", + "Number.EPSILON", + "Number.isFinite", + "Number.isInteger", + "Number.isNaN", + "Number.isSafeInteger", + "Number.MAX_SAFE_INTEGER", + "Number.MIN_SAFE_INTEGER", + "Number.parseFloat", + "Number.parseInt", + "Object.assign", + "Object.entries", + "Object.getOwnPropertyDescriptors", + "Object.keys", + "Object.is", + "Object.values", + "Reflect", + "RegExp", + "Set", + "Symbol", + "String.prototype.codePointAt", + "String.prototype.endsWith", + "String.prototype.fromCodePoint", + "String.prototype.includes", + "String.prototype.padStart", + "String.prototype.padEnd", + "String.prototype.raw", + "String.prototype.repeat", + "String.prototype.startsWith", + "String.prototype.trimLeft", + "String.prototype.trimRight", + "URL", + "URLSearchParams", + "WeakMap", + "WeakSet", + "Promise", + "fetch", + ], + }, +} +`; + +exports[`eslint > with options > should return a config for { language: 'JavaScript', environments: [ 'Node' ], frameworks: [ 'Next.js' ], plugins: [ 'Jest' ] } 1`] = ` +{ + "env": { + "node": true, + }, + "extends": [ + "eslint:recommended", + "plugin:prettier/recommended", + "airbnb-base", + "plugin:node/recommended", + "plugin:security/recommended", + ], + "overrides": [ + { + "extends": [ + "plugin:json/recommended", + ], + "files": [ + "**/*.json", + ], + "rules": { + "notice/notice": "off", + }, + }, + { + "files": [ + "api/**/*", + "pages/api/**/*", + "src/pages/api/**/*", + ], + "rules": { + "no-console": "off", + }, + }, + { + "files": [ + "**/*.{story,stories}.*", + ], + "rules": { + "import/no-anonymous-default-export": "off", + "import/no-extraneous-dependencies": "off", + "no-alert": "off", + }, + }, + { + "files": [ + "**/*spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + ], + "rules": { + "import/no-extraneous-dependencies": "off", + "react/display-name": "off", + "react/prop-types": "off", + }, + }, + { + "files": [ + "**/*.spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + ], + "rules": { + "node/no-extraneous-require": "off", + "node/no-missing-require": "off", + "node/no-unpublished-import": "off", + "node/no-unpublished-require": "off", + }, + }, + { + "env": { + "jest/globals": true, + }, + "extends": [ + "plugin:jest/recommended", + ], + "files": [ + "**/*.spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + "**/*Fixtures.*", + "**/__fixtures__/**/*", + "**/__mocks__/**/*", + ], + "plugins": [ + "jest", + ], + }, + ], + "parser": "@babel/eslint-parser", + "parserOptions": { + "allowImportExportEverywhere": true, + "ecmaFeatures": { + "impliedStrict": true, + "modules": true, + }, + "ecmaVersion": 6, + "sourceType": "module", + }, + "plugins": [ + "prettier", + ], + "root": true, + "rules": { + "comma-dangle": "off", + "curly": [ + "error", + "all", + ], + "function-paren-newline": "off", + "implicit-arrow-linebreak": "off", + "import/extensions": "off", + "import/no-cycle": [ + "error", + { + "maxDepth": 7, + }, + ], + "import/order": [ + "error", + { + "newlines-between": "always", + }, + ], + "import/prefer-default-export": "off", + "indent": "off", + "max-len": [ + "error", + { + "code": 80, + "ignoreComments": true, + "ignorePattern": "^(?:import\\s|export\\s|\\s*it(?:\\.(?:skip|only))?\\()", + "ignoreRegExpLiterals": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true, + "ignoreUrls": true, + "tabWidth": 2, + }, + ], + "no-confusing-arrow": "off", + "no-underscore-dangle": "error", + "no-use-before-define": "off", + "no-void": [ + "error", + { + "allowAsStatement": true, + }, + ], + "node/no-extraneous-import": "off", + "node/no-missing-import": "off", + "node/no-unsupported-features/es-syntax": "off", + "object-curly-newline": "off", + "operator-linebreak": "off", + "quote-props": "off", + }, + "settings": { + "import/resolver": { + "node": { + "extensions": [ + ".js", + ".jsx", + ".ts", + ".tsx", + ], + }, + }, + "polyfills": [ + "Array.prototype.copyWithin", + "Array.prototype.fill", + "Array.prototype.find", + "Array.prototype.findIndex", + "Array.prototype.flagMap", + "Array.prototype.flat", + "Array.from", + "Array.prototype.includes", + "Array.of", + "Function.name", + "Map", + "Number.EPSILON", + "Number.isFinite", + "Number.isInteger", + "Number.isNaN", + "Number.isSafeInteger", + "Number.MAX_SAFE_INTEGER", + "Number.MIN_SAFE_INTEGER", + "Number.parseFloat", + "Number.parseInt", + "Object.assign", + "Object.entries", + "Object.getOwnPropertyDescriptors", + "Object.keys", + "Object.is", + "Object.values", + "Reflect", + "RegExp", + "Set", + "Symbol", + "String.prototype.codePointAt", + "String.prototype.endsWith", + "String.prototype.fromCodePoint", + "String.prototype.includes", + "String.prototype.padStart", + "String.prototype.padEnd", + "String.prototype.raw", + "String.prototype.repeat", + "String.prototype.startsWith", + "String.prototype.trimLeft", + "String.prototype.trimRight", + "URL", + "URLSearchParams", + "WeakMap", + "WeakSet", + "Promise", + "fetch", + ], + }, +} +`; + +exports[`eslint > with options > should return a config for { language: 'JavaScript', environments: [ 'Node' ], frameworks: [ 'Next.js' ], plugins: [ 'Next.js' ] } 1`] = ` +{ + "env": { + "node": true, + }, + "extends": [ + "eslint:recommended", + "plugin:prettier/recommended", + "airbnb-base", + "plugin:node/recommended", + "plugin:security/recommended", + "next", + ], + "overrides": [ + { + "extends": [ + "plugin:json/recommended", + ], + "files": [ + "**/*.json", + ], + "rules": { + "notice/notice": "off", + }, + }, + { + "files": [ + "api/**/*", + "pages/api/**/*", + "src/pages/api/**/*", + ], + "rules": { + "no-console": "off", + }, + }, + { + "files": [ + "**/*.{story,stories}.*", + ], + "rules": { + "import/no-anonymous-default-export": "off", + "import/no-extraneous-dependencies": "off", + "no-alert": "off", + }, + }, + { + "files": [ + "**/*spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + ], + "rules": { + "import/no-extraneous-dependencies": "off", + "react/display-name": "off", + "react/prop-types": "off", + }, + }, + { + "files": [ + "**/*.spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + ], + "rules": { + "node/no-extraneous-require": "off", + "node/no-missing-require": "off", + "node/no-unpublished-import": "off", + "node/no-unpublished-require": "off", + }, + }, + ], + "parser": "@babel/eslint-parser", + "parserOptions": { + "allowImportExportEverywhere": true, + "ecmaFeatures": { + "impliedStrict": true, + "modules": true, + }, + "ecmaVersion": 6, + "sourceType": "module", + }, + "plugins": [ + "prettier", + ], + "root": true, + "rules": { + "comma-dangle": "off", + "curly": [ + "error", + "all", + ], + "function-paren-newline": "off", + "implicit-arrow-linebreak": "off", + "import/extensions": "off", + "import/no-cycle": [ + "error", + { + "maxDepth": 7, + }, + ], + "import/order": [ + "error", + { + "newlines-between": "always", + }, + ], + "import/prefer-default-export": "off", + "indent": "off", + "max-len": [ + "error", + { + "code": 80, + "ignoreComments": true, + "ignorePattern": "^(?:import\\s|export\\s|\\s*it(?:\\.(?:skip|only))?\\()", + "ignoreRegExpLiterals": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true, + "ignoreUrls": true, + "tabWidth": 2, + }, + ], + "no-confusing-arrow": "off", + "no-underscore-dangle": "error", + "no-use-before-define": "off", + "no-void": [ + "error", + { + "allowAsStatement": true, + }, + ], + "node/no-extraneous-import": "off", + "node/no-missing-import": "off", + "node/no-unsupported-features/es-syntax": "off", + "object-curly-newline": "off", + "operator-linebreak": "off", + "quote-props": "off", + }, + "settings": { + "import/resolver": { + "node": { + "extensions": [ + ".js", + ".jsx", + ".ts", + ".tsx", + ], + }, + }, + "polyfills": [ + "Array.prototype.copyWithin", + "Array.prototype.fill", + "Array.prototype.find", + "Array.prototype.findIndex", + "Array.prototype.flagMap", + "Array.prototype.flat", + "Array.from", + "Array.prototype.includes", + "Array.of", + "Function.name", + "Map", + "Number.EPSILON", + "Number.isFinite", + "Number.isInteger", + "Number.isNaN", + "Number.isSafeInteger", + "Number.MAX_SAFE_INTEGER", + "Number.MIN_SAFE_INTEGER", + "Number.parseFloat", + "Number.parseInt", + "Object.assign", + "Object.entries", + "Object.getOwnPropertyDescriptors", + "Object.keys", + "Object.is", + "Object.values", + "Reflect", + "RegExp", + "Set", + "Symbol", + "String.prototype.codePointAt", + "String.prototype.endsWith", + "String.prototype.fromCodePoint", + "String.prototype.includes", + "String.prototype.padStart", + "String.prototype.padEnd", + "String.prototype.raw", + "String.prototype.repeat", + "String.prototype.startsWith", + "String.prototype.trimLeft", + "String.prototype.trimRight", + "URL", + "URLSearchParams", + "WeakMap", + "WeakSet", + "Promise", + "fetch", + ], + }, +} +`; + +exports[`eslint > with options > should return a config for { language: 'JavaScript', environments: [ 'Node' ], frameworks: [ 'Next.js' ], plugins: [ 'Playwright' ] } 1`] = ` +{ + "env": { + "node": true, + }, + "extends": [ + "eslint:recommended", + "plugin:prettier/recommended", + "airbnb-base", + "plugin:node/recommended", + "plugin:security/recommended", + ], + "overrides": [ + { + "extends": [ + "plugin:json/recommended", + ], + "files": [ + "**/*.json", + ], + "rules": { + "notice/notice": "off", + }, + }, + { + "files": [ + "api/**/*", + "pages/api/**/*", + "src/pages/api/**/*", + ], + "rules": { + "no-console": "off", + }, + }, + { + "files": [ + "**/*.{story,stories}.*", + ], + "rules": { + "import/no-anonymous-default-export": "off", + "import/no-extraneous-dependencies": "off", + "no-alert": "off", + }, + }, + { + "files": [ + "**/*spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + ], + "rules": { + "import/no-extraneous-dependencies": "off", + "react/display-name": "off", + "react/prop-types": "off", + }, + }, + { + "files": [ + "**/*.spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + ], + "rules": { + "node/no-extraneous-require": "off", + "node/no-missing-require": "off", + "node/no-unpublished-import": "off", + "node/no-unpublished-require": "off", + }, + }, + { + "extends": [ + "plugin:playwright/playwright-test", + ], + "files": [ + "**/*spec.*", + "e2e/**/*", + "tests/**/*", + ], + }, + ], + "parser": "@babel/eslint-parser", + "parserOptions": { + "allowImportExportEverywhere": true, + "ecmaFeatures": { + "impliedStrict": true, + "modules": true, + }, + "ecmaVersion": 6, + "sourceType": "module", + }, + "plugins": [ + "prettier", + ], + "root": true, + "rules": { + "comma-dangle": "off", + "curly": [ + "error", + "all", + ], + "function-paren-newline": "off", + "implicit-arrow-linebreak": "off", + "import/extensions": "off", + "import/no-cycle": [ + "error", + { + "maxDepth": 7, + }, + ], + "import/order": [ + "error", + { + "newlines-between": "always", + }, + ], + "import/prefer-default-export": "off", + "indent": "off", + "max-len": [ + "error", + { + "code": 80, + "ignoreComments": true, + "ignorePattern": "^(?:import\\s|export\\s|\\s*it(?:\\.(?:skip|only))?\\()", + "ignoreRegExpLiterals": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true, + "ignoreUrls": true, + "tabWidth": 2, + }, + ], + "no-confusing-arrow": "off", + "no-underscore-dangle": "error", + "no-use-before-define": "off", + "no-void": [ + "error", + { + "allowAsStatement": true, + }, + ], + "node/no-extraneous-import": "off", + "node/no-missing-import": "off", + "node/no-unsupported-features/es-syntax": "off", + "object-curly-newline": "off", + "operator-linebreak": "off", + "quote-props": "off", + }, + "settings": { + "import/resolver": { + "node": { + "extensions": [ + ".js", + ".jsx", + ".ts", + ".tsx", + ], + }, + }, + "polyfills": [ + "Array.prototype.copyWithin", + "Array.prototype.fill", + "Array.prototype.find", + "Array.prototype.findIndex", + "Array.prototype.flagMap", + "Array.prototype.flat", + "Array.from", + "Array.prototype.includes", + "Array.of", + "Function.name", + "Map", + "Number.EPSILON", + "Number.isFinite", + "Number.isInteger", + "Number.isNaN", + "Number.isSafeInteger", + "Number.MAX_SAFE_INTEGER", + "Number.MIN_SAFE_INTEGER", + "Number.parseFloat", + "Number.parseInt", + "Object.assign", + "Object.entries", + "Object.getOwnPropertyDescriptors", + "Object.keys", + "Object.is", + "Object.values", + "Reflect", + "RegExp", + "Set", + "Symbol", + "String.prototype.codePointAt", + "String.prototype.endsWith", + "String.prototype.fromCodePoint", + "String.prototype.includes", + "String.prototype.padStart", + "String.prototype.padEnd", + "String.prototype.raw", + "String.prototype.repeat", + "String.prototype.startsWith", + "String.prototype.trimLeft", + "String.prototype.trimRight", + "URL", + "URLSearchParams", + "WeakMap", + "WeakSet", + "Promise", + "fetch", + ], + }, +} +`; + +exports[`eslint > with options > should return a config for { language: 'JavaScript', environments: [ 'Node' ], frameworks: [ 'Next.js' ], plugins: [ 'Storybook' ] } 1`] = ` +{ + "env": { + "node": true, + }, + "extends": [ + "eslint:recommended", + "plugin:prettier/recommended", + "airbnb-base", + "plugin:node/recommended", + "plugin:security/recommended", + "plugin:storybook/recommended", + ], + "overrides": [ + { + "extends": [ + "plugin:json/recommended", + ], + "files": [ + "**/*.json", + ], + "rules": { + "notice/notice": "off", + }, + }, + { + "files": [ + "api/**/*", + "pages/api/**/*", + "src/pages/api/**/*", + ], + "rules": { + "no-console": "off", + }, + }, + { + "files": [ + "**/*.{story,stories}.*", + ], + "rules": { + "import/no-anonymous-default-export": "off", + "import/no-extraneous-dependencies": "off", + "no-alert": "off", + }, + }, + { + "files": [ + "**/*spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + ], + "rules": { + "import/no-extraneous-dependencies": "off", + "react/display-name": "off", + "react/prop-types": "off", + }, + }, + { + "files": [ + "**/*.spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + ], + "rules": { + "node/no-extraneous-require": "off", + "node/no-missing-require": "off", + "node/no-unpublished-import": "off", + "node/no-unpublished-require": "off", + }, + }, + ], + "parser": "@babel/eslint-parser", + "parserOptions": { + "allowImportExportEverywhere": true, + "ecmaFeatures": { + "impliedStrict": true, + "modules": true, + }, + "ecmaVersion": 6, + "sourceType": "module", + }, + "plugins": [ + "prettier", + ], + "root": true, + "rules": { + "comma-dangle": "off", + "curly": [ + "error", + "all", + ], + "function-paren-newline": "off", + "implicit-arrow-linebreak": "off", + "import/extensions": "off", + "import/no-cycle": [ + "error", + { + "maxDepth": 7, + }, + ], + "import/order": [ + "error", + { + "newlines-between": "always", + }, + ], + "import/prefer-default-export": "off", + "indent": "off", + "max-len": [ + "error", + { + "code": 80, + "ignoreComments": true, + "ignorePattern": "^(?:import\\s|export\\s|\\s*it(?:\\.(?:skip|only))?\\()", + "ignoreRegExpLiterals": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true, + "ignoreUrls": true, + "tabWidth": 2, + }, + ], + "no-confusing-arrow": "off", + "no-underscore-dangle": "error", + "no-use-before-define": "off", + "no-void": [ + "error", + { + "allowAsStatement": true, + }, + ], + "node/no-extraneous-import": "off", + "node/no-missing-import": "off", + "node/no-unsupported-features/es-syntax": "off", + "object-curly-newline": "off", + "operator-linebreak": "off", + "quote-props": "off", + }, + "settings": { + "import/resolver": { + "node": { + "extensions": [ + ".js", + ".jsx", + ".ts", + ".tsx", + ], + }, + }, + "polyfills": [ + "Array.prototype.copyWithin", + "Array.prototype.fill", + "Array.prototype.find", + "Array.prototype.findIndex", + "Array.prototype.flagMap", + "Array.prototype.flat", + "Array.from", + "Array.prototype.includes", + "Array.of", + "Function.name", + "Map", + "Number.EPSILON", + "Number.isFinite", + "Number.isInteger", + "Number.isNaN", + "Number.isSafeInteger", + "Number.MAX_SAFE_INTEGER", + "Number.MIN_SAFE_INTEGER", + "Number.parseFloat", + "Number.parseInt", + "Object.assign", + "Object.entries", + "Object.getOwnPropertyDescriptors", + "Object.keys", + "Object.is", + "Object.values", + "Reflect", + "RegExp", + "Set", + "Symbol", + "String.prototype.codePointAt", + "String.prototype.endsWith", + "String.prototype.fromCodePoint", + "String.prototype.includes", + "String.prototype.padStart", + "String.prototype.padEnd", + "String.prototype.raw", + "String.prototype.repeat", + "String.prototype.startsWith", + "String.prototype.trimLeft", + "String.prototype.trimRight", + "URL", + "URLSearchParams", + "WeakMap", + "WeakSet", + "Promise", + "fetch", + ], + }, +} +`; + +exports[`eslint > with options > should return a config for { language: 'JavaScript', environments: [ 'Node' ], frameworks: [ 'Next.js' ], plugins: [ 'Testing Library' ] } 1`] = ` +{ + "env": { + "node": true, + }, + "extends": [ + "eslint:recommended", + "plugin:prettier/recommended", + "airbnb-base", + "plugin:node/recommended", + "plugin:security/recommended", + ], + "overrides": [ + { + "extends": [ + "plugin:json/recommended", + ], + "files": [ + "**/*.json", + ], + "rules": { + "notice/notice": "off", + }, + }, + { + "files": [ + "api/**/*", + "pages/api/**/*", + "src/pages/api/**/*", + ], + "rules": { + "no-console": "off", + }, + }, + { + "files": [ + "**/*.{story,stories}.*", + ], + "rules": { + "import/no-anonymous-default-export": "off", + "import/no-extraneous-dependencies": "off", + "no-alert": "off", + }, + }, + { + "files": [ + "**/*spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + ], + "rules": { + "import/no-extraneous-dependencies": "off", + "react/display-name": "off", + "react/prop-types": "off", + }, + }, + { + "files": [ + "**/*.spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + ], + "rules": { + "node/no-extraneous-require": "off", + "node/no-missing-require": "off", + "node/no-unpublished-import": "off", + "node/no-unpublished-require": "off", + }, + }, + { + "extends": [ + "plugin:testing-library/react", + ], + "files": [ + "**/*.spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + "**/*Fixtures.*", + "**/__fixtures__/**/*", + "**/__mocks__/**/*", + ], + "plugins": [ + "testing-library", + ], + }, + ], + "parser": "@babel/eslint-parser", + "parserOptions": { + "allowImportExportEverywhere": true, + "ecmaFeatures": { + "impliedStrict": true, + "modules": true, + }, + "ecmaVersion": 6, + "sourceType": "module", + }, + "plugins": [ + "prettier", + ], + "root": true, + "rules": { + "comma-dangle": "off", + "curly": [ + "error", + "all", + ], + "function-paren-newline": "off", + "implicit-arrow-linebreak": "off", + "import/extensions": "off", + "import/no-cycle": [ + "error", + { + "maxDepth": 7, + }, + ], + "import/order": [ + "error", + { + "newlines-between": "always", + }, + ], + "import/prefer-default-export": "off", + "indent": "off", + "max-len": [ + "error", + { + "code": 80, + "ignoreComments": true, + "ignorePattern": "^(?:import\\s|export\\s|\\s*it(?:\\.(?:skip|only))?\\()", + "ignoreRegExpLiterals": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true, + "ignoreUrls": true, + "tabWidth": 2, + }, + ], + "no-confusing-arrow": "off", + "no-underscore-dangle": "error", + "no-use-before-define": "off", + "no-void": [ + "error", + { + "allowAsStatement": true, + }, + ], + "node/no-extraneous-import": "off", + "node/no-missing-import": "off", + "node/no-unsupported-features/es-syntax": "off", + "object-curly-newline": "off", + "operator-linebreak": "off", + "quote-props": "off", + }, + "settings": { + "import/resolver": { + "node": { + "extensions": [ + ".js", + ".jsx", + ".ts", + ".tsx", + ], + }, + }, + "polyfills": [ + "Array.prototype.copyWithin", + "Array.prototype.fill", + "Array.prototype.find", + "Array.prototype.findIndex", + "Array.prototype.flagMap", + "Array.prototype.flat", + "Array.from", + "Array.prototype.includes", + "Array.of", + "Function.name", + "Map", + "Number.EPSILON", + "Number.isFinite", + "Number.isInteger", + "Number.isNaN", + "Number.isSafeInteger", + "Number.MAX_SAFE_INTEGER", + "Number.MIN_SAFE_INTEGER", + "Number.parseFloat", + "Number.parseInt", + "Object.assign", + "Object.entries", + "Object.getOwnPropertyDescriptors", + "Object.keys", + "Object.is", + "Object.values", + "Reflect", + "RegExp", + "Set", + "Symbol", + "String.prototype.codePointAt", + "String.prototype.endsWith", + "String.prototype.fromCodePoint", + "String.prototype.includes", + "String.prototype.padStart", + "String.prototype.padEnd", + "String.prototype.raw", + "String.prototype.repeat", + "String.prototype.startsWith", + "String.prototype.trimLeft", + "String.prototype.trimRight", + "URL", + "URLSearchParams", + "WeakMap", + "WeakSet", + "Promise", + "fetch", + ], + }, +} +`; + +exports[`eslint > with options > should return a config for { language: 'JavaScript', environments: [ 'Node' ], frameworks: [ 'React' ], plugins: [ 'Cypress' ] } 1`] = ` +{ + "env": { + "node": true, + }, + "extends": [ + "eslint:recommended", + "plugin:prettier/recommended", + "airbnb-base", + "plugin:node/recommended", + "plugin:security/recommended", + "plugin:react/recommended", + "plugin:react-hooks/recommended", + "plugin:jsx-a11y/recommended", + ], + "overrides": [ + { + "extends": [ + "plugin:json/recommended", + ], + "files": [ + "**/*.json", + ], + "rules": { + "notice/notice": "off", + }, + }, + { + "files": [ + "api/**/*", + "pages/api/**/*", + "src/pages/api/**/*", + ], + "rules": { + "no-console": "off", + }, + }, + { + "files": [ + "**/*.{story,stories}.*", + ], + "rules": { + "import/no-anonymous-default-export": "off", + "import/no-extraneous-dependencies": "off", + "no-alert": "off", + }, + }, + { + "files": [ + "**/*spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + ], + "rules": { + "import/no-extraneous-dependencies": "off", + "react/display-name": "off", + "react/prop-types": "off", + }, + }, + { + "files": [ + "**/*.spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + ], + "rules": { + "node/no-extraneous-require": "off", + "node/no-missing-require": "off", + "node/no-unpublished-import": "off", + "node/no-unpublished-require": "off", + }, + }, + { + "env": { + "cypress/globals": true, + }, + "extends": [ + "plugin:cypress/recommended", + ], + "files": [ + "**/*spec.*", + "e2e/**/*", + "tests/**/*", + ], + "plugins": [ + "cypress", + ], + }, + ], + "parser": "@babel/eslint-parser", + "parserOptions": { + "allowImportExportEverywhere": true, + "ecmaFeatures": { + "impliedStrict": true, + "jsx": true, + "modules": true, + }, + "ecmaVersion": 6, + "sourceType": "module", + }, + "plugins": [ + "prettier", + "react", + "react-hooks", + "jsx-a11y", + ], + "root": true, + "rules": { + "comma-dangle": "off", + "curly": [ + "error", + "all", + ], + "function-paren-newline": "off", + "implicit-arrow-linebreak": "off", + "import/extensions": "off", + "import/no-cycle": [ + "error", + { + "maxDepth": 7, + }, + ], + "import/order": [ + "error", + { + "newlines-between": "always", + }, + ], + "import/prefer-default-export": "off", + "indent": "off", + "max-len": [ + "error", + { + "code": 80, + "ignoreComments": true, + "ignorePattern": "^(?:import\\s|export\\s|\\s*it(?:\\.(?:skip|only))?\\()", + "ignoreRegExpLiterals": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true, + "ignoreUrls": true, + "tabWidth": 2, + }, + ], + "no-confusing-arrow": "off", + "no-underscore-dangle": "error", + "no-use-before-define": "off", + "no-void": [ + "error", + { + "allowAsStatement": true, + }, + ], + "node/no-extraneous-import": "off", + "node/no-missing-import": "off", + "node/no-unsupported-features/es-syntax": "off", + "object-curly-newline": "off", + "operator-linebreak": "off", + "quote-props": "off", + "react/display-name": "off", + "react/react-in-jsx-scope": "off", + }, + "settings": { + "import/resolver": { + "node": { + "extensions": [ + ".js", + ".jsx", + ".ts", + ".tsx", + ], + }, + }, + "react": { + "version": "detect", + }, + }, +} +`; + +exports[`eslint > with options > should return a config for { language: 'JavaScript', environments: [ 'Node' ], frameworks: [ 'React' ], plugins: [ 'Emotion' ] } 1`] = ` +{ + "env": { + "node": true, + }, + "extends": [ + "eslint:recommended", + "plugin:prettier/recommended", + "airbnb-base", + "plugin:node/recommended", + "plugin:security/recommended", + "plugin:react/recommended", + "plugin:react-hooks/recommended", + "plugin:jsx-a11y/recommended", + ], + "overrides": [ + { + "extends": [ + "plugin:json/recommended", + ], + "files": [ + "**/*.json", + ], + "rules": { + "notice/notice": "off", + }, + }, + { + "files": [ + "api/**/*", + "pages/api/**/*", + "src/pages/api/**/*", + ], + "rules": { + "no-console": "off", + }, + }, + { + "files": [ + "**/*.{story,stories}.*", + ], + "rules": { + "import/no-anonymous-default-export": "off", + "import/no-extraneous-dependencies": "off", + "no-alert": "off", + }, + }, + { + "files": [ + "**/*spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + ], + "rules": { + "import/no-extraneous-dependencies": "off", + "react/display-name": "off", + "react/prop-types": "off", + }, + }, + { + "files": [ + "**/*.spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + ], + "rules": { + "node/no-extraneous-require": "off", + "node/no-missing-require": "off", + "node/no-unpublished-import": "off", + "node/no-unpublished-require": "off", + }, + }, + ], + "parser": "@babel/eslint-parser", + "parserOptions": { + "allowImportExportEverywhere": true, + "ecmaFeatures": { + "impliedStrict": true, + "jsx": true, + "modules": true, + }, + "ecmaVersion": 6, + "sourceType": "module", + }, + "plugins": [ + "prettier", + "react", + "react-hooks", + "jsx-a11y", + "@emotion", + ], + "root": true, + "rules": { + "@emotion/import-from-emotion": "error", + "@emotion/jsx-import": "off", + "@emotion/no-vanilla": "error", + "@emotion/pkg-renaming": "error", + "@emotion/styled-import": "error", + "comma-dangle": "off", + "curly": [ + "error", + "all", + ], + "function-paren-newline": "off", + "implicit-arrow-linebreak": "off", + "import/extensions": "off", + "import/no-cycle": [ + "error", + { + "maxDepth": 7, + }, + ], + "import/order": [ + "error", + { + "newlines-between": "always", + }, + ], + "import/prefer-default-export": "off", + "indent": "off", + "max-len": [ + "error", + { + "code": 80, + "ignoreComments": true, + "ignorePattern": "^(?:import\\s|export\\s|\\s*it(?:\\.(?:skip|only))?\\()", + "ignoreRegExpLiterals": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true, + "ignoreUrls": true, + "tabWidth": 2, + }, + ], + "no-confusing-arrow": "off", + "no-underscore-dangle": "error", + "no-use-before-define": "off", + "no-void": [ + "error", + { + "allowAsStatement": true, + }, + ], + "node/no-extraneous-import": "off", + "node/no-missing-import": "off", + "node/no-unsupported-features/es-syntax": "off", + "object-curly-newline": "off", + "operator-linebreak": "off", + "quote-props": "off", + "react/display-name": "off", + "react/no-unknown-property": [ + "error", + { + "ignore": [ + "css", + ], + }, + ], + "react/react-in-jsx-scope": "off", + }, + "settings": { + "import/resolver": { + "node": { + "extensions": [ + ".js", + ".jsx", + ".ts", + ".tsx", + ], + }, + }, + "react": { + "version": "detect", + }, + }, +} +`; + +exports[`eslint > with options > should return a config for { language: 'JavaScript', environments: [ 'Node' ], frameworks: [ 'React' ], plugins: [ 'Jest' ] } 1`] = ` +{ + "env": { + "node": true, + }, + "extends": [ + "eslint:recommended", + "plugin:prettier/recommended", + "airbnb-base", + "plugin:node/recommended", + "plugin:security/recommended", + "plugin:react/recommended", + "plugin:react-hooks/recommended", + "plugin:jsx-a11y/recommended", + ], + "overrides": [ + { + "extends": [ + "plugin:json/recommended", + ], + "files": [ + "**/*.json", + ], + "rules": { + "notice/notice": "off", + }, + }, + { + "files": [ + "api/**/*", + "pages/api/**/*", + "src/pages/api/**/*", + ], + "rules": { + "no-console": "off", + }, + }, + { + "files": [ + "**/*.{story,stories}.*", + ], + "rules": { + "import/no-anonymous-default-export": "off", + "import/no-extraneous-dependencies": "off", + "no-alert": "off", + }, + }, + { + "files": [ + "**/*spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + ], + "rules": { + "import/no-extraneous-dependencies": "off", + "react/display-name": "off", + "react/prop-types": "off", + }, + }, + { + "files": [ + "**/*.spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + ], + "rules": { + "node/no-extraneous-require": "off", + "node/no-missing-require": "off", + "node/no-unpublished-import": "off", + "node/no-unpublished-require": "off", + }, + }, + { + "env": { + "jest/globals": true, + }, + "extends": [ + "plugin:jest/recommended", + ], + "files": [ + "**/*.spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + "**/*Fixtures.*", + "**/__fixtures__/**/*", + "**/__mocks__/**/*", + ], + "plugins": [ + "jest", + ], + }, + ], + "parser": "@babel/eslint-parser", + "parserOptions": { + "allowImportExportEverywhere": true, + "ecmaFeatures": { + "impliedStrict": true, + "jsx": true, + "modules": true, + }, + "ecmaVersion": 6, + "sourceType": "module", + }, + "plugins": [ + "prettier", + "react", + "react-hooks", + "jsx-a11y", + ], + "root": true, + "rules": { + "comma-dangle": "off", + "curly": [ + "error", + "all", + ], + "function-paren-newline": "off", + "implicit-arrow-linebreak": "off", + "import/extensions": "off", + "import/no-cycle": [ + "error", + { + "maxDepth": 7, + }, + ], + "import/order": [ + "error", + { + "newlines-between": "always", + }, + ], + "import/prefer-default-export": "off", + "indent": "off", + "max-len": [ + "error", + { + "code": 80, + "ignoreComments": true, + "ignorePattern": "^(?:import\\s|export\\s|\\s*it(?:\\.(?:skip|only))?\\()", + "ignoreRegExpLiterals": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true, + "ignoreUrls": true, + "tabWidth": 2, + }, + ], + "no-confusing-arrow": "off", + "no-underscore-dangle": "error", + "no-use-before-define": "off", + "no-void": [ + "error", + { + "allowAsStatement": true, + }, + ], + "node/no-extraneous-import": "off", + "node/no-missing-import": "off", + "node/no-unsupported-features/es-syntax": "off", + "object-curly-newline": "off", + "operator-linebreak": "off", + "quote-props": "off", + "react/display-name": "off", + "react/react-in-jsx-scope": "off", + }, + "settings": { + "import/resolver": { + "node": { + "extensions": [ + ".js", + ".jsx", + ".ts", + ".tsx", + ], + }, + }, + "react": { + "version": "detect", + }, + }, +} +`; + +exports[`eslint > with options > should return a config for { language: 'JavaScript', environments: [ 'Node' ], frameworks: [ 'React' ], plugins: [ 'Next.js' ] } 1`] = ` +{ + "env": { + "node": true, + }, + "extends": [ + "eslint:recommended", + "plugin:prettier/recommended", + "airbnb-base", + "plugin:node/recommended", + "plugin:security/recommended", + "plugin:react/recommended", + "plugin:react-hooks/recommended", + "plugin:jsx-a11y/recommended", + "next", + ], + "overrides": [ + { + "extends": [ + "plugin:json/recommended", + ], + "files": [ + "**/*.json", + ], + "rules": { + "notice/notice": "off", + }, + }, + { + "files": [ + "api/**/*", + "pages/api/**/*", + "src/pages/api/**/*", + ], + "rules": { + "no-console": "off", + }, + }, + { + "files": [ + "**/*.{story,stories}.*", + ], + "rules": { + "import/no-anonymous-default-export": "off", + "import/no-extraneous-dependencies": "off", + "no-alert": "off", + }, + }, + { + "files": [ + "**/*spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + ], + "rules": { + "import/no-extraneous-dependencies": "off", + "react/display-name": "off", + "react/prop-types": "off", + }, + }, + { + "files": [ + "**/*.spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + ], + "rules": { + "node/no-extraneous-require": "off", + "node/no-missing-require": "off", + "node/no-unpublished-import": "off", + "node/no-unpublished-require": "off", + }, + }, + ], + "parser": "@babel/eslint-parser", + "parserOptions": { + "allowImportExportEverywhere": true, + "ecmaFeatures": { + "impliedStrict": true, + "jsx": true, + "modules": true, + }, + "ecmaVersion": 6, + "sourceType": "module", + }, + "plugins": [ + "prettier", + "react", + "react-hooks", + "jsx-a11y", + ], + "root": true, + "rules": { + "comma-dangle": "off", + "curly": [ + "error", + "all", + ], + "function-paren-newline": "off", + "implicit-arrow-linebreak": "off", + "import/extensions": "off", + "import/no-cycle": [ + "error", + { + "maxDepth": 7, + }, + ], + "import/order": [ + "error", + { + "newlines-between": "always", + }, + ], + "import/prefer-default-export": "off", + "indent": "off", + "max-len": [ + "error", + { + "code": 80, + "ignoreComments": true, + "ignorePattern": "^(?:import\\s|export\\s|\\s*it(?:\\.(?:skip|only))?\\()", + "ignoreRegExpLiterals": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true, + "ignoreUrls": true, + "tabWidth": 2, + }, + ], + "no-confusing-arrow": "off", + "no-underscore-dangle": "error", + "no-use-before-define": "off", + "no-void": [ + "error", + { + "allowAsStatement": true, + }, + ], + "node/no-extraneous-import": "off", + "node/no-missing-import": "off", + "node/no-unsupported-features/es-syntax": "off", + "object-curly-newline": "off", + "operator-linebreak": "off", + "quote-props": "off", + "react/display-name": "off", + "react/react-in-jsx-scope": "off", + }, + "settings": { + "import/resolver": { + "node": { + "extensions": [ + ".js", + ".jsx", + ".ts", + ".tsx", + ], + }, + }, + "react": { + "version": "detect", + }, + }, +} +`; + +exports[`eslint > with options > should return a config for { language: 'JavaScript', environments: [ 'Node' ], frameworks: [ 'React' ], plugins: [ 'Playwright' ] } 1`] = ` +{ + "env": { + "node": true, + }, + "extends": [ + "eslint:recommended", + "plugin:prettier/recommended", + "airbnb-base", + "plugin:node/recommended", + "plugin:security/recommended", + "plugin:react/recommended", + "plugin:react-hooks/recommended", + "plugin:jsx-a11y/recommended", + ], + "overrides": [ + { + "extends": [ + "plugin:json/recommended", + ], + "files": [ + "**/*.json", + ], + "rules": { + "notice/notice": "off", + }, + }, + { + "files": [ + "api/**/*", + "pages/api/**/*", + "src/pages/api/**/*", + ], + "rules": { + "no-console": "off", + }, + }, + { + "files": [ + "**/*.{story,stories}.*", + ], + "rules": { + "import/no-anonymous-default-export": "off", + "import/no-extraneous-dependencies": "off", + "no-alert": "off", + }, + }, + { + "files": [ + "**/*spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + ], + "rules": { + "import/no-extraneous-dependencies": "off", + "react/display-name": "off", + "react/prop-types": "off", + }, + }, + { + "files": [ + "**/*.spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + ], + "rules": { + "node/no-extraneous-require": "off", + "node/no-missing-require": "off", + "node/no-unpublished-import": "off", + "node/no-unpublished-require": "off", + }, + }, + { + "extends": [ + "plugin:playwright/playwright-test", + ], + "files": [ + "**/*spec.*", + "e2e/**/*", + "tests/**/*", + ], + }, + ], + "parser": "@babel/eslint-parser", + "parserOptions": { + "allowImportExportEverywhere": true, + "ecmaFeatures": { + "impliedStrict": true, + "jsx": true, + "modules": true, + }, + "ecmaVersion": 6, + "sourceType": "module", + }, + "plugins": [ + "prettier", + "react", + "react-hooks", + "jsx-a11y", + ], + "root": true, + "rules": { + "comma-dangle": "off", + "curly": [ + "error", + "all", + ], + "function-paren-newline": "off", + "implicit-arrow-linebreak": "off", + "import/extensions": "off", + "import/no-cycle": [ + "error", + { + "maxDepth": 7, + }, + ], + "import/order": [ + "error", + { + "newlines-between": "always", + }, + ], + "import/prefer-default-export": "off", + "indent": "off", + "max-len": [ + "error", + { + "code": 80, + "ignoreComments": true, + "ignorePattern": "^(?:import\\s|export\\s|\\s*it(?:\\.(?:skip|only))?\\()", + "ignoreRegExpLiterals": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true, + "ignoreUrls": true, + "tabWidth": 2, + }, + ], + "no-confusing-arrow": "off", + "no-underscore-dangle": "error", + "no-use-before-define": "off", + "no-void": [ + "error", + { + "allowAsStatement": true, + }, + ], + "node/no-extraneous-import": "off", + "node/no-missing-import": "off", + "node/no-unsupported-features/es-syntax": "off", + "object-curly-newline": "off", + "operator-linebreak": "off", + "quote-props": "off", + "react/display-name": "off", + "react/react-in-jsx-scope": "off", + }, + "settings": { + "import/resolver": { + "node": { + "extensions": [ + ".js", + ".jsx", + ".ts", + ".tsx", + ], + }, + }, + "react": { + "version": "detect", + }, + }, +} +`; + +exports[`eslint > with options > should return a config for { language: 'JavaScript', environments: [ 'Node' ], frameworks: [ 'React' ], plugins: [ 'Storybook' ] } 1`] = ` +{ + "env": { + "node": true, + }, + "extends": [ + "eslint:recommended", + "plugin:prettier/recommended", + "airbnb-base", + "plugin:node/recommended", + "plugin:security/recommended", + "plugin:react/recommended", + "plugin:react-hooks/recommended", + "plugin:jsx-a11y/recommended", + "plugin:storybook/recommended", + ], + "overrides": [ + { + "extends": [ + "plugin:json/recommended", + ], + "files": [ + "**/*.json", + ], + "rules": { + "notice/notice": "off", + }, + }, + { + "files": [ + "api/**/*", + "pages/api/**/*", + "src/pages/api/**/*", + ], + "rules": { + "no-console": "off", + }, + }, + { + "files": [ + "**/*.{story,stories}.*", + ], + "rules": { + "import/no-anonymous-default-export": "off", + "import/no-extraneous-dependencies": "off", + "no-alert": "off", + }, + }, + { + "files": [ + "**/*spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + ], + "rules": { + "import/no-extraneous-dependencies": "off", + "react/display-name": "off", + "react/prop-types": "off", + }, + }, + { + "files": [ + "**/*.spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + ], + "rules": { + "node/no-extraneous-require": "off", + "node/no-missing-require": "off", + "node/no-unpublished-import": "off", + "node/no-unpublished-require": "off", + }, + }, + ], + "parser": "@babel/eslint-parser", + "parserOptions": { + "allowImportExportEverywhere": true, + "ecmaFeatures": { + "impliedStrict": true, + "jsx": true, + "modules": true, + }, + "ecmaVersion": 6, + "sourceType": "module", + }, + "plugins": [ + "prettier", + "react", + "react-hooks", + "jsx-a11y", + ], + "root": true, + "rules": { + "comma-dangle": "off", + "curly": [ + "error", + "all", + ], + "function-paren-newline": "off", + "implicit-arrow-linebreak": "off", + "import/extensions": "off", + "import/no-cycle": [ + "error", + { + "maxDepth": 7, + }, + ], + "import/order": [ + "error", + { + "newlines-between": "always", + }, + ], + "import/prefer-default-export": "off", + "indent": "off", + "max-len": [ + "error", + { + "code": 80, + "ignoreComments": true, + "ignorePattern": "^(?:import\\s|export\\s|\\s*it(?:\\.(?:skip|only))?\\()", + "ignoreRegExpLiterals": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true, + "ignoreUrls": true, + "tabWidth": 2, + }, + ], + "no-confusing-arrow": "off", + "no-underscore-dangle": "error", + "no-use-before-define": "off", + "no-void": [ + "error", + { + "allowAsStatement": true, + }, + ], + "node/no-extraneous-import": "off", + "node/no-missing-import": "off", + "node/no-unsupported-features/es-syntax": "off", + "object-curly-newline": "off", + "operator-linebreak": "off", + "quote-props": "off", + "react/display-name": "off", + "react/react-in-jsx-scope": "off", + }, + "settings": { + "import/resolver": { + "node": { + "extensions": [ + ".js", + ".jsx", + ".ts", + ".tsx", + ], + }, + }, + "react": { + "version": "detect", + }, + }, +} +`; + +exports[`eslint > with options > should return a config for { language: 'JavaScript', environments: [ 'Node' ], frameworks: [ 'React' ], plugins: [ 'Testing Library' ] } 1`] = ` +{ + "env": { + "node": true, + }, + "extends": [ + "eslint:recommended", + "plugin:prettier/recommended", + "airbnb-base", + "plugin:node/recommended", + "plugin:security/recommended", + "plugin:react/recommended", + "plugin:react-hooks/recommended", + "plugin:jsx-a11y/recommended", + ], + "overrides": [ + { + "extends": [ + "plugin:json/recommended", + ], + "files": [ + "**/*.json", + ], + "rules": { + "notice/notice": "off", + }, + }, + { + "files": [ + "api/**/*", + "pages/api/**/*", + "src/pages/api/**/*", + ], + "rules": { + "no-console": "off", + }, + }, + { + "files": [ + "**/*.{story,stories}.*", + ], + "rules": { + "import/no-anonymous-default-export": "off", + "import/no-extraneous-dependencies": "off", + "no-alert": "off", + }, + }, + { + "files": [ + "**/*spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + ], + "rules": { + "import/no-extraneous-dependencies": "off", + "react/display-name": "off", + "react/prop-types": "off", + }, + }, + { + "files": [ + "**/*.spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + ], + "rules": { + "node/no-extraneous-require": "off", + "node/no-missing-require": "off", + "node/no-unpublished-import": "off", + "node/no-unpublished-require": "off", + }, + }, + { + "extends": [ + "plugin:testing-library/react", + ], + "files": [ + "**/*.spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + "**/*Fixtures.*", + "**/__fixtures__/**/*", + "**/__mocks__/**/*", + ], + "plugins": [ + "testing-library", + ], + }, + ], + "parser": "@babel/eslint-parser", + "parserOptions": { + "allowImportExportEverywhere": true, + "ecmaFeatures": { + "impliedStrict": true, + "jsx": true, + "modules": true, + }, + "ecmaVersion": 6, + "sourceType": "module", + }, + "plugins": [ + "prettier", + "react", + "react-hooks", + "jsx-a11y", + ], + "root": true, + "rules": { + "comma-dangle": "off", + "curly": [ + "error", + "all", + ], + "function-paren-newline": "off", + "implicit-arrow-linebreak": "off", + "import/extensions": "off", + "import/no-cycle": [ + "error", + { + "maxDepth": 7, + }, + ], + "import/order": [ + "error", + { + "newlines-between": "always", + }, + ], + "import/prefer-default-export": "off", + "indent": "off", + "max-len": [ + "error", + { + "code": 80, + "ignoreComments": true, + "ignorePattern": "^(?:import\\s|export\\s|\\s*it(?:\\.(?:skip|only))?\\()", + "ignoreRegExpLiterals": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true, + "ignoreUrls": true, + "tabWidth": 2, + }, + ], + "no-confusing-arrow": "off", + "no-underscore-dangle": "error", + "no-use-before-define": "off", + "no-void": [ + "error", + { + "allowAsStatement": true, + }, + ], + "node/no-extraneous-import": "off", + "node/no-missing-import": "off", + "node/no-unsupported-features/es-syntax": "off", + "object-curly-newline": "off", + "operator-linebreak": "off", + "quote-props": "off", + "react/display-name": "off", + "react/react-in-jsx-scope": "off", + }, + "settings": { + "import/resolver": { + "node": { + "extensions": [ + ".js", + ".jsx", + ".ts", + ".tsx", + ], + }, + }, + "react": { + "version": "detect", + }, + }, +} +`; + +exports[`eslint > with options > should return a config for { language: 'TypeScript', environments: [ 'Browser' ], frameworks: [ 'Next.js' ], plugins: [ 'Cypress' ] } 1`] = ` +{ + "env": { + "browser": true, + }, + "extends": [ + "eslint:recommended", + "plugin:prettier/recommended", + "airbnb-base", + "plugin:compat/recommended", + ], + "overrides": [ + { + "extends": [ + "plugin:json/recommended", + ], + "files": [ + "**/*.json", + ], + "rules": { + "notice/notice": "off", + }, + }, + { + "files": [ + "api/**/*", + "pages/api/**/*", + "src/pages/api/**/*", + ], + "rules": { + "no-console": "off", + }, + }, + { + "extends": [ + "airbnb-typescript/base", + "plugin:@typescript-eslint/eslint-recommended", + "plugin:@typescript-eslint/recommended", + "plugin:@typescript-eslint/recommended-requiring-type-checking", + ], + "files": [ + "**/*.{ts,tsx}", + ], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaFeatures": { + "modules": true, + }, + "ecmaVersion": 6, + "extraFileExtensions": [ + ".json", + ], + "project": [ + "./tsconfig.json", + ], + "sourceType": "module", + "tsconfigRootDir": "/project/dir", + }, + "plugins": [ + "@typescript-eslint", + ], + "rules": { + "@typescript-eslint/explicit-function-return-type": "off", + "@typescript-eslint/indent": "off", + "@typescript-eslint/no-misused-promises": [ + "error", + { + "checksVoidReturn": false, + }, + ], + "@typescript-eslint/no-unused-vars": "error", + "@typescript-eslint/no-use-before-define": [ + "error", + { + "functions": false, + }, + ], + "comma-dangle": "off", + "curly": [ + "error", + "all", + ], + "function-paren-newline": "off", + "implicit-arrow-linebreak": "off", + "import/extensions": "off", + "import/no-cycle": [ + "error", + { + "maxDepth": 7, + }, + ], + "import/order": [ + "error", + { + "newlines-between": "always", + }, + ], + "import/prefer-default-export": "off", + "indent": "off", + "max-len": [ + "error", + { + "code": 80, + "ignoreComments": true, + "ignorePattern": "^(?:import\\s|export\\s|\\s*it(?:\\.(?:skip|only))?\\()", + "ignoreRegExpLiterals": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true, + "ignoreUrls": true, + "tabWidth": 2, + }, + ], + "no-confusing-arrow": "off", + "no-underscore-dangle": "error", + "no-use-before-define": "off", + "no-void": [ + "error", + { + "allowAsStatement": true, + }, + ], + "object-curly-newline": "off", + "operator-linebreak": "off", + "quote-props": "off", + "react/prop-types": "off", + }, + }, + { + "files": [ + "**/*.d.ts", + ], + "rules": { + "import/no-extraneous-dependencies": [ + "error", + { + "devDependencies": true, + }, + ], + "node/no-extraneous-import": "off", + "spaced-comment": "off", + }, + }, + { + "files": [ + "**/*.{story,stories}.{ts,tsx}", + ], + "rules": { + "@typescript-eslint/explicit-module-boundary-types": "off", + }, + }, + { + "files": [ + "**/*spec.{ts,tsx}", + "**/setupTests.{ts,tsx}", + "**/test-utils.{ts,tsx}", + ], + "rules": { + "@typescript-eslint/no-empty-function": "off", + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-unsafe-assignment": "off", + "@typescript-eslint/no-var-requires": "off", + "@typescript-eslint/unbound-method": "off", + }, + }, + { + "files": [ + "**/*.{story,stories}.*", + ], + "rules": { + "import/no-anonymous-default-export": "off", + "import/no-extraneous-dependencies": "off", + "no-alert": "off", + }, + }, + { + "files": [ + "**/*spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + ], + "rules": { + "import/no-extraneous-dependencies": "off", + "react/display-name": "off", + "react/prop-types": "off", + }, + }, + { + "files": [ + "**/*.spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + "**/*Fixtures.*", + "**/__fixtures__/**/*", + "**/__mocks__/**/*", + "api/**/*", + "pages/api/**/*", + "src/pages/api/**/*", + ], + "rules": { + "compat/compat": "off", + }, + }, + { + "env": { + "cypress/globals": true, + }, + "extends": [ + "plugin:cypress/recommended", + ], + "files": [ + "**/*spec.*", + "e2e/**/*", + "tests/**/*", + ], + "plugins": [ + "cypress", + ], + }, + ], + "parser": "@babel/eslint-parser", + "parserOptions": { + "allowImportExportEverywhere": true, + "ecmaFeatures": { + "impliedStrict": true, + "modules": true, + }, + "ecmaVersion": 6, + "sourceType": "module", + }, + "plugins": [ + "prettier", + ], + "root": true, + "rules": { + "comma-dangle": "off", + "curly": [ + "error", + "all", + ], + "function-paren-newline": "off", + "implicit-arrow-linebreak": "off", + "import/extensions": "off", + "import/no-cycle": [ + "error", + { + "maxDepth": 7, + }, + ], + "import/order": [ + "error", + { + "newlines-between": "always", + }, + ], + "import/prefer-default-export": "off", + "indent": "off", + "max-len": [ + "error", + { + "code": 80, + "ignoreComments": true, + "ignorePattern": "^(?:import\\s|export\\s|\\s*it(?:\\.(?:skip|only))?\\()", + "ignoreRegExpLiterals": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true, + "ignoreUrls": true, + "tabWidth": 2, + }, + ], + "no-confusing-arrow": "off", + "no-underscore-dangle": "error", + "no-use-before-define": "off", + "no-void": [ + "error", + { + "allowAsStatement": true, + }, + ], + "object-curly-newline": "off", + "operator-linebreak": "off", + "quote-props": "off", + }, + "settings": { + "import/resolver": { + "node": { + "extensions": [ + ".js", + ".jsx", + ".ts", + ".tsx", + ], + }, + }, + "lintAllEsApis": true, + "polyfills": [ + "document.body", + "Array.prototype.copyWithin", + "Array.prototype.fill", + "Array.prototype.find", + "Array.prototype.findIndex", + "Array.prototype.flagMap", + "Array.prototype.flat", + "Array.from", + "Array.prototype.includes", + "Array.of", + "Function.name", + "Map", + "Number.EPSILON", + "Number.isFinite", + "Number.isInteger", + "Number.isNaN", + "Number.isSafeInteger", + "Number.MAX_SAFE_INTEGER", + "Number.MIN_SAFE_INTEGER", + "Number.parseFloat", + "Number.parseInt", + "Object.assign", + "Object.entries", + "Object.getOwnPropertyDescriptors", + "Object.keys", + "Object.is", + "Object.values", + "Reflect", + "RegExp", + "Set", + "Symbol", + "String.prototype.codePointAt", + "String.prototype.endsWith", + "String.prototype.fromCodePoint", + "String.prototype.includes", + "String.prototype.padStart", + "String.prototype.padEnd", + "String.prototype.raw", + "String.prototype.repeat", + "String.prototype.startsWith", + "String.prototype.trimLeft", + "String.prototype.trimRight", + "URL", + "URLSearchParams", + "WeakMap", + "WeakSet", + "Promise", + "fetch", + ], + }, +} +`; + +exports[`eslint > with options > should return a config for { language: 'TypeScript', environments: [ 'Browser' ], frameworks: [ 'Next.js' ], plugins: [ 'Emotion' ] } 1`] = ` +{ + "env": { + "browser": true, + }, + "extends": [ + "eslint:recommended", + "plugin:prettier/recommended", + "airbnb-base", + "plugin:compat/recommended", + ], + "overrides": [ + { + "extends": [ + "plugin:json/recommended", + ], + "files": [ + "**/*.json", + ], + "rules": { + "notice/notice": "off", + }, + }, + { + "files": [ + "api/**/*", + "pages/api/**/*", + "src/pages/api/**/*", + ], + "rules": { + "no-console": "off", + }, + }, + { + "extends": [ + "airbnb-typescript/base", + "plugin:@typescript-eslint/eslint-recommended", + "plugin:@typescript-eslint/recommended", + "plugin:@typescript-eslint/recommended-requiring-type-checking", + ], + "files": [ + "**/*.{ts,tsx}", + ], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaFeatures": { + "modules": true, + }, + "ecmaVersion": 6, + "extraFileExtensions": [ + ".json", + ], + "project": [ + "./tsconfig.json", + ], + "sourceType": "module", + "tsconfigRootDir": "/project/dir", + }, + "plugins": [ + "@typescript-eslint", + ], + "rules": { + "@typescript-eslint/explicit-function-return-type": "off", + "@typescript-eslint/indent": "off", + "@typescript-eslint/no-misused-promises": [ + "error", + { + "checksVoidReturn": false, + }, + ], + "@typescript-eslint/no-unused-vars": "error", + "@typescript-eslint/no-use-before-define": [ + "error", + { + "functions": false, + }, + ], + "comma-dangle": "off", + "curly": [ + "error", + "all", + ], + "function-paren-newline": "off", + "implicit-arrow-linebreak": "off", + "import/extensions": "off", + "import/no-cycle": [ + "error", + { + "maxDepth": 7, + }, + ], + "import/order": [ + "error", + { + "newlines-between": "always", + }, + ], + "import/prefer-default-export": "off", + "indent": "off", + "max-len": [ + "error", + { + "code": 80, + "ignoreComments": true, + "ignorePattern": "^(?:import\\s|export\\s|\\s*it(?:\\.(?:skip|only))?\\()", + "ignoreRegExpLiterals": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true, + "ignoreUrls": true, + "tabWidth": 2, + }, + ], + "no-confusing-arrow": "off", + "no-underscore-dangle": "error", + "no-use-before-define": "off", + "no-void": [ + "error", + { + "allowAsStatement": true, + }, + ], + "object-curly-newline": "off", + "operator-linebreak": "off", + "quote-props": "off", + "react/prop-types": "off", + }, + }, + { + "files": [ + "**/*.d.ts", + ], + "rules": { + "import/no-extraneous-dependencies": [ + "error", + { + "devDependencies": true, + }, + ], + "node/no-extraneous-import": "off", + "spaced-comment": "off", + }, + }, + { + "files": [ + "**/*.{story,stories}.{ts,tsx}", + ], + "rules": { + "@typescript-eslint/explicit-module-boundary-types": "off", + }, + }, + { + "files": [ + "**/*spec.{ts,tsx}", + "**/setupTests.{ts,tsx}", + "**/test-utils.{ts,tsx}", + ], + "rules": { + "@typescript-eslint/no-empty-function": "off", + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-unsafe-assignment": "off", + "@typescript-eslint/no-var-requires": "off", + "@typescript-eslint/unbound-method": "off", + }, + }, + { + "files": [ + "**/*.{story,stories}.*", + ], + "rules": { + "import/no-anonymous-default-export": "off", + "import/no-extraneous-dependencies": "off", + "no-alert": "off", + }, + }, + { + "files": [ + "**/*spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + ], + "rules": { + "import/no-extraneous-dependencies": "off", + "react/display-name": "off", + "react/prop-types": "off", + }, + }, + { + "files": [ + "**/*.spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + "**/*Fixtures.*", + "**/__fixtures__/**/*", + "**/__mocks__/**/*", + "api/**/*", + "pages/api/**/*", + "src/pages/api/**/*", + ], + "rules": { + "compat/compat": "off", + }, + }, + ], + "parser": "@babel/eslint-parser", + "parserOptions": { + "allowImportExportEverywhere": true, + "ecmaFeatures": { + "impliedStrict": true, + "modules": true, + }, + "ecmaVersion": 6, + "sourceType": "module", + }, + "plugins": [ + "prettier", + "@emotion", + ], + "root": true, + "rules": { + "@emotion/import-from-emotion": "error", + "@emotion/jsx-import": "off", + "@emotion/no-vanilla": "error", + "@emotion/pkg-renaming": "error", + "@emotion/styled-import": "error", + "comma-dangle": "off", + "curly": [ + "error", + "all", + ], + "function-paren-newline": "off", + "implicit-arrow-linebreak": "off", + "import/extensions": "off", + "import/no-cycle": [ + "error", + { + "maxDepth": 7, + }, + ], + "import/order": [ + "error", + { + "newlines-between": "always", + }, + ], + "import/prefer-default-export": "off", + "indent": "off", + "max-len": [ + "error", + { + "code": 80, + "ignoreComments": true, + "ignorePattern": "^(?:import\\s|export\\s|\\s*it(?:\\.(?:skip|only))?\\()", + "ignoreRegExpLiterals": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true, + "ignoreUrls": true, + "tabWidth": 2, + }, + ], + "no-confusing-arrow": "off", + "no-underscore-dangle": "error", + "no-use-before-define": "off", + "no-void": [ + "error", + { + "allowAsStatement": true, + }, + ], + "object-curly-newline": "off", + "operator-linebreak": "off", + "quote-props": "off", + "react/no-unknown-property": [ + "error", + { + "ignore": [ + "css", + ], + }, + ], + }, + "settings": { + "import/resolver": { + "node": { + "extensions": [ + ".js", + ".jsx", + ".ts", + ".tsx", + ], + }, + }, + "lintAllEsApis": true, + "polyfills": [ + "document.body", + "Array.prototype.copyWithin", + "Array.prototype.fill", + "Array.prototype.find", + "Array.prototype.findIndex", + "Array.prototype.flagMap", + "Array.prototype.flat", + "Array.from", + "Array.prototype.includes", + "Array.of", + "Function.name", + "Map", + "Number.EPSILON", + "Number.isFinite", + "Number.isInteger", + "Number.isNaN", + "Number.isSafeInteger", + "Number.MAX_SAFE_INTEGER", + "Number.MIN_SAFE_INTEGER", + "Number.parseFloat", + "Number.parseInt", + "Object.assign", + "Object.entries", + "Object.getOwnPropertyDescriptors", + "Object.keys", + "Object.is", + "Object.values", + "Reflect", + "RegExp", + "Set", + "Symbol", + "String.prototype.codePointAt", + "String.prototype.endsWith", + "String.prototype.fromCodePoint", + "String.prototype.includes", + "String.prototype.padStart", + "String.prototype.padEnd", + "String.prototype.raw", + "String.prototype.repeat", + "String.prototype.startsWith", + "String.prototype.trimLeft", + "String.prototype.trimRight", + "URL", + "URLSearchParams", + "WeakMap", + "WeakSet", + "Promise", + "fetch", + ], + }, +} +`; + +exports[`eslint > with options > should return a config for { language: 'TypeScript', environments: [ 'Browser' ], frameworks: [ 'Next.js' ], plugins: [ 'Jest' ] } 1`] = ` +{ + "env": { + "browser": true, + }, + "extends": [ + "eslint:recommended", + "plugin:prettier/recommended", + "airbnb-base", + "plugin:compat/recommended", + ], + "overrides": [ + { + "extends": [ + "plugin:json/recommended", + ], + "files": [ + "**/*.json", + ], + "rules": { + "notice/notice": "off", + }, + }, + { + "files": [ + "api/**/*", + "pages/api/**/*", + "src/pages/api/**/*", + ], + "rules": { + "no-console": "off", + }, + }, + { + "extends": [ + "airbnb-typescript/base", + "plugin:@typescript-eslint/eslint-recommended", + "plugin:@typescript-eslint/recommended", + "plugin:@typescript-eslint/recommended-requiring-type-checking", + ], + "files": [ + "**/*.{ts,tsx}", + ], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaFeatures": { + "modules": true, + }, + "ecmaVersion": 6, + "extraFileExtensions": [ + ".json", + ], + "project": [ + "./tsconfig.json", + ], + "sourceType": "module", + "tsconfigRootDir": "/project/dir", + }, + "plugins": [ + "@typescript-eslint", + ], + "rules": { + "@typescript-eslint/explicit-function-return-type": "off", + "@typescript-eslint/indent": "off", + "@typescript-eslint/no-misused-promises": [ + "error", + { + "checksVoidReturn": false, + }, + ], + "@typescript-eslint/no-unused-vars": "error", + "@typescript-eslint/no-use-before-define": [ + "error", + { + "functions": false, + }, + ], + "comma-dangle": "off", + "curly": [ + "error", + "all", + ], + "function-paren-newline": "off", + "implicit-arrow-linebreak": "off", + "import/extensions": "off", + "import/no-cycle": [ + "error", + { + "maxDepth": 7, + }, + ], + "import/order": [ + "error", + { + "newlines-between": "always", + }, + ], + "import/prefer-default-export": "off", + "indent": "off", + "max-len": [ + "error", + { + "code": 80, + "ignoreComments": true, + "ignorePattern": "^(?:import\\s|export\\s|\\s*it(?:\\.(?:skip|only))?\\()", + "ignoreRegExpLiterals": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true, + "ignoreUrls": true, + "tabWidth": 2, + }, + ], + "no-confusing-arrow": "off", + "no-underscore-dangle": "error", + "no-use-before-define": "off", + "no-void": [ + "error", + { + "allowAsStatement": true, + }, + ], + "object-curly-newline": "off", + "operator-linebreak": "off", + "quote-props": "off", + "react/prop-types": "off", + }, + }, + { + "files": [ + "**/*.d.ts", + ], + "rules": { + "import/no-extraneous-dependencies": [ + "error", + { + "devDependencies": true, + }, + ], + "node/no-extraneous-import": "off", + "spaced-comment": "off", + }, + }, + { + "files": [ + "**/*.{story,stories}.{ts,tsx}", + ], + "rules": { + "@typescript-eslint/explicit-module-boundary-types": "off", + }, + }, + { + "files": [ + "**/*spec.{ts,tsx}", + "**/setupTests.{ts,tsx}", + "**/test-utils.{ts,tsx}", + ], + "rules": { + "@typescript-eslint/no-empty-function": "off", + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-unsafe-assignment": "off", + "@typescript-eslint/no-var-requires": "off", + "@typescript-eslint/unbound-method": "off", + }, + }, + { + "files": [ + "**/*.{story,stories}.*", + ], + "rules": { + "import/no-anonymous-default-export": "off", + "import/no-extraneous-dependencies": "off", + "no-alert": "off", + }, + }, + { + "files": [ + "**/*spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + ], + "rules": { + "import/no-extraneous-dependencies": "off", + "react/display-name": "off", + "react/prop-types": "off", + }, + }, + { + "files": [ + "**/*.spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + "**/*Fixtures.*", + "**/__fixtures__/**/*", + "**/__mocks__/**/*", + "api/**/*", + "pages/api/**/*", + "src/pages/api/**/*", + ], + "rules": { + "compat/compat": "off", + }, + }, + { + "env": { + "jest/globals": true, + }, + "extends": [ + "plugin:jest/recommended", + ], + "files": [ + "**/*.spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + "**/*Fixtures.*", + "**/__fixtures__/**/*", + "**/__mocks__/**/*", + ], + "plugins": [ + "jest", + ], + }, + ], + "parser": "@babel/eslint-parser", + "parserOptions": { + "allowImportExportEverywhere": true, + "ecmaFeatures": { + "impliedStrict": true, + "modules": true, + }, + "ecmaVersion": 6, + "sourceType": "module", + }, + "plugins": [ + "prettier", + ], + "root": true, + "rules": { + "comma-dangle": "off", + "curly": [ + "error", + "all", + ], + "function-paren-newline": "off", + "implicit-arrow-linebreak": "off", + "import/extensions": "off", + "import/no-cycle": [ + "error", + { + "maxDepth": 7, + }, + ], + "import/order": [ + "error", + { + "newlines-between": "always", + }, + ], + "import/prefer-default-export": "off", + "indent": "off", + "max-len": [ + "error", + { + "code": 80, + "ignoreComments": true, + "ignorePattern": "^(?:import\\s|export\\s|\\s*it(?:\\.(?:skip|only))?\\()", + "ignoreRegExpLiterals": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true, + "ignoreUrls": true, + "tabWidth": 2, + }, + ], + "no-confusing-arrow": "off", + "no-underscore-dangle": "error", + "no-use-before-define": "off", + "no-void": [ + "error", + { + "allowAsStatement": true, + }, + ], + "object-curly-newline": "off", + "operator-linebreak": "off", + "quote-props": "off", + }, + "settings": { + "import/resolver": { + "node": { + "extensions": [ + ".js", + ".jsx", + ".ts", + ".tsx", + ], + }, + }, + "lintAllEsApis": true, + "polyfills": [ + "document.body", + "Array.prototype.copyWithin", + "Array.prototype.fill", + "Array.prototype.find", + "Array.prototype.findIndex", + "Array.prototype.flagMap", + "Array.prototype.flat", + "Array.from", + "Array.prototype.includes", + "Array.of", + "Function.name", + "Map", + "Number.EPSILON", + "Number.isFinite", + "Number.isInteger", + "Number.isNaN", + "Number.isSafeInteger", + "Number.MAX_SAFE_INTEGER", + "Number.MIN_SAFE_INTEGER", + "Number.parseFloat", + "Number.parseInt", + "Object.assign", + "Object.entries", + "Object.getOwnPropertyDescriptors", + "Object.keys", + "Object.is", + "Object.values", + "Reflect", + "RegExp", + "Set", + "Symbol", + "String.prototype.codePointAt", + "String.prototype.endsWith", + "String.prototype.fromCodePoint", + "String.prototype.includes", + "String.prototype.padStart", + "String.prototype.padEnd", + "String.prototype.raw", + "String.prototype.repeat", + "String.prototype.startsWith", + "String.prototype.trimLeft", + "String.prototype.trimRight", + "URL", + "URLSearchParams", + "WeakMap", + "WeakSet", + "Promise", + "fetch", + ], + }, +} +`; + +exports[`eslint > with options > should return a config for { language: 'TypeScript', environments: [ 'Browser' ], frameworks: [ 'Next.js' ], plugins: [ 'Next.js' ] } 1`] = ` +{ + "env": { + "browser": true, + }, + "extends": [ + "eslint:recommended", + "plugin:prettier/recommended", + "airbnb-base", + "plugin:compat/recommended", + "next", + ], + "overrides": [ + { + "extends": [ + "plugin:json/recommended", + ], + "files": [ + "**/*.json", + ], + "rules": { + "notice/notice": "off", + }, + }, + { + "files": [ + "api/**/*", + "pages/api/**/*", + "src/pages/api/**/*", + ], + "rules": { + "no-console": "off", + }, + }, + { + "extends": [ + "airbnb-typescript/base", + "plugin:@typescript-eslint/eslint-recommended", + "plugin:@typescript-eslint/recommended", + "plugin:@typescript-eslint/recommended-requiring-type-checking", + ], + "files": [ + "**/*.{ts,tsx}", + ], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaFeatures": { + "modules": true, + }, + "ecmaVersion": 6, + "extraFileExtensions": [ + ".json", + ], + "project": [ + "./tsconfig.json", + ], + "sourceType": "module", + "tsconfigRootDir": "/project/dir", + }, + "plugins": [ + "@typescript-eslint", + ], + "rules": { + "@typescript-eslint/explicit-function-return-type": "off", + "@typescript-eslint/indent": "off", + "@typescript-eslint/no-misused-promises": [ + "error", + { + "checksVoidReturn": false, + }, + ], + "@typescript-eslint/no-unused-vars": "error", + "@typescript-eslint/no-use-before-define": [ + "error", + { + "functions": false, + }, + ], + "comma-dangle": "off", + "curly": [ + "error", + "all", + ], + "function-paren-newline": "off", + "implicit-arrow-linebreak": "off", + "import/extensions": "off", + "import/no-cycle": [ + "error", + { + "maxDepth": 7, + }, + ], + "import/order": [ + "error", + { + "newlines-between": "always", + }, + ], + "import/prefer-default-export": "off", + "indent": "off", + "max-len": [ + "error", + { + "code": 80, + "ignoreComments": true, + "ignorePattern": "^(?:import\\s|export\\s|\\s*it(?:\\.(?:skip|only))?\\()", + "ignoreRegExpLiterals": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true, + "ignoreUrls": true, + "tabWidth": 2, + }, + ], + "no-confusing-arrow": "off", + "no-underscore-dangle": "error", + "no-use-before-define": "off", + "no-void": [ + "error", + { + "allowAsStatement": true, + }, + ], + "object-curly-newline": "off", + "operator-linebreak": "off", + "quote-props": "off", + "react/prop-types": "off", + }, + }, + { + "files": [ + "**/*.d.ts", + ], + "rules": { + "import/no-extraneous-dependencies": [ + "error", + { + "devDependencies": true, + }, + ], + "node/no-extraneous-import": "off", + "spaced-comment": "off", + }, + }, + { + "files": [ + "**/*.{story,stories}.{ts,tsx}", + ], + "rules": { + "@typescript-eslint/explicit-module-boundary-types": "off", + }, + }, + { + "files": [ + "**/*spec.{ts,tsx}", + "**/setupTests.{ts,tsx}", + "**/test-utils.{ts,tsx}", + ], + "rules": { + "@typescript-eslint/no-empty-function": "off", + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-unsafe-assignment": "off", + "@typescript-eslint/no-var-requires": "off", + "@typescript-eslint/unbound-method": "off", + }, + }, + { + "files": [ + "**/*.{story,stories}.*", + ], + "rules": { + "import/no-anonymous-default-export": "off", + "import/no-extraneous-dependencies": "off", + "no-alert": "off", + }, + }, + { + "files": [ + "**/*spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + ], + "rules": { + "import/no-extraneous-dependencies": "off", + "react/display-name": "off", + "react/prop-types": "off", + }, + }, + { + "files": [ + "**/*.spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + "**/*Fixtures.*", + "**/__fixtures__/**/*", + "**/__mocks__/**/*", + "api/**/*", + "pages/api/**/*", + "src/pages/api/**/*", + ], + "rules": { + "compat/compat": "off", + }, + }, + ], + "parser": "@babel/eslint-parser", + "parserOptions": { + "allowImportExportEverywhere": true, + "ecmaFeatures": { + "impliedStrict": true, + "modules": true, + }, + "ecmaVersion": 6, + "sourceType": "module", + }, + "plugins": [ + "prettier", + ], + "root": true, + "rules": { + "comma-dangle": "off", + "curly": [ + "error", + "all", + ], + "function-paren-newline": "off", + "implicit-arrow-linebreak": "off", + "import/extensions": "off", + "import/no-cycle": [ + "error", + { + "maxDepth": 7, + }, + ], + "import/order": [ + "error", + { + "newlines-between": "always", + }, + ], + "import/prefer-default-export": "off", + "indent": "off", + "max-len": [ + "error", + { + "code": 80, + "ignoreComments": true, + "ignorePattern": "^(?:import\\s|export\\s|\\s*it(?:\\.(?:skip|only))?\\()", + "ignoreRegExpLiterals": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true, + "ignoreUrls": true, + "tabWidth": 2, + }, + ], + "no-confusing-arrow": "off", + "no-underscore-dangle": "error", + "no-use-before-define": "off", + "no-void": [ + "error", + { + "allowAsStatement": true, + }, + ], + "object-curly-newline": "off", + "operator-linebreak": "off", + "quote-props": "off", + }, + "settings": { + "import/resolver": { + "node": { + "extensions": [ + ".js", + ".jsx", + ".ts", + ".tsx", + ], + }, + }, + "lintAllEsApis": true, + "polyfills": [ + "document.body", + "Array.prototype.copyWithin", + "Array.prototype.fill", + "Array.prototype.find", + "Array.prototype.findIndex", + "Array.prototype.flagMap", + "Array.prototype.flat", + "Array.from", + "Array.prototype.includes", + "Array.of", + "Function.name", + "Map", + "Number.EPSILON", + "Number.isFinite", + "Number.isInteger", + "Number.isNaN", + "Number.isSafeInteger", + "Number.MAX_SAFE_INTEGER", + "Number.MIN_SAFE_INTEGER", + "Number.parseFloat", + "Number.parseInt", + "Object.assign", + "Object.entries", + "Object.getOwnPropertyDescriptors", + "Object.keys", + "Object.is", + "Object.values", + "Reflect", + "RegExp", + "Set", + "Symbol", + "String.prototype.codePointAt", + "String.prototype.endsWith", + "String.prototype.fromCodePoint", + "String.prototype.includes", + "String.prototype.padStart", + "String.prototype.padEnd", + "String.prototype.raw", + "String.prototype.repeat", + "String.prototype.startsWith", + "String.prototype.trimLeft", + "String.prototype.trimRight", + "URL", + "URLSearchParams", + "WeakMap", + "WeakSet", + "Promise", + "fetch", + ], + }, +} +`; + +exports[`eslint > with options > should return a config for { language: 'TypeScript', environments: [ 'Browser' ], frameworks: [ 'Next.js' ], plugins: [ 'Playwright' ] } 1`] = ` +{ + "env": { + "browser": true, + }, + "extends": [ + "eslint:recommended", + "plugin:prettier/recommended", + "airbnb-base", + "plugin:compat/recommended", + ], + "overrides": [ + { + "extends": [ + "plugin:json/recommended", + ], + "files": [ + "**/*.json", + ], + "rules": { + "notice/notice": "off", + }, + }, + { + "files": [ + "api/**/*", + "pages/api/**/*", + "src/pages/api/**/*", + ], + "rules": { + "no-console": "off", + }, + }, + { + "extends": [ + "airbnb-typescript/base", + "plugin:@typescript-eslint/eslint-recommended", + "plugin:@typescript-eslint/recommended", + "plugin:@typescript-eslint/recommended-requiring-type-checking", + ], + "files": [ + "**/*.{ts,tsx}", + ], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaFeatures": { + "modules": true, + }, + "ecmaVersion": 6, + "extraFileExtensions": [ + ".json", + ], + "project": [ + "./tsconfig.json", + ], + "sourceType": "module", + "tsconfigRootDir": "/project/dir", + }, + "plugins": [ + "@typescript-eslint", + ], + "rules": { + "@typescript-eslint/explicit-function-return-type": "off", + "@typescript-eslint/indent": "off", + "@typescript-eslint/no-misused-promises": [ + "error", + { + "checksVoidReturn": false, + }, + ], + "@typescript-eslint/no-unused-vars": "error", + "@typescript-eslint/no-use-before-define": [ + "error", + { + "functions": false, + }, + ], + "comma-dangle": "off", + "curly": [ + "error", + "all", + ], + "function-paren-newline": "off", + "implicit-arrow-linebreak": "off", + "import/extensions": "off", + "import/no-cycle": [ + "error", + { + "maxDepth": 7, + }, + ], + "import/order": [ + "error", + { + "newlines-between": "always", + }, + ], + "import/prefer-default-export": "off", + "indent": "off", + "max-len": [ + "error", + { + "code": 80, + "ignoreComments": true, + "ignorePattern": "^(?:import\\s|export\\s|\\s*it(?:\\.(?:skip|only))?\\()", + "ignoreRegExpLiterals": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true, + "ignoreUrls": true, + "tabWidth": 2, + }, + ], + "no-confusing-arrow": "off", + "no-underscore-dangle": "error", + "no-use-before-define": "off", + "no-void": [ + "error", + { + "allowAsStatement": true, + }, + ], + "object-curly-newline": "off", + "operator-linebreak": "off", + "quote-props": "off", + "react/prop-types": "off", + }, + }, + { + "files": [ + "**/*.d.ts", + ], + "rules": { + "import/no-extraneous-dependencies": [ + "error", + { + "devDependencies": true, + }, + ], + "node/no-extraneous-import": "off", + "spaced-comment": "off", + }, + }, + { + "files": [ + "**/*.{story,stories}.{ts,tsx}", + ], + "rules": { + "@typescript-eslint/explicit-module-boundary-types": "off", + }, + }, + { + "files": [ + "**/*spec.{ts,tsx}", + "**/setupTests.{ts,tsx}", + "**/test-utils.{ts,tsx}", + ], + "rules": { + "@typescript-eslint/no-empty-function": "off", + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-unsafe-assignment": "off", + "@typescript-eslint/no-var-requires": "off", + "@typescript-eslint/unbound-method": "off", + }, + }, + { + "files": [ + "**/*.{story,stories}.*", + ], + "rules": { + "import/no-anonymous-default-export": "off", + "import/no-extraneous-dependencies": "off", + "no-alert": "off", + }, + }, + { + "files": [ + "**/*spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + ], + "rules": { + "import/no-extraneous-dependencies": "off", + "react/display-name": "off", + "react/prop-types": "off", + }, + }, + { + "files": [ + "**/*.spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + "**/*Fixtures.*", + "**/__fixtures__/**/*", + "**/__mocks__/**/*", + "api/**/*", + "pages/api/**/*", + "src/pages/api/**/*", + ], + "rules": { + "compat/compat": "off", + }, + }, + { + "extends": [ + "plugin:playwright/playwright-test", + ], + "files": [ + "**/*spec.*", + "e2e/**/*", + "tests/**/*", + ], + }, + ], + "parser": "@babel/eslint-parser", + "parserOptions": { + "allowImportExportEverywhere": true, + "ecmaFeatures": { + "impliedStrict": true, + "modules": true, + }, + "ecmaVersion": 6, + "sourceType": "module", + }, + "plugins": [ + "prettier", + ], + "root": true, + "rules": { + "comma-dangle": "off", + "curly": [ + "error", + "all", + ], + "function-paren-newline": "off", + "implicit-arrow-linebreak": "off", + "import/extensions": "off", + "import/no-cycle": [ + "error", + { + "maxDepth": 7, + }, + ], + "import/order": [ + "error", + { + "newlines-between": "always", + }, + ], + "import/prefer-default-export": "off", + "indent": "off", + "max-len": [ + "error", + { + "code": 80, + "ignoreComments": true, + "ignorePattern": "^(?:import\\s|export\\s|\\s*it(?:\\.(?:skip|only))?\\()", + "ignoreRegExpLiterals": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true, + "ignoreUrls": true, + "tabWidth": 2, + }, + ], + "no-confusing-arrow": "off", + "no-underscore-dangle": "error", + "no-use-before-define": "off", + "no-void": [ + "error", + { + "allowAsStatement": true, + }, + ], + "object-curly-newline": "off", + "operator-linebreak": "off", + "quote-props": "off", + }, + "settings": { + "import/resolver": { + "node": { + "extensions": [ + ".js", + ".jsx", + ".ts", + ".tsx", + ], + }, + }, + "lintAllEsApis": true, + "polyfills": [ + "document.body", + "Array.prototype.copyWithin", + "Array.prototype.fill", + "Array.prototype.find", + "Array.prototype.findIndex", + "Array.prototype.flagMap", + "Array.prototype.flat", + "Array.from", + "Array.prototype.includes", + "Array.of", + "Function.name", + "Map", + "Number.EPSILON", + "Number.isFinite", + "Number.isInteger", + "Number.isNaN", + "Number.isSafeInteger", + "Number.MAX_SAFE_INTEGER", + "Number.MIN_SAFE_INTEGER", + "Number.parseFloat", + "Number.parseInt", + "Object.assign", + "Object.entries", + "Object.getOwnPropertyDescriptors", + "Object.keys", + "Object.is", + "Object.values", + "Reflect", + "RegExp", + "Set", + "Symbol", + "String.prototype.codePointAt", + "String.prototype.endsWith", + "String.prototype.fromCodePoint", + "String.prototype.includes", + "String.prototype.padStart", + "String.prototype.padEnd", + "String.prototype.raw", + "String.prototype.repeat", + "String.prototype.startsWith", + "String.prototype.trimLeft", + "String.prototype.trimRight", + "URL", + "URLSearchParams", + "WeakMap", + "WeakSet", + "Promise", + "fetch", + ], + }, +} +`; + +exports[`eslint > with options > should return a config for { language: 'TypeScript', environments: [ 'Browser' ], frameworks: [ 'Next.js' ], plugins: [ 'Storybook' ] } 1`] = ` +{ + "env": { + "browser": true, + }, + "extends": [ + "eslint:recommended", + "plugin:prettier/recommended", + "airbnb-base", + "plugin:compat/recommended", + "plugin:storybook/recommended", + ], + "overrides": [ + { + "extends": [ + "plugin:json/recommended", + ], + "files": [ + "**/*.json", + ], + "rules": { + "notice/notice": "off", + }, + }, + { + "files": [ + "api/**/*", + "pages/api/**/*", + "src/pages/api/**/*", + ], + "rules": { + "no-console": "off", + }, + }, + { + "extends": [ + "airbnb-typescript/base", + "plugin:@typescript-eslint/eslint-recommended", + "plugin:@typescript-eslint/recommended", + "plugin:@typescript-eslint/recommended-requiring-type-checking", + ], + "files": [ + "**/*.{ts,tsx}", + ], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaFeatures": { + "modules": true, + }, + "ecmaVersion": 6, + "extraFileExtensions": [ + ".json", + ], + "project": [ + "./tsconfig.json", + ], + "sourceType": "module", + "tsconfigRootDir": "/project/dir", + }, + "plugins": [ + "@typescript-eslint", + ], + "rules": { + "@typescript-eslint/explicit-function-return-type": "off", + "@typescript-eslint/indent": "off", + "@typescript-eslint/no-misused-promises": [ + "error", + { + "checksVoidReturn": false, + }, + ], + "@typescript-eslint/no-unused-vars": "error", + "@typescript-eslint/no-use-before-define": [ + "error", + { + "functions": false, + }, + ], + "comma-dangle": "off", + "curly": [ + "error", + "all", + ], + "function-paren-newline": "off", + "implicit-arrow-linebreak": "off", + "import/extensions": "off", + "import/no-cycle": [ + "error", + { + "maxDepth": 7, + }, + ], + "import/order": [ + "error", + { + "newlines-between": "always", + }, + ], + "import/prefer-default-export": "off", + "indent": "off", + "max-len": [ + "error", + { + "code": 80, + "ignoreComments": true, + "ignorePattern": "^(?:import\\s|export\\s|\\s*it(?:\\.(?:skip|only))?\\()", + "ignoreRegExpLiterals": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true, + "ignoreUrls": true, + "tabWidth": 2, + }, + ], + "no-confusing-arrow": "off", + "no-underscore-dangle": "error", + "no-use-before-define": "off", + "no-void": [ + "error", + { + "allowAsStatement": true, + }, + ], + "object-curly-newline": "off", + "operator-linebreak": "off", + "quote-props": "off", + "react/prop-types": "off", + }, + }, + { + "files": [ + "**/*.d.ts", + ], + "rules": { + "import/no-extraneous-dependencies": [ + "error", + { + "devDependencies": true, + }, + ], + "node/no-extraneous-import": "off", + "spaced-comment": "off", + }, + }, + { + "files": [ + "**/*.{story,stories}.{ts,tsx}", + ], + "rules": { + "@typescript-eslint/explicit-module-boundary-types": "off", + }, + }, + { + "files": [ + "**/*spec.{ts,tsx}", + "**/setupTests.{ts,tsx}", + "**/test-utils.{ts,tsx}", + ], + "rules": { + "@typescript-eslint/no-empty-function": "off", + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-unsafe-assignment": "off", + "@typescript-eslint/no-var-requires": "off", + "@typescript-eslint/unbound-method": "off", + }, + }, + { + "files": [ + "**/*.{story,stories}.*", + ], + "rules": { + "import/no-anonymous-default-export": "off", + "import/no-extraneous-dependencies": "off", + "no-alert": "off", + }, + }, + { + "files": [ + "**/*spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + ], + "rules": { + "import/no-extraneous-dependencies": "off", + "react/display-name": "off", + "react/prop-types": "off", + }, + }, + { + "files": [ + "**/*.spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + "**/*Fixtures.*", + "**/__fixtures__/**/*", + "**/__mocks__/**/*", + "api/**/*", + "pages/api/**/*", + "src/pages/api/**/*", + ], + "rules": { + "compat/compat": "off", + }, + }, + ], + "parser": "@babel/eslint-parser", + "parserOptions": { + "allowImportExportEverywhere": true, + "ecmaFeatures": { + "impliedStrict": true, + "modules": true, + }, + "ecmaVersion": 6, + "sourceType": "module", + }, + "plugins": [ + "prettier", + ], + "root": true, + "rules": { + "comma-dangle": "off", + "curly": [ + "error", + "all", + ], + "function-paren-newline": "off", + "implicit-arrow-linebreak": "off", + "import/extensions": "off", + "import/no-cycle": [ + "error", + { + "maxDepth": 7, + }, + ], + "import/order": [ + "error", + { + "newlines-between": "always", + }, + ], + "import/prefer-default-export": "off", + "indent": "off", + "max-len": [ + "error", + { + "code": 80, + "ignoreComments": true, + "ignorePattern": "^(?:import\\s|export\\s|\\s*it(?:\\.(?:skip|only))?\\()", + "ignoreRegExpLiterals": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true, + "ignoreUrls": true, + "tabWidth": 2, + }, + ], + "no-confusing-arrow": "off", + "no-underscore-dangle": "error", + "no-use-before-define": "off", + "no-void": [ + "error", + { + "allowAsStatement": true, + }, + ], + "object-curly-newline": "off", + "operator-linebreak": "off", + "quote-props": "off", + }, + "settings": { + "import/resolver": { + "node": { + "extensions": [ + ".js", + ".jsx", + ".ts", + ".tsx", + ], + }, + }, + "lintAllEsApis": true, + "polyfills": [ + "document.body", + "Array.prototype.copyWithin", + "Array.prototype.fill", + "Array.prototype.find", + "Array.prototype.findIndex", + "Array.prototype.flagMap", + "Array.prototype.flat", + "Array.from", + "Array.prototype.includes", + "Array.of", + "Function.name", + "Map", + "Number.EPSILON", + "Number.isFinite", + "Number.isInteger", + "Number.isNaN", + "Number.isSafeInteger", + "Number.MAX_SAFE_INTEGER", + "Number.MIN_SAFE_INTEGER", + "Number.parseFloat", + "Number.parseInt", + "Object.assign", + "Object.entries", + "Object.getOwnPropertyDescriptors", + "Object.keys", + "Object.is", + "Object.values", + "Reflect", + "RegExp", + "Set", + "Symbol", + "String.prototype.codePointAt", + "String.prototype.endsWith", + "String.prototype.fromCodePoint", + "String.prototype.includes", + "String.prototype.padStart", + "String.prototype.padEnd", + "String.prototype.raw", + "String.prototype.repeat", + "String.prototype.startsWith", + "String.prototype.trimLeft", + "String.prototype.trimRight", + "URL", + "URLSearchParams", + "WeakMap", + "WeakSet", + "Promise", + "fetch", + ], + }, +} +`; + +exports[`eslint > with options > should return a config for { language: 'TypeScript', environments: [ 'Browser' ], frameworks: [ 'Next.js' ], plugins: [ 'Testing Library' ] } 1`] = ` +{ + "env": { + "browser": true, + }, + "extends": [ + "eslint:recommended", + "plugin:prettier/recommended", + "airbnb-base", + "plugin:compat/recommended", + ], + "overrides": [ + { + "extends": [ + "plugin:json/recommended", + ], + "files": [ + "**/*.json", + ], + "rules": { + "notice/notice": "off", + }, + }, + { + "files": [ + "api/**/*", + "pages/api/**/*", + "src/pages/api/**/*", + ], + "rules": { + "no-console": "off", + }, + }, + { + "extends": [ + "airbnb-typescript/base", + "plugin:@typescript-eslint/eslint-recommended", + "plugin:@typescript-eslint/recommended", + "plugin:@typescript-eslint/recommended-requiring-type-checking", + ], + "files": [ + "**/*.{ts,tsx}", + ], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaFeatures": { + "modules": true, + }, + "ecmaVersion": 6, + "extraFileExtensions": [ + ".json", + ], + "project": [ + "./tsconfig.json", + ], + "sourceType": "module", + "tsconfigRootDir": "/project/dir", + }, + "plugins": [ + "@typescript-eslint", + ], + "rules": { + "@typescript-eslint/explicit-function-return-type": "off", + "@typescript-eslint/indent": "off", + "@typescript-eslint/no-misused-promises": [ + "error", + { + "checksVoidReturn": false, + }, + ], + "@typescript-eslint/no-unused-vars": "error", + "@typescript-eslint/no-use-before-define": [ + "error", + { + "functions": false, + }, + ], + "comma-dangle": "off", + "curly": [ + "error", + "all", + ], + "function-paren-newline": "off", + "implicit-arrow-linebreak": "off", + "import/extensions": "off", + "import/no-cycle": [ + "error", + { + "maxDepth": 7, + }, + ], + "import/order": [ + "error", + { + "newlines-between": "always", + }, + ], + "import/prefer-default-export": "off", + "indent": "off", + "max-len": [ + "error", + { + "code": 80, + "ignoreComments": true, + "ignorePattern": "^(?:import\\s|export\\s|\\s*it(?:\\.(?:skip|only))?\\()", + "ignoreRegExpLiterals": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true, + "ignoreUrls": true, + "tabWidth": 2, + }, + ], + "no-confusing-arrow": "off", + "no-underscore-dangle": "error", + "no-use-before-define": "off", + "no-void": [ + "error", + { + "allowAsStatement": true, + }, + ], + "object-curly-newline": "off", + "operator-linebreak": "off", + "quote-props": "off", + "react/prop-types": "off", + }, + }, + { + "files": [ + "**/*.d.ts", + ], + "rules": { + "import/no-extraneous-dependencies": [ + "error", + { + "devDependencies": true, + }, + ], + "node/no-extraneous-import": "off", + "spaced-comment": "off", + }, + }, + { + "files": [ + "**/*.{story,stories}.{ts,tsx}", + ], + "rules": { + "@typescript-eslint/explicit-module-boundary-types": "off", + }, + }, + { + "files": [ + "**/*spec.{ts,tsx}", + "**/setupTests.{ts,tsx}", + "**/test-utils.{ts,tsx}", + ], + "rules": { + "@typescript-eslint/no-empty-function": "off", + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-unsafe-assignment": "off", + "@typescript-eslint/no-var-requires": "off", + "@typescript-eslint/unbound-method": "off", + }, + }, + { + "files": [ + "**/*.{story,stories}.*", + ], + "rules": { + "import/no-anonymous-default-export": "off", + "import/no-extraneous-dependencies": "off", + "no-alert": "off", + }, + }, + { + "files": [ + "**/*spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + ], + "rules": { + "import/no-extraneous-dependencies": "off", + "react/display-name": "off", + "react/prop-types": "off", + }, + }, + { + "files": [ + "**/*.spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + "**/*Fixtures.*", + "**/__fixtures__/**/*", + "**/__mocks__/**/*", + "api/**/*", + "pages/api/**/*", + "src/pages/api/**/*", + ], + "rules": { + "compat/compat": "off", + }, + }, + { + "extends": [ + "plugin:testing-library/react", + ], + "files": [ + "**/*.spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + "**/*Fixtures.*", + "**/__fixtures__/**/*", + "**/__mocks__/**/*", + ], + "plugins": [ + "testing-library", + ], + }, + ], + "parser": "@babel/eslint-parser", + "parserOptions": { + "allowImportExportEverywhere": true, + "ecmaFeatures": { + "impliedStrict": true, + "modules": true, + }, + "ecmaVersion": 6, + "sourceType": "module", + }, + "plugins": [ + "prettier", + ], + "root": true, + "rules": { + "comma-dangle": "off", + "curly": [ + "error", + "all", + ], + "function-paren-newline": "off", + "implicit-arrow-linebreak": "off", + "import/extensions": "off", + "import/no-cycle": [ + "error", + { + "maxDepth": 7, + }, + ], + "import/order": [ + "error", + { + "newlines-between": "always", + }, + ], + "import/prefer-default-export": "off", + "indent": "off", + "max-len": [ + "error", + { + "code": 80, + "ignoreComments": true, + "ignorePattern": "^(?:import\\s|export\\s|\\s*it(?:\\.(?:skip|only))?\\()", + "ignoreRegExpLiterals": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true, + "ignoreUrls": true, + "tabWidth": 2, + }, + ], + "no-confusing-arrow": "off", + "no-underscore-dangle": "error", + "no-use-before-define": "off", + "no-void": [ + "error", + { + "allowAsStatement": true, + }, + ], + "object-curly-newline": "off", + "operator-linebreak": "off", + "quote-props": "off", + }, + "settings": { + "import/resolver": { + "node": { + "extensions": [ + ".js", + ".jsx", + ".ts", + ".tsx", + ], + }, + }, + "lintAllEsApis": true, + "polyfills": [ + "document.body", + "Array.prototype.copyWithin", + "Array.prototype.fill", + "Array.prototype.find", + "Array.prototype.findIndex", + "Array.prototype.flagMap", + "Array.prototype.flat", + "Array.from", + "Array.prototype.includes", + "Array.of", + "Function.name", + "Map", + "Number.EPSILON", + "Number.isFinite", + "Number.isInteger", + "Number.isNaN", + "Number.isSafeInteger", + "Number.MAX_SAFE_INTEGER", + "Number.MIN_SAFE_INTEGER", + "Number.parseFloat", + "Number.parseInt", + "Object.assign", + "Object.entries", + "Object.getOwnPropertyDescriptors", + "Object.keys", + "Object.is", + "Object.values", + "Reflect", + "RegExp", + "Set", + "Symbol", + "String.prototype.codePointAt", + "String.prototype.endsWith", + "String.prototype.fromCodePoint", + "String.prototype.includes", + "String.prototype.padStart", + "String.prototype.padEnd", + "String.prototype.raw", + "String.prototype.repeat", + "String.prototype.startsWith", + "String.prototype.trimLeft", + "String.prototype.trimRight", + "URL", + "URLSearchParams", + "WeakMap", + "WeakSet", + "Promise", + "fetch", + ], + }, +} +`; + +exports[`eslint > with options > should return a config for { language: 'TypeScript', environments: [ 'Browser' ], frameworks: [ 'React' ], plugins: [ 'Cypress' ] } 1`] = ` +{ + "env": { + "browser": true, + }, + "extends": [ + "eslint:recommended", + "plugin:prettier/recommended", + "airbnb-base", + "plugin:compat/recommended", + "plugin:react/recommended", + "plugin:react-hooks/recommended", + "plugin:jsx-a11y/recommended", + ], + "overrides": [ + { + "extends": [ + "plugin:json/recommended", + ], + "files": [ + "**/*.json", + ], + "rules": { + "notice/notice": "off", + }, + }, + { + "files": [ + "api/**/*", + "pages/api/**/*", + "src/pages/api/**/*", + ], + "rules": { + "no-console": "off", + }, + }, + { + "extends": [ + "airbnb-typescript/base", + "plugin:@typescript-eslint/eslint-recommended", + "plugin:@typescript-eslint/recommended", + "plugin:@typescript-eslint/recommended-requiring-type-checking", + ], + "files": [ + "**/*.{ts,tsx}", + ], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaFeatures": { + "modules": true, + }, + "ecmaVersion": 6, + "extraFileExtensions": [ + ".json", + ], + "project": [ + "./tsconfig.json", + ], + "sourceType": "module", + "tsconfigRootDir": "/project/dir", + }, + "plugins": [ + "@typescript-eslint", + ], + "rules": { + "@typescript-eslint/explicit-function-return-type": "off", + "@typescript-eslint/indent": "off", + "@typescript-eslint/no-misused-promises": [ + "error", + { + "checksVoidReturn": false, + }, + ], + "@typescript-eslint/no-unused-vars": "error", + "@typescript-eslint/no-use-before-define": [ + "error", + { + "functions": false, + }, + ], + "comma-dangle": "off", + "curly": [ + "error", + "all", + ], + "function-paren-newline": "off", + "implicit-arrow-linebreak": "off", + "import/extensions": "off", + "import/no-cycle": [ + "error", + { + "maxDepth": 7, + }, + ], + "import/order": [ + "error", + { + "newlines-between": "always", + }, + ], + "import/prefer-default-export": "off", + "indent": "off", + "max-len": [ + "error", + { + "code": 80, + "ignoreComments": true, + "ignorePattern": "^(?:import\\s|export\\s|\\s*it(?:\\.(?:skip|only))?\\()", + "ignoreRegExpLiterals": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true, + "ignoreUrls": true, + "tabWidth": 2, + }, + ], + "no-confusing-arrow": "off", + "no-underscore-dangle": "error", + "no-use-before-define": "off", + "no-void": [ + "error", + { + "allowAsStatement": true, + }, + ], + "object-curly-newline": "off", + "operator-linebreak": "off", + "quote-props": "off", + "react/prop-types": "off", + }, + }, + { + "files": [ + "**/*.d.ts", + ], + "rules": { + "import/no-extraneous-dependencies": [ + "error", + { + "devDependencies": true, + }, + ], + "node/no-extraneous-import": "off", + "spaced-comment": "off", + }, + }, + { + "files": [ + "**/*.{story,stories}.{ts,tsx}", + ], + "rules": { + "@typescript-eslint/explicit-module-boundary-types": "off", + }, + }, + { + "files": [ + "**/*spec.{ts,tsx}", + "**/setupTests.{ts,tsx}", + "**/test-utils.{ts,tsx}", + ], + "rules": { + "@typescript-eslint/no-empty-function": "off", + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-unsafe-assignment": "off", + "@typescript-eslint/no-var-requires": "off", + "@typescript-eslint/unbound-method": "off", + }, + }, + { + "files": [ + "**/*.{story,stories}.*", + ], + "rules": { + "import/no-anonymous-default-export": "off", + "import/no-extraneous-dependencies": "off", + "no-alert": "off", + }, + }, + { + "files": [ + "**/*spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + ], + "rules": { + "import/no-extraneous-dependencies": "off", + "react/display-name": "off", + "react/prop-types": "off", + }, + }, + { + "files": [ + "**/*.spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + "**/*Fixtures.*", + "**/__fixtures__/**/*", + "**/__mocks__/**/*", + "api/**/*", + "pages/api/**/*", + "src/pages/api/**/*", + ], + "rules": { + "compat/compat": "off", + }, + }, + { + "env": { + "cypress/globals": true, + }, + "extends": [ + "plugin:cypress/recommended", + ], + "files": [ + "**/*spec.*", + "e2e/**/*", + "tests/**/*", + ], + "plugins": [ + "cypress", + ], + }, + ], + "parser": "@babel/eslint-parser", + "parserOptions": { + "allowImportExportEverywhere": true, + "ecmaFeatures": { + "impliedStrict": true, + "jsx": true, + "modules": true, + }, + "ecmaVersion": 6, + "sourceType": "module", + }, + "plugins": [ + "prettier", + "react", + "react-hooks", + "jsx-a11y", + ], + "root": true, + "rules": { + "comma-dangle": "off", + "curly": [ + "error", + "all", + ], + "function-paren-newline": "off", + "implicit-arrow-linebreak": "off", + "import/extensions": "off", + "import/no-cycle": [ + "error", + { + "maxDepth": 7, + }, + ], + "import/order": [ + "error", + { + "newlines-between": "always", + }, + ], + "import/prefer-default-export": "off", + "indent": "off", + "max-len": [ + "error", + { + "code": 80, + "ignoreComments": true, + "ignorePattern": "^(?:import\\s|export\\s|\\s*it(?:\\.(?:skip|only))?\\()", + "ignoreRegExpLiterals": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true, + "ignoreUrls": true, + "tabWidth": 2, + }, + ], + "no-confusing-arrow": "off", + "no-underscore-dangle": "error", + "no-use-before-define": "off", + "no-void": [ + "error", + { + "allowAsStatement": true, + }, + ], + "object-curly-newline": "off", + "operator-linebreak": "off", + "quote-props": "off", + "react/display-name": "off", + "react/react-in-jsx-scope": "off", + }, + "settings": { + "import/resolver": { + "node": { + "extensions": [ + ".js", + ".jsx", + ".ts", + ".tsx", + ], + }, + }, + "lintAllEsApis": true, + "polyfills": [ + "document.body", + ], + "react": { + "version": "detect", + }, + }, +} +`; + +exports[`eslint > with options > should return a config for { language: 'TypeScript', environments: [ 'Browser' ], frameworks: [ 'React' ], plugins: [ 'Emotion' ] } 1`] = ` +{ + "env": { + "browser": true, + }, + "extends": [ + "eslint:recommended", + "plugin:prettier/recommended", + "airbnb-base", + "plugin:compat/recommended", + "plugin:react/recommended", + "plugin:react-hooks/recommended", + "plugin:jsx-a11y/recommended", + ], + "overrides": [ + { + "extends": [ + "plugin:json/recommended", + ], + "files": [ + "**/*.json", + ], + "rules": { + "notice/notice": "off", + }, + }, + { + "files": [ + "api/**/*", + "pages/api/**/*", + "src/pages/api/**/*", + ], + "rules": { + "no-console": "off", + }, + }, + { + "extends": [ + "airbnb-typescript/base", + "plugin:@typescript-eslint/eslint-recommended", + "plugin:@typescript-eslint/recommended", + "plugin:@typescript-eslint/recommended-requiring-type-checking", + ], + "files": [ + "**/*.{ts,tsx}", + ], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaFeatures": { + "modules": true, + }, + "ecmaVersion": 6, + "extraFileExtensions": [ + ".json", + ], + "project": [ + "./tsconfig.json", + ], + "sourceType": "module", + "tsconfigRootDir": "/project/dir", + }, + "plugins": [ + "@typescript-eslint", + ], + "rules": { + "@typescript-eslint/explicit-function-return-type": "off", + "@typescript-eslint/indent": "off", + "@typescript-eslint/no-misused-promises": [ + "error", + { + "checksVoidReturn": false, + }, + ], + "@typescript-eslint/no-unused-vars": "error", + "@typescript-eslint/no-use-before-define": [ + "error", + { + "functions": false, + }, + ], + "comma-dangle": "off", + "curly": [ + "error", + "all", + ], + "function-paren-newline": "off", + "implicit-arrow-linebreak": "off", + "import/extensions": "off", + "import/no-cycle": [ + "error", + { + "maxDepth": 7, + }, + ], + "import/order": [ + "error", + { + "newlines-between": "always", + }, + ], + "import/prefer-default-export": "off", + "indent": "off", + "max-len": [ + "error", + { + "code": 80, + "ignoreComments": true, + "ignorePattern": "^(?:import\\s|export\\s|\\s*it(?:\\.(?:skip|only))?\\()", + "ignoreRegExpLiterals": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true, + "ignoreUrls": true, + "tabWidth": 2, + }, + ], + "no-confusing-arrow": "off", + "no-underscore-dangle": "error", + "no-use-before-define": "off", + "no-void": [ + "error", + { + "allowAsStatement": true, + }, + ], + "object-curly-newline": "off", + "operator-linebreak": "off", + "quote-props": "off", + "react/prop-types": "off", + }, + }, + { + "files": [ + "**/*.d.ts", + ], + "rules": { + "import/no-extraneous-dependencies": [ + "error", + { + "devDependencies": true, + }, + ], + "node/no-extraneous-import": "off", + "spaced-comment": "off", + }, + }, + { + "files": [ + "**/*.{story,stories}.{ts,tsx}", + ], + "rules": { + "@typescript-eslint/explicit-module-boundary-types": "off", + }, + }, + { + "files": [ + "**/*spec.{ts,tsx}", + "**/setupTests.{ts,tsx}", + "**/test-utils.{ts,tsx}", + ], + "rules": { + "@typescript-eslint/no-empty-function": "off", + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-unsafe-assignment": "off", + "@typescript-eslint/no-var-requires": "off", + "@typescript-eslint/unbound-method": "off", + }, + }, + { + "files": [ + "**/*.{story,stories}.*", + ], + "rules": { + "import/no-anonymous-default-export": "off", + "import/no-extraneous-dependencies": "off", + "no-alert": "off", + }, + }, + { + "files": [ + "**/*spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + ], + "rules": { + "import/no-extraneous-dependencies": "off", + "react/display-name": "off", + "react/prop-types": "off", + }, + }, + { + "files": [ + "**/*.spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + "**/*Fixtures.*", + "**/__fixtures__/**/*", + "**/__mocks__/**/*", + "api/**/*", + "pages/api/**/*", + "src/pages/api/**/*", + ], + "rules": { + "compat/compat": "off", + }, + }, + ], + "parser": "@babel/eslint-parser", + "parserOptions": { + "allowImportExportEverywhere": true, + "ecmaFeatures": { + "impliedStrict": true, + "jsx": true, + "modules": true, + }, + "ecmaVersion": 6, + "sourceType": "module", + }, + "plugins": [ + "prettier", + "react", + "react-hooks", + "jsx-a11y", + "@emotion", + ], + "root": true, + "rules": { + "@emotion/import-from-emotion": "error", + "@emotion/jsx-import": "off", + "@emotion/no-vanilla": "error", + "@emotion/pkg-renaming": "error", + "@emotion/styled-import": "error", + "comma-dangle": "off", + "curly": [ + "error", + "all", + ], + "function-paren-newline": "off", + "implicit-arrow-linebreak": "off", + "import/extensions": "off", + "import/no-cycle": [ + "error", + { + "maxDepth": 7, + }, + ], + "import/order": [ + "error", + { + "newlines-between": "always", + }, + ], + "import/prefer-default-export": "off", + "indent": "off", + "max-len": [ + "error", + { + "code": 80, + "ignoreComments": true, + "ignorePattern": "^(?:import\\s|export\\s|\\s*it(?:\\.(?:skip|only))?\\()", + "ignoreRegExpLiterals": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true, + "ignoreUrls": true, + "tabWidth": 2, + }, + ], + "no-confusing-arrow": "off", + "no-underscore-dangle": "error", + "no-use-before-define": "off", + "no-void": [ + "error", + { + "allowAsStatement": true, + }, + ], + "object-curly-newline": "off", + "operator-linebreak": "off", + "quote-props": "off", + "react/display-name": "off", + "react/no-unknown-property": [ + "error", + { + "ignore": [ + "css", + ], + }, + ], + "react/react-in-jsx-scope": "off", + }, + "settings": { + "import/resolver": { + "node": { + "extensions": [ + ".js", + ".jsx", + ".ts", + ".tsx", + ], + }, + }, + "lintAllEsApis": true, + "polyfills": [ + "document.body", + ], + "react": { + "version": "detect", + }, + }, +} +`; + +exports[`eslint > with options > should return a config for { language: 'TypeScript', environments: [ 'Browser' ], frameworks: [ 'React' ], plugins: [ 'Jest' ] } 1`] = ` +{ + "env": { + "browser": true, + }, + "extends": [ + "eslint:recommended", + "plugin:prettier/recommended", + "airbnb-base", + "plugin:compat/recommended", + "plugin:react/recommended", + "plugin:react-hooks/recommended", + "plugin:jsx-a11y/recommended", + ], + "overrides": [ + { + "extends": [ + "plugin:json/recommended", + ], + "files": [ + "**/*.json", + ], + "rules": { + "notice/notice": "off", + }, + }, + { + "files": [ + "api/**/*", + "pages/api/**/*", + "src/pages/api/**/*", + ], + "rules": { + "no-console": "off", + }, + }, + { + "extends": [ + "airbnb-typescript/base", + "plugin:@typescript-eslint/eslint-recommended", + "plugin:@typescript-eslint/recommended", + "plugin:@typescript-eslint/recommended-requiring-type-checking", + ], + "files": [ + "**/*.{ts,tsx}", + ], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaFeatures": { + "modules": true, + }, + "ecmaVersion": 6, + "extraFileExtensions": [ + ".json", + ], + "project": [ + "./tsconfig.json", + ], + "sourceType": "module", + "tsconfigRootDir": "/project/dir", + }, + "plugins": [ + "@typescript-eslint", + ], + "rules": { + "@typescript-eslint/explicit-function-return-type": "off", + "@typescript-eslint/indent": "off", + "@typescript-eslint/no-misused-promises": [ + "error", + { + "checksVoidReturn": false, + }, + ], + "@typescript-eslint/no-unused-vars": "error", + "@typescript-eslint/no-use-before-define": [ + "error", + { + "functions": false, + }, + ], + "comma-dangle": "off", + "curly": [ + "error", + "all", + ], + "function-paren-newline": "off", + "implicit-arrow-linebreak": "off", + "import/extensions": "off", + "import/no-cycle": [ + "error", + { + "maxDepth": 7, + }, + ], + "import/order": [ + "error", + { + "newlines-between": "always", + }, + ], + "import/prefer-default-export": "off", + "indent": "off", + "max-len": [ + "error", + { + "code": 80, + "ignoreComments": true, + "ignorePattern": "^(?:import\\s|export\\s|\\s*it(?:\\.(?:skip|only))?\\()", + "ignoreRegExpLiterals": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true, + "ignoreUrls": true, + "tabWidth": 2, + }, + ], + "no-confusing-arrow": "off", + "no-underscore-dangle": "error", + "no-use-before-define": "off", + "no-void": [ + "error", + { + "allowAsStatement": true, + }, + ], + "object-curly-newline": "off", + "operator-linebreak": "off", + "quote-props": "off", + "react/prop-types": "off", + }, + }, + { + "files": [ + "**/*.d.ts", + ], + "rules": { + "import/no-extraneous-dependencies": [ + "error", + { + "devDependencies": true, + }, + ], + "node/no-extraneous-import": "off", + "spaced-comment": "off", + }, + }, + { + "files": [ + "**/*.{story,stories}.{ts,tsx}", + ], + "rules": { + "@typescript-eslint/explicit-module-boundary-types": "off", + }, + }, + { + "files": [ + "**/*spec.{ts,tsx}", + "**/setupTests.{ts,tsx}", + "**/test-utils.{ts,tsx}", + ], + "rules": { + "@typescript-eslint/no-empty-function": "off", + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-unsafe-assignment": "off", + "@typescript-eslint/no-var-requires": "off", + "@typescript-eslint/unbound-method": "off", + }, + }, + { + "files": [ + "**/*.{story,stories}.*", + ], + "rules": { + "import/no-anonymous-default-export": "off", + "import/no-extraneous-dependencies": "off", + "no-alert": "off", + }, + }, + { + "files": [ + "**/*spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + ], + "rules": { + "import/no-extraneous-dependencies": "off", + "react/display-name": "off", + "react/prop-types": "off", + }, + }, + { + "files": [ + "**/*.spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + "**/*Fixtures.*", + "**/__fixtures__/**/*", + "**/__mocks__/**/*", + "api/**/*", + "pages/api/**/*", + "src/pages/api/**/*", + ], + "rules": { + "compat/compat": "off", + }, + }, + { + "env": { + "jest/globals": true, + }, + "extends": [ + "plugin:jest/recommended", + ], + "files": [ + "**/*.spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + "**/*Fixtures.*", + "**/__fixtures__/**/*", + "**/__mocks__/**/*", + ], + "plugins": [ + "jest", + ], + }, + ], + "parser": "@babel/eslint-parser", + "parserOptions": { + "allowImportExportEverywhere": true, + "ecmaFeatures": { + "impliedStrict": true, + "jsx": true, + "modules": true, + }, + "ecmaVersion": 6, + "sourceType": "module", + }, + "plugins": [ + "prettier", + "react", + "react-hooks", + "jsx-a11y", + ], + "root": true, + "rules": { + "comma-dangle": "off", + "curly": [ + "error", + "all", + ], + "function-paren-newline": "off", + "implicit-arrow-linebreak": "off", + "import/extensions": "off", + "import/no-cycle": [ + "error", + { + "maxDepth": 7, + }, + ], + "import/order": [ + "error", + { + "newlines-between": "always", + }, + ], + "import/prefer-default-export": "off", + "indent": "off", + "max-len": [ + "error", + { + "code": 80, + "ignoreComments": true, + "ignorePattern": "^(?:import\\s|export\\s|\\s*it(?:\\.(?:skip|only))?\\()", + "ignoreRegExpLiterals": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true, + "ignoreUrls": true, + "tabWidth": 2, + }, + ], + "no-confusing-arrow": "off", + "no-underscore-dangle": "error", + "no-use-before-define": "off", + "no-void": [ + "error", + { + "allowAsStatement": true, + }, + ], + "object-curly-newline": "off", + "operator-linebreak": "off", + "quote-props": "off", + "react/display-name": "off", + "react/react-in-jsx-scope": "off", + }, + "settings": { + "import/resolver": { + "node": { + "extensions": [ + ".js", + ".jsx", + ".ts", + ".tsx", + ], + }, + }, + "lintAllEsApis": true, + "polyfills": [ + "document.body", + ], + "react": { + "version": "detect", + }, + }, +} +`; + +exports[`eslint > with options > should return a config for { language: 'TypeScript', environments: [ 'Browser' ], frameworks: [ 'React' ], plugins: [ 'Next.js' ] } 1`] = ` +{ + "env": { + "browser": true, + }, + "extends": [ + "eslint:recommended", + "plugin:prettier/recommended", + "airbnb-base", + "plugin:compat/recommended", + "plugin:react/recommended", + "plugin:react-hooks/recommended", + "plugin:jsx-a11y/recommended", + "next", + ], + "overrides": [ + { + "extends": [ + "plugin:json/recommended", + ], + "files": [ + "**/*.json", + ], + "rules": { + "notice/notice": "off", + }, + }, + { + "files": [ + "api/**/*", + "pages/api/**/*", + "src/pages/api/**/*", + ], + "rules": { + "no-console": "off", + }, + }, + { + "extends": [ + "airbnb-typescript/base", + "plugin:@typescript-eslint/eslint-recommended", + "plugin:@typescript-eslint/recommended", + "plugin:@typescript-eslint/recommended-requiring-type-checking", + ], + "files": [ + "**/*.{ts,tsx}", + ], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaFeatures": { + "modules": true, + }, + "ecmaVersion": 6, + "extraFileExtensions": [ + ".json", + ], + "project": [ + "./tsconfig.json", + ], + "sourceType": "module", + "tsconfigRootDir": "/project/dir", + }, + "plugins": [ + "@typescript-eslint", + ], + "rules": { + "@typescript-eslint/explicit-function-return-type": "off", + "@typescript-eslint/indent": "off", + "@typescript-eslint/no-misused-promises": [ + "error", + { + "checksVoidReturn": false, + }, + ], + "@typescript-eslint/no-unused-vars": "error", + "@typescript-eslint/no-use-before-define": [ + "error", + { + "functions": false, + }, + ], + "comma-dangle": "off", + "curly": [ + "error", + "all", + ], + "function-paren-newline": "off", + "implicit-arrow-linebreak": "off", + "import/extensions": "off", + "import/no-cycle": [ + "error", + { + "maxDepth": 7, + }, + ], + "import/order": [ + "error", + { + "newlines-between": "always", + }, + ], + "import/prefer-default-export": "off", + "indent": "off", + "max-len": [ + "error", + { + "code": 80, + "ignoreComments": true, + "ignorePattern": "^(?:import\\s|export\\s|\\s*it(?:\\.(?:skip|only))?\\()", + "ignoreRegExpLiterals": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true, + "ignoreUrls": true, + "tabWidth": 2, + }, + ], + "no-confusing-arrow": "off", + "no-underscore-dangle": "error", + "no-use-before-define": "off", + "no-void": [ + "error", + { + "allowAsStatement": true, + }, + ], + "object-curly-newline": "off", + "operator-linebreak": "off", + "quote-props": "off", + "react/prop-types": "off", + }, + }, + { + "files": [ + "**/*.d.ts", + ], + "rules": { + "import/no-extraneous-dependencies": [ + "error", + { + "devDependencies": true, + }, + ], + "node/no-extraneous-import": "off", + "spaced-comment": "off", + }, + }, + { + "files": [ + "**/*.{story,stories}.{ts,tsx}", + ], + "rules": { + "@typescript-eslint/explicit-module-boundary-types": "off", + }, + }, + { + "files": [ + "**/*spec.{ts,tsx}", + "**/setupTests.{ts,tsx}", + "**/test-utils.{ts,tsx}", + ], + "rules": { + "@typescript-eslint/no-empty-function": "off", + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-unsafe-assignment": "off", + "@typescript-eslint/no-var-requires": "off", + "@typescript-eslint/unbound-method": "off", + }, + }, + { + "files": [ + "**/*.{story,stories}.*", + ], + "rules": { + "import/no-anonymous-default-export": "off", + "import/no-extraneous-dependencies": "off", + "no-alert": "off", + }, + }, + { + "files": [ + "**/*spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + ], + "rules": { + "import/no-extraneous-dependencies": "off", + "react/display-name": "off", + "react/prop-types": "off", + }, + }, + { + "files": [ + "**/*.spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + "**/*Fixtures.*", + "**/__fixtures__/**/*", + "**/__mocks__/**/*", + "api/**/*", + "pages/api/**/*", + "src/pages/api/**/*", + ], + "rules": { + "compat/compat": "off", + }, + }, + ], + "parser": "@babel/eslint-parser", + "parserOptions": { + "allowImportExportEverywhere": true, + "ecmaFeatures": { + "impliedStrict": true, + "jsx": true, + "modules": true, + }, + "ecmaVersion": 6, + "sourceType": "module", + }, + "plugins": [ + "prettier", + "react", + "react-hooks", + "jsx-a11y", + ], + "root": true, + "rules": { + "comma-dangle": "off", + "curly": [ + "error", + "all", + ], + "function-paren-newline": "off", + "implicit-arrow-linebreak": "off", + "import/extensions": "off", + "import/no-cycle": [ + "error", + { + "maxDepth": 7, + }, + ], + "import/order": [ + "error", + { + "newlines-between": "always", + }, + ], + "import/prefer-default-export": "off", + "indent": "off", + "max-len": [ + "error", + { + "code": 80, + "ignoreComments": true, + "ignorePattern": "^(?:import\\s|export\\s|\\s*it(?:\\.(?:skip|only))?\\()", + "ignoreRegExpLiterals": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true, + "ignoreUrls": true, + "tabWidth": 2, + }, + ], + "no-confusing-arrow": "off", + "no-underscore-dangle": "error", + "no-use-before-define": "off", + "no-void": [ + "error", + { + "allowAsStatement": true, + }, + ], + "object-curly-newline": "off", + "operator-linebreak": "off", + "quote-props": "off", + "react/display-name": "off", + "react/react-in-jsx-scope": "off", + }, + "settings": { + "import/resolver": { + "node": { + "extensions": [ + ".js", + ".jsx", + ".ts", + ".tsx", + ], + }, + }, + "lintAllEsApis": true, + "polyfills": [ + "document.body", + ], + "react": { + "version": "detect", + }, + }, +} +`; + +exports[`eslint > with options > should return a config for { language: 'TypeScript', environments: [ 'Browser' ], frameworks: [ 'React' ], plugins: [ 'Playwright' ] } 1`] = ` +{ + "env": { + "browser": true, + }, + "extends": [ + "eslint:recommended", + "plugin:prettier/recommended", + "airbnb-base", + "plugin:compat/recommended", + "plugin:react/recommended", + "plugin:react-hooks/recommended", + "plugin:jsx-a11y/recommended", + ], + "overrides": [ + { + "extends": [ + "plugin:json/recommended", + ], + "files": [ + "**/*.json", + ], + "rules": { + "notice/notice": "off", + }, + }, + { + "files": [ + "api/**/*", + "pages/api/**/*", + "src/pages/api/**/*", + ], + "rules": { + "no-console": "off", + }, + }, + { + "extends": [ + "airbnb-typescript/base", + "plugin:@typescript-eslint/eslint-recommended", + "plugin:@typescript-eslint/recommended", + "plugin:@typescript-eslint/recommended-requiring-type-checking", + ], + "files": [ + "**/*.{ts,tsx}", + ], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaFeatures": { + "modules": true, + }, + "ecmaVersion": 6, + "extraFileExtensions": [ + ".json", + ], + "project": [ + "./tsconfig.json", + ], + "sourceType": "module", + "tsconfigRootDir": "/project/dir", + }, + "plugins": [ + "@typescript-eslint", + ], + "rules": { + "@typescript-eslint/explicit-function-return-type": "off", + "@typescript-eslint/indent": "off", + "@typescript-eslint/no-misused-promises": [ + "error", + { + "checksVoidReturn": false, + }, + ], + "@typescript-eslint/no-unused-vars": "error", + "@typescript-eslint/no-use-before-define": [ + "error", + { + "functions": false, + }, + ], + "comma-dangle": "off", + "curly": [ + "error", + "all", + ], + "function-paren-newline": "off", + "implicit-arrow-linebreak": "off", + "import/extensions": "off", + "import/no-cycle": [ + "error", + { + "maxDepth": 7, + }, + ], + "import/order": [ + "error", + { + "newlines-between": "always", + }, + ], + "import/prefer-default-export": "off", + "indent": "off", + "max-len": [ + "error", + { + "code": 80, + "ignoreComments": true, + "ignorePattern": "^(?:import\\s|export\\s|\\s*it(?:\\.(?:skip|only))?\\()", + "ignoreRegExpLiterals": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true, + "ignoreUrls": true, + "tabWidth": 2, + }, + ], + "no-confusing-arrow": "off", + "no-underscore-dangle": "error", + "no-use-before-define": "off", + "no-void": [ + "error", + { + "allowAsStatement": true, + }, + ], + "object-curly-newline": "off", + "operator-linebreak": "off", + "quote-props": "off", + "react/prop-types": "off", + }, + }, + { + "files": [ + "**/*.d.ts", ], "rules": { - "node/no-extraneous-require": "off", - "node/no-missing-require": "off", - "node/no-unpublished-import": "off", - "node/no-unpublished-require": "off", - }, - }, - ], - "parser": "@babel/eslint-parser", - "parserOptions": { - "allowImportExportEverywhere": true, - "ecmaFeatures": { - "impliedStrict": true, - "modules": true, - }, - "ecmaVersion": 6, - "sourceType": "module", - }, - "plugins": [ - "prettier", - ], - "root": true, - "rules": { - "comma-dangle": "off", - "curly": [ - "error", - "all", - ], - "function-paren-newline": "off", - "implicit-arrow-linebreak": "off", - "import/extensions": "off", - "import/no-cycle": [ - "error", - { - "maxDepth": 7, - }, - ], - "import/order": [ - "error", - { - "newlines-between": "always", - }, - ], - "import/prefer-default-export": "off", - "indent": "off", - "max-len": [ - "error", - { - "code": 80, - "ignoreComments": true, - "ignorePattern": "^(?:import\\s|export\\s|\\s*it(?:\\.(?:skip|only))?\\()", - "ignoreRegExpLiterals": true, - "ignoreStrings": true, - "ignoreTemplateLiterals": true, - "ignoreUrls": true, - "tabWidth": 2, - }, - ], - "no-confusing-arrow": "off", - "no-underscore-dangle": "error", - "no-use-before-define": "off", - "no-void": [ - "error", - { - "allowAsStatement": true, - }, - ], - "node/no-extraneous-import": "off", - "node/no-missing-import": "off", - "node/no-unsupported-features/es-syntax": "off", - "object-curly-newline": "off", - "operator-linebreak": "off", - "quote-props": "off", - }, - "settings": { - "import/resolver": { - "node": { - "extensions": [ - ".js", - ".jsx", - ".ts", - ".tsx", + "import/no-extraneous-dependencies": [ + "error", + { + "devDependencies": true, + }, ], + "node/no-extraneous-import": "off", + "spaced-comment": "off", }, }, - }, -} -`; - -exports[`eslint > with options > should return a config for { language: 'JavaScript', environments: [ 'Node' ], frameworks: [ 'Testing Library' ] } 1`] = ` -{ - "env": { - "node": true, - }, - "extends": [ - "eslint:recommended", - "plugin:prettier/recommended", - "airbnb-base", - "plugin:node/recommended", - "plugin:security/recommended", - ], - "overrides": [ { - "extends": [ - "plugin:json/recommended", - ], "files": [ - "**/*.json", + "**/*.{story,stories}.{ts,tsx}", ], "rules": { - "notice/notice": "off", + "@typescript-eslint/explicit-module-boundary-types": "off", }, }, { "files": [ - "api/**/*", - "pages/api/**/*", - "src/pages/api/**/*", + "**/*spec.{ts,tsx}", + "**/setupTests.{ts,tsx}", + "**/test-utils.{ts,tsx}", ], "rules": { - "no-console": "off", + "@typescript-eslint/no-empty-function": "off", + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-unsafe-assignment": "off", + "@typescript-eslint/no-var-requires": "off", + "@typescript-eslint/unbound-method": "off", }, }, { @@ -2643,29 +9342,25 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr "**/jest*", "**/setupTests.*", "**/test-utils.*", + "**/*Fixtures.*", + "**/__fixtures__/**/*", + "**/__mocks__/**/*", + "api/**/*", + "pages/api/**/*", + "src/pages/api/**/*", ], "rules": { - "node/no-extraneous-require": "off", - "node/no-missing-require": "off", - "node/no-unpublished-import": "off", - "node/no-unpublished-require": "off", + "compat/compat": "off", }, }, { "extends": [ - "plugin:testing-library/react", + "plugin:playwright/playwright-test", ], "files": [ - "**/*.spec.*", - "**/jest*", - "**/setupTests.*", - "**/test-utils.*", - "**/*Fixtures.*", - "**/__fixtures__/**/*", - "**/__mocks__/**/*", - ], - "plugins": [ - "testing-library", + "**/*spec.*", + "e2e/**/*", + "tests/**/*", ], }, ], @@ -2674,6 +9369,7 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr "allowImportExportEverywhere": true, "ecmaFeatures": { "impliedStrict": true, + "jsx": true, "modules": true, }, "ecmaVersion": 6, @@ -2681,6 +9377,9 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr }, "plugins": [ "prettier", + "react", + "react-hooks", + "jsx-a11y", ], "root": true, "rules": { @@ -2728,12 +9427,11 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr "allowAsStatement": true, }, ], - "node/no-extraneous-import": "off", - "node/no-missing-import": "off", - "node/no-unsupported-features/es-syntax": "off", "object-curly-newline": "off", "operator-linebreak": "off", "quote-props": "off", + "react/display-name": "off", + "react/react-in-jsx-scope": "off", }, "settings": { "import/resolver": { @@ -2746,11 +9444,18 @@ exports[`eslint > with options > should return a config for { language: 'JavaScr ], }, }, + "lintAllEsApis": true, + "polyfills": [ + "document.body", + ], + "react": { + "version": "detect", + }, }, } `; -exports[`eslint > with options > should return a config for { language: 'TypeScript', environments: [ 'Browser' ], frameworks: [ 'Cypress' ] } 1`] = ` +exports[`eslint > with options > should return a config for { language: 'TypeScript', environments: [ 'Browser' ], frameworks: [ 'React' ], plugins: [ 'Storybook' ] } 1`] = ` { "env": { "browser": true, @@ -2760,6 +9465,10 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "plugin:prettier/recommended", "airbnb-base", "plugin:compat/recommended", + "plugin:react/recommended", + "plugin:react-hooks/recommended", + "plugin:jsx-a11y/recommended", + "plugin:storybook/recommended", ], "overrides": [ { @@ -2954,28 +9663,13 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "compat/compat": "off", }, }, - { - "env": { - "cypress/globals": true, - }, - "extends": [ - "plugin:cypress/recommended", - ], - "files": [ - "**/*spec.*", - "e2e/**/*", - "tests/**/*", - ], - "plugins": [ - "cypress", - ], - }, ], "parser": "@babel/eslint-parser", "parserOptions": { "allowImportExportEverywhere": true, "ecmaFeatures": { "impliedStrict": true, + "jsx": true, "modules": true, }, "ecmaVersion": 6, @@ -2983,6 +9677,9 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr }, "plugins": [ "prettier", + "react", + "react-hooks", + "jsx-a11y", ], "root": true, "rules": { @@ -3033,6 +9730,8 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "object-curly-newline": "off", "operator-linebreak": "off", "quote-props": "off", + "react/display-name": "off", + "react/react-in-jsx-scope": "off", }, "settings": { "import/resolver": { @@ -3049,11 +9748,14 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "polyfills": [ "document.body", ], + "react": { + "version": "detect", + }, }, } `; -exports[`eslint > with options > should return a config for { language: 'TypeScript', environments: [ 'Browser' ], frameworks: [ 'Emotion' ] } 1`] = ` +exports[`eslint > with options > should return a config for { language: 'TypeScript', environments: [ 'Browser' ], frameworks: [ 'React' ], plugins: [ 'Testing Library' ] } 1`] = ` { "env": { "browser": true, @@ -3063,6 +9765,9 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "plugin:prettier/recommended", "airbnb-base", "plugin:compat/recommended", + "plugin:react/recommended", + "plugin:react-hooks/recommended", + "plugin:jsx-a11y/recommended", ], "overrides": [ { @@ -3257,12 +9962,30 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "compat/compat": "off", }, }, + { + "extends": [ + "plugin:testing-library/react", + ], + "files": [ + "**/*.spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + "**/*Fixtures.*", + "**/__fixtures__/**/*", + "**/__mocks__/**/*", + ], + "plugins": [ + "testing-library", + ], + }, ], "parser": "@babel/eslint-parser", "parserOptions": { "allowImportExportEverywhere": true, "ecmaFeatures": { "impliedStrict": true, + "jsx": true, "modules": true, }, "ecmaVersion": 6, @@ -3270,15 +9993,12 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr }, "plugins": [ "prettier", - "@emotion", + "react", + "react-hooks", + "jsx-a11y", ], "root": true, "rules": { - "@emotion/import-from-emotion": "error", - "@emotion/jsx-import": "off", - "@emotion/no-vanilla": "error", - "@emotion/pkg-renaming": "error", - "@emotion/styled-import": "error", "comma-dangle": "off", "curly": [ "error", @@ -3326,14 +10046,8 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "object-curly-newline": "off", "operator-linebreak": "off", "quote-props": "off", - "react/no-unknown-property": [ - "error", - { - "ignore": [ - "css", - ], - }, - ], + "react/display-name": "off", + "react/react-in-jsx-scope": "off", }, "settings": { "import/resolver": { @@ -3350,20 +10064,24 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "polyfills": [ "document.body", ], + "react": { + "version": "detect", + }, }, } `; -exports[`eslint > with options > should return a config for { language: 'TypeScript', environments: [ 'Browser' ], frameworks: [ 'Jest' ] } 1`] = ` +exports[`eslint > with options > should return a config for { language: 'TypeScript', environments: [ 'Node' ], frameworks: [ 'Next.js' ], plugins: [ 'Cypress' ] } 1`] = ` { "env": { - "browser": true, + "node": true, }, "extends": [ "eslint:recommended", "plugin:prettier/recommended", "airbnb-base", - "plugin:compat/recommended", + "plugin:node/recommended", + "plugin:security/recommended", ], "overrides": [ { @@ -3547,35 +10265,28 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "**/jest*", "**/setupTests.*", "**/test-utils.*", - "**/*Fixtures.*", - "**/__fixtures__/**/*", - "**/__mocks__/**/*", - "api/**/*", - "pages/api/**/*", - "src/pages/api/**/*", ], "rules": { - "compat/compat": "off", + "node/no-extraneous-require": "off", + "node/no-missing-require": "off", + "node/no-unpublished-import": "off", + "node/no-unpublished-require": "off", }, }, { "env": { - "jest/globals": true, + "cypress/globals": true, }, "extends": [ - "plugin:jest/recommended", + "plugin:cypress/recommended", ], "files": [ - "**/*.spec.*", - "**/jest*", - "**/setupTests.*", - "**/test-utils.*", - "**/*Fixtures.*", - "**/__fixtures__/**/*", - "**/__mocks__/**/*", + "**/*spec.*", + "e2e/**/*", + "tests/**/*", ], "plugins": [ - "jest", + "cypress", ], }, ], @@ -3638,6 +10349,9 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "allowAsStatement": true, }, ], + "node/no-extraneous-import": "off", + "node/no-missing-import": "off", + "node/no-unsupported-features/es-syntax": "off", "object-curly-newline": "off", "operator-linebreak": "off", "quote-props": "off", @@ -3653,25 +10367,70 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr ], }, }, - "lintAllEsApis": true, "polyfills": [ - "document.body", + "Array.prototype.copyWithin", + "Array.prototype.fill", + "Array.prototype.find", + "Array.prototype.findIndex", + "Array.prototype.flagMap", + "Array.prototype.flat", + "Array.from", + "Array.prototype.includes", + "Array.of", + "Function.name", + "Map", + "Number.EPSILON", + "Number.isFinite", + "Number.isInteger", + "Number.isNaN", + "Number.isSafeInteger", + "Number.MAX_SAFE_INTEGER", + "Number.MIN_SAFE_INTEGER", + "Number.parseFloat", + "Number.parseInt", + "Object.assign", + "Object.entries", + "Object.getOwnPropertyDescriptors", + "Object.keys", + "Object.is", + "Object.values", + "Reflect", + "RegExp", + "Set", + "Symbol", + "String.prototype.codePointAt", + "String.prototype.endsWith", + "String.prototype.fromCodePoint", + "String.prototype.includes", + "String.prototype.padStart", + "String.prototype.padEnd", + "String.prototype.raw", + "String.prototype.repeat", + "String.prototype.startsWith", + "String.prototype.trimLeft", + "String.prototype.trimRight", + "URL", + "URLSearchParams", + "WeakMap", + "WeakSet", + "Promise", + "fetch", ], }, } `; -exports[`eslint > with options > should return a config for { language: 'TypeScript', environments: [ 'Browser' ], frameworks: [ 'Next.js' ] } 1`] = ` +exports[`eslint > with options > should return a config for { language: 'TypeScript', environments: [ 'Node' ], frameworks: [ 'Next.js' ], plugins: [ 'Emotion' ] } 1`] = ` { "env": { - "browser": true, + "node": true, }, "extends": [ "eslint:recommended", "plugin:prettier/recommended", "airbnb-base", - "plugin:compat/recommended", - "next", + "plugin:node/recommended", + "plugin:security/recommended", ], "overrides": [ { @@ -3855,15 +10614,12 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "**/jest*", "**/setupTests.*", "**/test-utils.*", - "**/*Fixtures.*", - "**/__fixtures__/**/*", - "**/__mocks__/**/*", - "api/**/*", - "pages/api/**/*", - "src/pages/api/**/*", ], "rules": { - "compat/compat": "off", + "node/no-extraneous-require": "off", + "node/no-missing-require": "off", + "node/no-unpublished-import": "off", + "node/no-unpublished-require": "off", }, }, ], @@ -3879,9 +10635,15 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr }, "plugins": [ "prettier", + "@emotion", ], "root": true, "rules": { + "@emotion/import-from-emotion": "error", + "@emotion/jsx-import": "off", + "@emotion/no-vanilla": "error", + "@emotion/pkg-renaming": "error", + "@emotion/styled-import": "error", "comma-dangle": "off", "curly": [ "error", @@ -3926,9 +10688,20 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "allowAsStatement": true, }, ], + "node/no-extraneous-import": "off", + "node/no-missing-import": "off", + "node/no-unsupported-features/es-syntax": "off", "object-curly-newline": "off", "operator-linebreak": "off", "quote-props": "off", + "react/no-unknown-property": [ + "error", + { + "ignore": [ + "css", + ], + }, + ], }, "settings": { "import/resolver": { @@ -3941,9 +10714,7 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr ], }, }, - "lintAllEsApis": true, "polyfills": [ - "document.body", "Array.prototype.copyWithin", "Array.prototype.fill", "Array.prototype.find", @@ -3996,16 +10767,17 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr } `; -exports[`eslint > with options > should return a config for { language: 'TypeScript', environments: [ 'Browser' ], frameworks: [ 'Playwright' ] } 1`] = ` +exports[`eslint > with options > should return a config for { language: 'TypeScript', environments: [ 'Node' ], frameworks: [ 'Next.js' ], plugins: [ 'Jest' ] } 1`] = ` { "env": { - "browser": true, + "node": true, }, "extends": [ "eslint:recommended", "plugin:prettier/recommended", "airbnb-base", - "plugin:compat/recommended", + "plugin:node/recommended", + "plugin:security/recommended", ], "overrides": [ { @@ -4189,25 +10961,32 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "**/jest*", "**/setupTests.*", "**/test-utils.*", - "**/*Fixtures.*", - "**/__fixtures__/**/*", - "**/__mocks__/**/*", - "api/**/*", - "pages/api/**/*", - "src/pages/api/**/*", ], "rules": { - "compat/compat": "off", + "node/no-extraneous-require": "off", + "node/no-missing-require": "off", + "node/no-unpublished-import": "off", + "node/no-unpublished-require": "off", }, }, { + "env": { + "jest/globals": true, + }, "extends": [ - "plugin:playwright/playwright-test", + "plugin:jest/recommended", ], "files": [ - "**/*spec.*", - "e2e/**/*", - "tests/**/*", + "**/*.spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + "**/*Fixtures.*", + "**/__fixtures__/**/*", + "**/__mocks__/**/*", + ], + "plugins": [ + "jest", ], }, ], @@ -4270,6 +11049,9 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "allowAsStatement": true, }, ], + "node/no-extraneous-import": "off", + "node/no-missing-import": "off", + "node/no-unsupported-features/es-syntax": "off", "object-curly-newline": "off", "operator-linebreak": "off", "quote-props": "off", @@ -4285,27 +11067,71 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr ], }, }, - "lintAllEsApis": true, "polyfills": [ - "document.body", + "Array.prototype.copyWithin", + "Array.prototype.fill", + "Array.prototype.find", + "Array.prototype.findIndex", + "Array.prototype.flagMap", + "Array.prototype.flat", + "Array.from", + "Array.prototype.includes", + "Array.of", + "Function.name", + "Map", + "Number.EPSILON", + "Number.isFinite", + "Number.isInteger", + "Number.isNaN", + "Number.isSafeInteger", + "Number.MAX_SAFE_INTEGER", + "Number.MIN_SAFE_INTEGER", + "Number.parseFloat", + "Number.parseInt", + "Object.assign", + "Object.entries", + "Object.getOwnPropertyDescriptors", + "Object.keys", + "Object.is", + "Object.values", + "Reflect", + "RegExp", + "Set", + "Symbol", + "String.prototype.codePointAt", + "String.prototype.endsWith", + "String.prototype.fromCodePoint", + "String.prototype.includes", + "String.prototype.padStart", + "String.prototype.padEnd", + "String.prototype.raw", + "String.prototype.repeat", + "String.prototype.startsWith", + "String.prototype.trimLeft", + "String.prototype.trimRight", + "URL", + "URLSearchParams", + "WeakMap", + "WeakSet", + "Promise", + "fetch", ], }, } `; -exports[`eslint > with options > should return a config for { language: 'TypeScript', environments: [ 'Browser' ], frameworks: [ 'React' ] } 1`] = ` +exports[`eslint > with options > should return a config for { language: 'TypeScript', environments: [ 'Node' ], frameworks: [ 'Next.js' ], plugins: [ 'Next.js' ] } 1`] = ` { "env": { - "browser": true, + "node": true, }, "extends": [ "eslint:recommended", "plugin:prettier/recommended", "airbnb-base", - "plugin:compat/recommended", - "plugin:react/recommended", - "plugin:react-hooks/recommended", - "plugin:jsx-a11y/recommended", + "plugin:node/recommended", + "plugin:security/recommended", + "next", ], "overrides": [ { @@ -4489,15 +11315,12 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "**/jest*", "**/setupTests.*", "**/test-utils.*", - "**/*Fixtures.*", - "**/__fixtures__/**/*", - "**/__mocks__/**/*", - "api/**/*", - "pages/api/**/*", - "src/pages/api/**/*", ], "rules": { - "compat/compat": "off", + "node/no-extraneous-require": "off", + "node/no-missing-require": "off", + "node/no-unpublished-import": "off", + "node/no-unpublished-require": "off", }, }, ], @@ -4506,7 +11329,6 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "allowImportExportEverywhere": true, "ecmaFeatures": { "impliedStrict": true, - "jsx": true, "modules": true, }, "ecmaVersion": 6, @@ -4514,9 +11336,6 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr }, "plugins": [ "prettier", - "react", - "react-hooks", - "jsx-a11y", ], "root": true, "rules": { @@ -4564,11 +11383,12 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "allowAsStatement": true, }, ], + "node/no-extraneous-import": "off", + "node/no-missing-import": "off", + "node/no-unsupported-features/es-syntax": "off", "object-curly-newline": "off", "operator-linebreak": "off", "quote-props": "off", - "react/display-name": "off", - "react/react-in-jsx-scope": "off", }, "settings": { "import/resolver": { @@ -4581,28 +11401,70 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr ], }, }, - "lintAllEsApis": true, "polyfills": [ - "document.body", + "Array.prototype.copyWithin", + "Array.prototype.fill", + "Array.prototype.find", + "Array.prototype.findIndex", + "Array.prototype.flagMap", + "Array.prototype.flat", + "Array.from", + "Array.prototype.includes", + "Array.of", + "Function.name", + "Map", + "Number.EPSILON", + "Number.isFinite", + "Number.isInteger", + "Number.isNaN", + "Number.isSafeInteger", + "Number.MAX_SAFE_INTEGER", + "Number.MIN_SAFE_INTEGER", + "Number.parseFloat", + "Number.parseInt", + "Object.assign", + "Object.entries", + "Object.getOwnPropertyDescriptors", + "Object.keys", + "Object.is", + "Object.values", + "Reflect", + "RegExp", + "Set", + "Symbol", + "String.prototype.codePointAt", + "String.prototype.endsWith", + "String.prototype.fromCodePoint", + "String.prototype.includes", + "String.prototype.padStart", + "String.prototype.padEnd", + "String.prototype.raw", + "String.prototype.repeat", + "String.prototype.startsWith", + "String.prototype.trimLeft", + "String.prototype.trimRight", + "URL", + "URLSearchParams", + "WeakMap", + "WeakSet", + "Promise", + "fetch", ], - "react": { - "version": "detect", - }, }, } `; -exports[`eslint > with options > should return a config for { language: 'TypeScript', environments: [ 'Browser' ], frameworks: [ 'Storybook' ] } 1`] = ` +exports[`eslint > with options > should return a config for { language: 'TypeScript', environments: [ 'Node' ], frameworks: [ 'Next.js' ], plugins: [ 'Playwright' ] } 1`] = ` { "env": { - "browser": true, + "node": true, }, "extends": [ "eslint:recommended", "plugin:prettier/recommended", "airbnb-base", - "plugin:compat/recommended", - "plugin:storybook/recommended", + "plugin:node/recommended", + "plugin:security/recommended", ], "overrides": [ { @@ -4786,17 +11648,24 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "**/jest*", "**/setupTests.*", "**/test-utils.*", - "**/*Fixtures.*", - "**/__fixtures__/**/*", - "**/__mocks__/**/*", - "api/**/*", - "pages/api/**/*", - "src/pages/api/**/*", ], "rules": { - "compat/compat": "off", + "node/no-extraneous-require": "off", + "node/no-missing-require": "off", + "node/no-unpublished-import": "off", + "node/no-unpublished-require": "off", }, }, + { + "extends": [ + "plugin:playwright/playwright-test", + ], + "files": [ + "**/*spec.*", + "e2e/**/*", + "tests/**/*", + ], + }, ], "parser": "@babel/eslint-parser", "parserOptions": { @@ -4857,6 +11726,9 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "allowAsStatement": true, }, ], + "node/no-extraneous-import": "off", + "node/no-missing-import": "off", + "node/no-unsupported-features/es-syntax": "off", "object-curly-newline": "off", "operator-linebreak": "off", "quote-props": "off", @@ -4872,24 +11744,71 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr ], }, }, - "lintAllEsApis": true, "polyfills": [ - "document.body", + "Array.prototype.copyWithin", + "Array.prototype.fill", + "Array.prototype.find", + "Array.prototype.findIndex", + "Array.prototype.flagMap", + "Array.prototype.flat", + "Array.from", + "Array.prototype.includes", + "Array.of", + "Function.name", + "Map", + "Number.EPSILON", + "Number.isFinite", + "Number.isInteger", + "Number.isNaN", + "Number.isSafeInteger", + "Number.MAX_SAFE_INTEGER", + "Number.MIN_SAFE_INTEGER", + "Number.parseFloat", + "Number.parseInt", + "Object.assign", + "Object.entries", + "Object.getOwnPropertyDescriptors", + "Object.keys", + "Object.is", + "Object.values", + "Reflect", + "RegExp", + "Set", + "Symbol", + "String.prototype.codePointAt", + "String.prototype.endsWith", + "String.prototype.fromCodePoint", + "String.prototype.includes", + "String.prototype.padStart", + "String.prototype.padEnd", + "String.prototype.raw", + "String.prototype.repeat", + "String.prototype.startsWith", + "String.prototype.trimLeft", + "String.prototype.trimRight", + "URL", + "URLSearchParams", + "WeakMap", + "WeakSet", + "Promise", + "fetch", ], }, } `; -exports[`eslint > with options > should return a config for { language: 'TypeScript', environments: [ 'Browser' ], frameworks: [ 'Testing Library' ] } 1`] = ` +exports[`eslint > with options > should return a config for { language: 'TypeScript', environments: [ 'Node' ], frameworks: [ 'Next.js' ], plugins: [ 'Storybook' ] } 1`] = ` { "env": { - "browser": true, + "node": true, }, "extends": [ "eslint:recommended", "plugin:prettier/recommended", "airbnb-base", - "plugin:compat/recommended", + "plugin:node/recommended", + "plugin:security/recommended", + "plugin:storybook/recommended", ], "overrides": [ { @@ -5073,34 +11992,14 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "**/jest*", "**/setupTests.*", "**/test-utils.*", - "**/*Fixtures.*", - "**/__fixtures__/**/*", - "**/__mocks__/**/*", - "api/**/*", - "pages/api/**/*", - "src/pages/api/**/*", ], "rules": { - "compat/compat": "off", + "node/no-extraneous-require": "off", + "node/no-missing-require": "off", + "node/no-unpublished-import": "off", + "node/no-unpublished-require": "off", }, }, - { - "extends": [ - "plugin:testing-library/react", - ], - "files": [ - "**/*.spec.*", - "**/jest*", - "**/setupTests.*", - "**/test-utils.*", - "**/*Fixtures.*", - "**/__fixtures__/**/*", - "**/__mocks__/**/*", - ], - "plugins": [ - "testing-library", - ], - }, ], "parser": "@babel/eslint-parser", "parserOptions": { @@ -5161,6 +12060,9 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "allowAsStatement": true, }, ], + "node/no-extraneous-import": "off", + "node/no-missing-import": "off", + "node/no-unsupported-features/es-syntax": "off", "object-curly-newline": "off", "operator-linebreak": "off", "quote-props": "off", @@ -5176,15 +12078,60 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr ], }, }, - "lintAllEsApis": true, "polyfills": [ - "document.body", + "Array.prototype.copyWithin", + "Array.prototype.fill", + "Array.prototype.find", + "Array.prototype.findIndex", + "Array.prototype.flagMap", + "Array.prototype.flat", + "Array.from", + "Array.prototype.includes", + "Array.of", + "Function.name", + "Map", + "Number.EPSILON", + "Number.isFinite", + "Number.isInteger", + "Number.isNaN", + "Number.isSafeInteger", + "Number.MAX_SAFE_INTEGER", + "Number.MIN_SAFE_INTEGER", + "Number.parseFloat", + "Number.parseInt", + "Object.assign", + "Object.entries", + "Object.getOwnPropertyDescriptors", + "Object.keys", + "Object.is", + "Object.values", + "Reflect", + "RegExp", + "Set", + "Symbol", + "String.prototype.codePointAt", + "String.prototype.endsWith", + "String.prototype.fromCodePoint", + "String.prototype.includes", + "String.prototype.padStart", + "String.prototype.padEnd", + "String.prototype.raw", + "String.prototype.repeat", + "String.prototype.startsWith", + "String.prototype.trimLeft", + "String.prototype.trimRight", + "URL", + "URLSearchParams", + "WeakMap", + "WeakSet", + "Promise", + "fetch", ], }, } `; -exports[`eslint > with options > should return a config for { language: 'TypeScript', environments: [ 'Node' ], frameworks: [ 'Cypress' ] } 1`] = ` +exports[`eslint > with options > should return a config for { language: 'TypeScript', environments: [ 'Node' ], frameworks: [ 'Next.js' ], plugins: [ 'Testing Library' ] } 1`] = ` { "env": { "node": true, @@ -5387,19 +12334,20 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr }, }, { - "env": { - "cypress/globals": true, - }, "extends": [ - "plugin:cypress/recommended", + "plugin:testing-library/react", ], "files": [ - "**/*spec.*", - "e2e/**/*", - "tests/**/*", + "**/*.spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + "**/*Fixtures.*", + "**/__fixtures__/**/*", + "**/__mocks__/**/*", ], "plugins": [ - "cypress", + "testing-library", ], }, ], @@ -5462,29 +12410,78 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "allowAsStatement": true, }, ], - "node/no-extraneous-import": "off", - "node/no-missing-import": "off", - "node/no-unsupported-features/es-syntax": "off", - "object-curly-newline": "off", - "operator-linebreak": "off", - "quote-props": "off", - }, - "settings": { - "import/resolver": { - "node": { - "extensions": [ - ".js", - ".jsx", - ".ts", - ".tsx", - ], - }, - }, + "node/no-extraneous-import": "off", + "node/no-missing-import": "off", + "node/no-unsupported-features/es-syntax": "off", + "object-curly-newline": "off", + "operator-linebreak": "off", + "quote-props": "off", + }, + "settings": { + "import/resolver": { + "node": { + "extensions": [ + ".js", + ".jsx", + ".ts", + ".tsx", + ], + }, + }, + "polyfills": [ + "Array.prototype.copyWithin", + "Array.prototype.fill", + "Array.prototype.find", + "Array.prototype.findIndex", + "Array.prototype.flagMap", + "Array.prototype.flat", + "Array.from", + "Array.prototype.includes", + "Array.of", + "Function.name", + "Map", + "Number.EPSILON", + "Number.isFinite", + "Number.isInteger", + "Number.isNaN", + "Number.isSafeInteger", + "Number.MAX_SAFE_INTEGER", + "Number.MIN_SAFE_INTEGER", + "Number.parseFloat", + "Number.parseInt", + "Object.assign", + "Object.entries", + "Object.getOwnPropertyDescriptors", + "Object.keys", + "Object.is", + "Object.values", + "Reflect", + "RegExp", + "Set", + "Symbol", + "String.prototype.codePointAt", + "String.prototype.endsWith", + "String.prototype.fromCodePoint", + "String.prototype.includes", + "String.prototype.padStart", + "String.prototype.padEnd", + "String.prototype.raw", + "String.prototype.repeat", + "String.prototype.startsWith", + "String.prototype.trimLeft", + "String.prototype.trimRight", + "URL", + "URLSearchParams", + "WeakMap", + "WeakSet", + "Promise", + "fetch", + ], }, } `; -exports[`eslint > with options > should return a config for { language: 'TypeScript', environments: [ 'Node' ], frameworks: [ 'Emotion' ] } 1`] = ` +exports[`eslint > with options > should return a config for { language: 'TypeScript', environments: [ 'Node' ], frameworks: [ 'React' ], plugins: [ 'Cypress' ] } 1`] = ` { "env": { "node": true, @@ -5495,6 +12492,9 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "airbnb-base", "plugin:node/recommended", "plugin:security/recommended", + "plugin:react/recommended", + "plugin:react-hooks/recommended", + "plugin:jsx-a11y/recommended", ], "overrides": [ { @@ -5686,12 +12686,29 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "node/no-unpublished-require": "off", }, }, + { + "env": { + "cypress/globals": true, + }, + "extends": [ + "plugin:cypress/recommended", + ], + "files": [ + "**/*spec.*", + "e2e/**/*", + "tests/**/*", + ], + "plugins": [ + "cypress", + ], + }, ], "parser": "@babel/eslint-parser", "parserOptions": { "allowImportExportEverywhere": true, "ecmaFeatures": { "impliedStrict": true, + "jsx": true, "modules": true, }, "ecmaVersion": 6, @@ -5699,15 +12716,12 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr }, "plugins": [ "prettier", - "@emotion", + "react", + "react-hooks", + "jsx-a11y", ], "root": true, "rules": { - "@emotion/import-from-emotion": "error", - "@emotion/jsx-import": "off", - "@emotion/no-vanilla": "error", - "@emotion/pkg-renaming": "error", - "@emotion/styled-import": "error", "comma-dangle": "off", "curly": [ "error", @@ -5758,14 +12772,8 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "object-curly-newline": "off", "operator-linebreak": "off", "quote-props": "off", - "react/no-unknown-property": [ - "error", - { - "ignore": [ - "css", - ], - }, - ], + "react/display-name": "off", + "react/react-in-jsx-scope": "off", }, "settings": { "import/resolver": { @@ -5778,11 +12786,14 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr ], }, }, + "react": { + "version": "detect", + }, }, } `; -exports[`eslint > with options > should return a config for { language: 'TypeScript', environments: [ 'Node' ], frameworks: [ 'Jest' ] } 1`] = ` +exports[`eslint > with options > should return a config for { language: 'TypeScript', environments: [ 'Node' ], frameworks: [ 'React' ], plugins: [ 'Emotion' ] } 1`] = ` { "env": { "node": true, @@ -5793,6 +12804,9 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "airbnb-base", "plugin:node/recommended", "plugin:security/recommended", + "plugin:react/recommended", + "plugin:react-hooks/recommended", + "plugin:jsx-a11y/recommended", ], "overrides": [ { @@ -5984,32 +12998,13 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "node/no-unpublished-require": "off", }, }, - { - "env": { - "jest/globals": true, - }, - "extends": [ - "plugin:jest/recommended", - ], - "files": [ - "**/*.spec.*", - "**/jest*", - "**/setupTests.*", - "**/test-utils.*", - "**/*Fixtures.*", - "**/__fixtures__/**/*", - "**/__mocks__/**/*", - ], - "plugins": [ - "jest", - ], - }, ], "parser": "@babel/eslint-parser", "parserOptions": { "allowImportExportEverywhere": true, "ecmaFeatures": { "impliedStrict": true, + "jsx": true, "modules": true, }, "ecmaVersion": 6, @@ -6017,9 +13012,18 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr }, "plugins": [ "prettier", + "react", + "react-hooks", + "jsx-a11y", + "@emotion", ], "root": true, "rules": { + "@emotion/import-from-emotion": "error", + "@emotion/jsx-import": "off", + "@emotion/no-vanilla": "error", + "@emotion/pkg-renaming": "error", + "@emotion/styled-import": "error", "comma-dangle": "off", "curly": [ "error", @@ -6070,6 +13074,16 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "object-curly-newline": "off", "operator-linebreak": "off", "quote-props": "off", + "react/display-name": "off", + "react/no-unknown-property": [ + "error", + { + "ignore": [ + "css", + ], + }, + ], + "react/react-in-jsx-scope": "off", }, "settings": { "import/resolver": { @@ -6082,11 +13096,14 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr ], }, }, + "react": { + "version": "detect", + }, }, } `; -exports[`eslint > with options > should return a config for { language: 'TypeScript', environments: [ 'Node' ], frameworks: [ 'Next.js' ] } 1`] = ` +exports[`eslint > with options > should return a config for { language: 'TypeScript', environments: [ 'Node' ], frameworks: [ 'React' ], plugins: [ 'Jest' ] } 1`] = ` { "env": { "node": true, @@ -6097,7 +13114,9 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "airbnb-base", "plugin:node/recommended", "plugin:security/recommended", - "next", + "plugin:react/recommended", + "plugin:react-hooks/recommended", + "plugin:jsx-a11y/recommended", ], "overrides": [ { @@ -6289,12 +13308,33 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "node/no-unpublished-require": "off", }, }, + { + "env": { + "jest/globals": true, + }, + "extends": [ + "plugin:jest/recommended", + ], + "files": [ + "**/*.spec.*", + "**/jest*", + "**/setupTests.*", + "**/test-utils.*", + "**/*Fixtures.*", + "**/__fixtures__/**/*", + "**/__mocks__/**/*", + ], + "plugins": [ + "jest", + ], + }, ], "parser": "@babel/eslint-parser", "parserOptions": { "allowImportExportEverywhere": true, "ecmaFeatures": { "impliedStrict": true, + "jsx": true, "modules": true, }, "ecmaVersion": 6, @@ -6302,6 +13342,9 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr }, "plugins": [ "prettier", + "react", + "react-hooks", + "jsx-a11y", ], "root": true, "rules": { @@ -6355,6 +13398,8 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "object-curly-newline": "off", "operator-linebreak": "off", "quote-props": "off", + "react/display-name": "off", + "react/react-in-jsx-scope": "off", }, "settings": { "import/resolver": { @@ -6367,60 +13412,14 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr ], }, }, - "polyfills": [ - "Array.prototype.copyWithin", - "Array.prototype.fill", - "Array.prototype.find", - "Array.prototype.findIndex", - "Array.prototype.flagMap", - "Array.prototype.flat", - "Array.from", - "Array.prototype.includes", - "Array.of", - "Function.name", - "Map", - "Number.EPSILON", - "Number.isFinite", - "Number.isInteger", - "Number.isNaN", - "Number.isSafeInteger", - "Number.MAX_SAFE_INTEGER", - "Number.MIN_SAFE_INTEGER", - "Number.parseFloat", - "Number.parseInt", - "Object.assign", - "Object.entries", - "Object.getOwnPropertyDescriptors", - "Object.keys", - "Object.is", - "Object.values", - "Reflect", - "RegExp", - "Set", - "Symbol", - "String.prototype.codePointAt", - "String.prototype.endsWith", - "String.prototype.fromCodePoint", - "String.prototype.includes", - "String.prototype.padStart", - "String.prototype.padEnd", - "String.prototype.raw", - "String.prototype.repeat", - "String.prototype.startsWith", - "String.prototype.trimLeft", - "String.prototype.trimRight", - "URL", - "URLSearchParams", - "WeakMap", - "WeakSet", - "Promise", - "fetch", - ], + "react": { + "version": "detect", + }, }, } `; -exports[`eslint > with options > should return a config for { language: 'TypeScript', environments: [ 'Node' ], frameworks: [ 'Playwright' ] } 1`] = ` +exports[`eslint > with options > should return a config for { language: 'TypeScript', environments: [ 'Node' ], frameworks: [ 'React' ], plugins: [ 'Next.js' ] } 1`] = ` { "env": { "node": true, @@ -6431,6 +13430,10 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "airbnb-base", "plugin:node/recommended", "plugin:security/recommended", + "plugin:react/recommended", + "plugin:react-hooks/recommended", + "plugin:jsx-a11y/recommended", + "next", ], "overrides": [ { @@ -6622,22 +13625,13 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "node/no-unpublished-require": "off", }, }, - { - "extends": [ - "plugin:playwright/playwright-test", - ], - "files": [ - "**/*spec.*", - "e2e/**/*", - "tests/**/*", - ], - }, ], "parser": "@babel/eslint-parser", "parserOptions": { "allowImportExportEverywhere": true, "ecmaFeatures": { "impliedStrict": true, + "jsx": true, "modules": true, }, "ecmaVersion": 6, @@ -6645,6 +13639,9 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr }, "plugins": [ "prettier", + "react", + "react-hooks", + "jsx-a11y", ], "root": true, "rules": { @@ -6698,6 +13695,8 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "object-curly-newline": "off", "operator-linebreak": "off", "quote-props": "off", + "react/display-name": "off", + "react/react-in-jsx-scope": "off", }, "settings": { "import/resolver": { @@ -6710,11 +13709,14 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr ], }, }, + "react": { + "version": "detect", + }, }, } `; -exports[`eslint > with options > should return a config for { language: 'TypeScript', environments: [ 'Node' ], frameworks: [ 'React' ] } 1`] = ` +exports[`eslint > with options > should return a config for { language: 'TypeScript', environments: [ 'Node' ], frameworks: [ 'React' ], plugins: [ 'Playwright' ] } 1`] = ` { "env": { "node": true, @@ -6919,6 +13921,16 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "node/no-unpublished-require": "off", }, }, + { + "extends": [ + "plugin:playwright/playwright-test", + ], + "files": [ + "**/*spec.*", + "e2e/**/*", + "tests/**/*", + ], + }, ], "parser": "@babel/eslint-parser", "parserOptions": { @@ -7010,7 +14022,7 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr } `; -exports[`eslint > with options > should return a config for { language: 'TypeScript', environments: [ 'Node' ], frameworks: [ 'Storybook' ] } 1`] = ` +exports[`eslint > with options > should return a config for { language: 'TypeScript', environments: [ 'Node' ], frameworks: [ 'React' ], plugins: [ 'Storybook' ] } 1`] = ` { "env": { "node": true, @@ -7021,6 +14033,9 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "airbnb-base", "plugin:node/recommended", "plugin:security/recommended", + "plugin:react/recommended", + "plugin:react-hooks/recommended", + "plugin:jsx-a11y/recommended", "plugin:storybook/recommended", ], "overrides": [ @@ -7219,6 +14234,7 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "allowImportExportEverywhere": true, "ecmaFeatures": { "impliedStrict": true, + "jsx": true, "modules": true, }, "ecmaVersion": 6, @@ -7226,6 +14242,9 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr }, "plugins": [ "prettier", + "react", + "react-hooks", + "jsx-a11y", ], "root": true, "rules": { @@ -7279,6 +14298,8 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "object-curly-newline": "off", "operator-linebreak": "off", "quote-props": "off", + "react/display-name": "off", + "react/react-in-jsx-scope": "off", }, "settings": { "import/resolver": { @@ -7291,11 +14312,14 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr ], }, }, + "react": { + "version": "detect", + }, }, } `; -exports[`eslint > with options > should return a config for { language: 'TypeScript', environments: [ 'Node' ], frameworks: [ 'Testing Library' ] } 1`] = ` +exports[`eslint > with options > should return a config for { language: 'TypeScript', environments: [ 'Node' ], frameworks: [ 'React' ], plugins: [ 'Testing Library' ] } 1`] = ` { "env": { "node": true, @@ -7306,6 +14330,9 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "airbnb-base", "plugin:node/recommended", "plugin:security/recommended", + "plugin:react/recommended", + "plugin:react-hooks/recommended", + "plugin:jsx-a11y/recommended", ], "overrides": [ { @@ -7520,6 +14547,7 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "allowImportExportEverywhere": true, "ecmaFeatures": { "impliedStrict": true, + "jsx": true, "modules": true, }, "ecmaVersion": 6, @@ -7527,6 +14555,9 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr }, "plugins": [ "prettier", + "react", + "react-hooks", + "jsx-a11y", ], "root": true, "rules": { @@ -7580,6 +14611,8 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr "object-curly-newline": "off", "operator-linebreak": "off", "quote-props": "off", + "react/display-name": "off", + "react/react-in-jsx-scope": "off", }, "settings": { "import/resolver": { @@ -7592,6 +14625,9 @@ exports[`eslint > with options > should return a config for { language: 'TypeScr ], }, }, + "react": { + "version": "detect", + }, }, } `; diff --git a/src/configs/eslint/config.spec.ts b/src/configs/eslint/config.spec.ts index 52dee153..cc66d99e 100644 --- a/src/configs/eslint/config.spec.ts +++ b/src/configs/eslint/config.spec.ts @@ -15,7 +15,7 @@ import { describe, expect, it, vi, Mock } from 'vitest'; -import { Language, Environment, Framework } from '../../types/shared'; +import { Language, Environment, Framework, Plugin } from '../../types/shared'; import { getAllChoiceCombinations } from '../../lib/choices'; import { getOptions as getOptionsMock } from '../../lib/options'; @@ -109,6 +109,7 @@ describe('eslint', () => { language: Language, environments: [Environment], frameworks: [Framework], + plugins: [Plugin], }); it.each(matrix)('should return a config for %o', (options) => { diff --git a/src/configs/eslint/config.ts b/src/configs/eslint/config.ts index 18ad9fb7..b9c5cedf 100644 --- a/src/configs/eslint/config.ts +++ b/src/configs/eslint/config.ts @@ -17,7 +17,7 @@ import { cwd } from 'process'; import { flow, mergeWith, isArray, isObject, isEmpty, uniq } from 'lodash/fp'; -import { Language, Environment, Framework } from '../../types/shared'; +import { Language, Environment, Framework, Plugin } from '../../types/shared'; import * as logger from '../../lib/logger'; import { getOptions } from '../../lib/options'; @@ -313,7 +313,6 @@ function customizeFramework(frameworks?: Framework[]) { settings: { react: { version: 'detect' } }, }, [Framework.NEXT_JS]: { - extends: ['next'], settings: { // This is needed for eslint-plugin-compat: https://www.npmjs.com/package/eslint-plugin-compat#adding-polyfills // The list is based on https://github.com/vercel/next.js/blob/canary/packages/next-polyfill-nomodule/src/index.js @@ -368,7 +367,38 @@ function customizeFramework(frameworks?: Framework[]) { ], }, }, - [Framework.EMOTION]: { + }; + return (config: ESLintConfig): ESLintConfig => { + if (!frameworks || isEmpty(frameworks)) { + return config; + } + + if ( + frameworks.includes(Framework.NEXT_JS) && + frameworks.includes(Framework.REACT) + ) { + logger.warn( + `The '${Framework.NEXT_JS}' framework includes React-specific rules. Please remove the '${Framework.REACT}' framework to avoid conflicts.`, + ); + // eslint-disable-next-line no-param-reassign + frameworks = frameworks.filter( + (framework) => framework !== Framework.REACT, + ); + } + + return frameworks.reduce((acc, framework: Framework) => { + const overrides = frameworkMap[framework]; + return customizeConfig(acc, overrides); + }, config); + }; +} + +function customizePlugin(plugins?: Plugin[]) { + const pluginMap = { + [Plugin.NEXT_JS]: { + extends: ['next'], + }, + [Plugin.EMOTION]: { plugins: ['@emotion'], rules: { '@emotion/import-from-emotion': 'error', @@ -379,7 +409,7 @@ function customizeFramework(frameworks?: Framework[]) { 'react/no-unknown-property': ['error', { ignore: ['css'] }], }, }, - [Framework.JEST]: { + [Plugin.JEST]: { overrides: [ { files: UNIT_TEST_FILES, @@ -389,7 +419,7 @@ function customizeFramework(frameworks?: Framework[]) { }, ], }, - [Framework.TESTING_LIBRARY]: { + [Plugin.TESTING_LIBRARY]: { overrides: [ { files: UNIT_TEST_FILES, @@ -398,7 +428,7 @@ function customizeFramework(frameworks?: Framework[]) { }, ], }, - [Framework.CYPRESS]: { + [Plugin.CYPRESS]: { overrides: [ { files: ['**/*spec.*', 'e2e/**/*', 'tests/**/*'], @@ -408,7 +438,7 @@ function customizeFramework(frameworks?: Framework[]) { }, ], }, - [Framework.PLAYWRIGHT]: { + [Plugin.PLAYWRIGHT]: { overrides: [ { files: ['**/*spec.*', 'e2e/**/*', 'tests/**/*'], @@ -416,30 +446,17 @@ function customizeFramework(frameworks?: Framework[]) { }, ], }, - [Framework.STORYBOOK]: { + [Plugin.STORYBOOK]: { extends: ['plugin:storybook/recommended'], }, }; return (config: ESLintConfig): ESLintConfig => { - if (!frameworks || isEmpty(frameworks)) { + if (!plugins || isEmpty(plugins)) { return config; } - if ( - frameworks.includes(Framework.NEXT_JS) && - frameworks.includes(Framework.REACT) - ) { - logger.warn( - `The '${Framework.NEXT_JS}' framework includes React-specific rules. Please remove the '${Framework.REACT}' framework to avoid conflicts.`, - ); - // eslint-disable-next-line no-param-reassign - frameworks = frameworks.filter( - (framework) => framework !== Framework.REACT, - ); - } - - return frameworks.reduce((acc, framework: Framework) => { - const overrides = frameworkMap[framework]; + return plugins.reduce((acc, plugin: Plugin) => { + const overrides = pluginMap[plugin]; return customizeConfig(acc, overrides); }, config); }; @@ -495,6 +512,7 @@ export function createConfig(overrides: ESLintConfig = {}): ESLintConfig { customizeLanguage(options.language), customizeEnvironments(options.environments), customizeFramework(options.frameworks), + customizePlugin(options.plugins), addCopyrightNotice(options.openSource), applyOverrides(overrides), )(base); diff --git a/src/lib/options.spec.ts b/src/lib/options.spec.ts index 634f7e69..8bc4274f 100644 --- a/src/lib/options.spec.ts +++ b/src/lib/options.spec.ts @@ -15,7 +15,7 @@ import { describe, expect, it, vi } from 'vitest'; -import { Environment, Framework, Language } from '../types/shared'; +import { Environment, Framework, Language, Plugin } from '../types/shared'; import { pickConfigOrDetect, @@ -26,6 +26,7 @@ import { detectOpenSource, NODE_LIBRARIES, BROWSER_LIBRARIES, + detectPlugins, } from './options'; const basePackageJson = { @@ -159,12 +160,6 @@ describe('options', () => { it.each([ ['next', Framework.NEXT_JS], ['react', Framework.REACT], - ['@emotion/react', Framework.EMOTION], - ['jest', Framework.JEST], - ['@testing-library/react', Framework.TESTING_LIBRARY], - ['cypress', Framework.CYPRESS], - ['playwright', Framework.PLAYWRIGHT], - ['storybook', Framework.STORYBOOK], ])( 'should, when `%s` is installed, include the `%s` preset', (library, preset) => { @@ -190,6 +185,29 @@ describe('options', () => { }); }); + describe('detectPlugins', () => { + it.each([ + ['eslint-config-next', Plugin.NEXT_JS], + ['@emotion/eslint-plugin', Plugin.EMOTION], + ['eslint-plugin-jest', Plugin.JEST], + ['eslint-plugin-testing-library', Plugin.TESTING_LIBRARY], + ['eslint-plugin-cypress', Plugin.CYPRESS], + ['eslint-plugin-playwright', Plugin.PLAYWRIGHT], + ['eslint-plugin-storybook', Plugin.STORYBOOK], + ])( + 'should, when `%s` is installed, include the `%s` preset', + (library, preset) => { + const packageJson = { + ...basePackageJson, + dependencies: { [library]: '^1.0.0' }, + }; + const actual = detectPlugins(packageJson); + + expect(actual).toContain(preset); + }, + ); + }); + describe('detectOpenSource', () => { it('should return true when the license is `Apache-2.0`', () => { const packageJson = { diff --git a/src/lib/options.ts b/src/lib/options.ts index 34ab3678..4314059f 100644 --- a/src/lib/options.ts +++ b/src/lib/options.ts @@ -19,6 +19,7 @@ import { Language, Options, PackageJson, + Plugin, } from '../types/shared'; import { readPackageJson } from './files'; @@ -43,6 +44,7 @@ export function getOptions(): Required { language: pick(config.language, detectLanguage), environments: pick(config.environments, detectEnvironments), frameworks: pick(config.frameworks, detectFrameworks), + plugins: pick(config.plugins, detectPlugins), openSource: pick(config.openSource, detectOpenSource), publish: Boolean(config.publish), }; @@ -106,31 +108,41 @@ export function detectFrameworks(packageJson: PackageJson): Framework[] { frameworks.push(Framework.REACT); } - if (hasDependency(packageJson, '@emotion/react')) { - frameworks.push(Framework.EMOTION); + return frameworks; +} + +export function detectPlugins(packageJson: PackageJson): Plugin[] { + const plugins: Plugin[] = []; + + if (hasDependency(packageJson, 'eslint-config-next')) { + plugins.push(Plugin.NEXT_JS); } - if (hasDependency(packageJson, 'jest')) { - frameworks.push(Framework.JEST); + if (hasDependency(packageJson, '@emotion/eslint-plugin')) { + plugins.push(Plugin.EMOTION); } - if (hasDependency(packageJson, '@testing-library/react')) { - frameworks.push(Framework.TESTING_LIBRARY); + if (hasDependency(packageJson, 'eslint-plugin-jest')) { + plugins.push(Plugin.JEST); } - if (hasDependency(packageJson, 'cypress')) { - frameworks.push(Framework.CYPRESS); + if (hasDependency(packageJson, 'eslint-plugin-testing-library')) { + plugins.push(Plugin.TESTING_LIBRARY); } - if (hasDependency(packageJson, 'playwright')) { - frameworks.push(Framework.PLAYWRIGHT); + if (hasDependency(packageJson, 'eslint-plugin-cypress')) { + plugins.push(Plugin.CYPRESS); } - if (hasDependency(packageJson, 'storybook')) { - frameworks.push(Framework.STORYBOOK); + if (hasDependency(packageJson, 'eslint-plugin-playwright')) { + plugins.push(Plugin.PLAYWRIGHT); } - return frameworks; + if (hasDependency(packageJson, 'eslint-plugin-storybook')) { + plugins.push(Plugin.STORYBOOK); + } + + return plugins; } export function detectOpenSource(packageJson: PackageJson) { diff --git a/src/types/shared.ts b/src/types/shared.ts index 1e352aaa..3bc39aab 100644 --- a/src/types/shared.ts +++ b/src/types/shared.ts @@ -43,6 +43,10 @@ export enum Environment { export enum Framework { REACT = 'React', NEXT_JS = 'Next.js', +} + +export enum Plugin { + NEXT_JS = 'Next.js', EMOTION = 'Emotion', JEST = 'Jest', TESTING_LIBRARY = 'Testing Library', @@ -55,6 +59,7 @@ export interface Options { language?: Language; environments?: Environment[]; frameworks?: Framework[]; + plugins?: Plugin[]; openSource?: boolean; publish?: boolean; } From 5cfe2a3bb8d78807e358bdade916b1801dc45355 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Connor=20B=C3=A4r?= Date: Tue, 23 Jan 2024 11:55:04 +0000 Subject: [PATCH 3/7] Warn about missing ESLint plugins --- src/lib/options.spec.ts | 23 ++++++++++++++++- src/lib/options.ts | 56 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+), 1 deletion(-) diff --git a/src/lib/options.spec.ts b/src/lib/options.spec.ts index 8bc4274f..57c17033 100644 --- a/src/lib/options.spec.ts +++ b/src/lib/options.spec.ts @@ -17,6 +17,7 @@ import { describe, expect, it, vi } from 'vitest'; import { Environment, Framework, Language, Plugin } from '../types/shared'; +import * as logger from './logger'; import { pickConfigOrDetect, hasDependency, @@ -24,9 +25,10 @@ import { detectEnvironments, detectFrameworks, detectOpenSource, + detectPlugins, + warnAboutMissingPlugins, NODE_LIBRARIES, BROWSER_LIBRARIES, - detectPlugins, } from './options'; const basePackageJson = { @@ -36,6 +38,8 @@ const basePackageJson = { _id: 'id', }; +vi.mock('./logger.ts'); + describe('options', () => { describe('pickConfigOrDetect', () => { it('should return the config value when defined', () => { @@ -235,4 +239,21 @@ describe('options', () => { expect(actual).toBe(false); }); }); + + describe('warnAboutMissingPlugins', () => { + it('should log a warning if a framework is installed but not its corresponding ESLint plugin', () => { + const packageJson = { + ...basePackageJson, + license: 'MIT', + dependencies: { next: '^1.0.0' }, + }; + + warnAboutMissingPlugins(packageJson); + + expect(logger.warn).toHaveBeenCalledOnce(); + expect(logger.warn).toHaveBeenCalledWith( + '"next" is installed but not the corresponding ESLint plugin. Please install "eslint-config-next".', + ); + }); + }); }); diff --git a/src/lib/options.ts b/src/lib/options.ts index 4314059f..e9ceffd7 100644 --- a/src/lib/options.ts +++ b/src/lib/options.ts @@ -23,6 +23,7 @@ import { } from '../types/shared'; import { readPackageJson } from './files'; +import * as logger from './logger'; // These lists are not exhaustive and should be expanded if necessary. export const NODE_LIBRARIES = [ @@ -34,10 +35,51 @@ export const NODE_LIBRARIES = [ ]; export const BROWSER_LIBRARIES = ['next', 'react', 'preact', 'svelte', 'vue']; +const FRAMEWORK_PLUGINS = [ + { + packages: ['next'], + plugin: 'eslint-config-next', + }, + { + packages: ['@emotion/react', '@emotion/styled'], + plugin: 'eslint-config-next', + }, + { + packages: ['@emotion/react', '@emotion/styled'], + plugin: '@emotion/eslint-plugin', + }, + { + packages: ['jest'], + plugin: 'eslint-plugin-jest', + }, + { + packages: [ + '@testing-library/dom', + '@testing-library/jest-dom', + '@testing-library/react', + ], + plugin: 'eslint-plugin-testing-library', + }, + { + packages: ['cypress'], + plugin: 'eslint-plugin-cypress', + }, + { + packages: ['@playwright/test'], + plugin: 'eslint-plugin-playwright', + }, + { + packages: ['storybook', '@storybook/react'], + plugin: 'eslint-plugin-storybook', + }, +]; + export function getOptions(): Required { const packageJson = readPackageJson(); const config = (packageJson.foundry || {}) as Options; + warnAboutMissingPlugins(packageJson); + const pick = pickConfigOrDetect(packageJson); return { @@ -111,6 +153,20 @@ export function detectFrameworks(packageJson: PackageJson): Framework[] { return frameworks; } +export function warnAboutMissingPlugins(packageJson: PackageJson): void { + FRAMEWORK_PLUGINS.forEach(({ packages, plugin }) => { + const installedPackage = packages.find((pkg) => + hasDependency(packageJson, pkg), + ); + + if (installedPackage && !hasDependency(packageJson, plugin)) { + logger.warn( + `"${installedPackage}" is installed but not the corresponding ESLint plugin. Please install "${plugin}".`, + ); + } + }); +} + export function detectPlugins(packageJson: PackageJson): Plugin[] { const plugins: Plugin[] = []; From cdfa0f433978d0e5bd9b8b3468357170dee3821b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Connor=20B=C3=A4r?= Date: Tue, 23 Jan 2024 13:25:17 +0000 Subject: [PATCH 4/7] Warn about unsupported ESLint plugins --- package-lock.json | 403 +++++++++------------------------------------ package.json | 1 + src/lib/options.ts | 79 ++++++--- 3 files changed, 138 insertions(+), 345 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7e0b7456..f888d22b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -39,6 +39,7 @@ "lodash": "^4.17.21", "prettier": "^3.1.0", "read-pkg-up": "^7.0.1", + "semver": "^7.5.4", "yargs": "^17.7.2" }, "bin": { @@ -201,6 +202,14 @@ "url": "https://opencollective.com/babel" } }, + "node_modules/@babel/core/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/@babel/eslint-parser": { "version": "7.23.3", "resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.23.3.tgz", @@ -218,6 +227,14 @@ "eslint": "^7.5.0 || ^8.0.0" } }, + "node_modules/@babel/eslint-parser/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/@babel/generator": { "version": "7.23.5", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.5.tgz", @@ -247,6 +264,14 @@ "node": ">=6.9.0" } }, + "node_modules/@babel/helper-compilation-targets/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/@babel/helper-environment-visitor": { "version": "7.22.20", "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", @@ -538,18 +563,6 @@ "semver": "^7.5.3" } }, - "node_modules/@changesets/apply-release-plan/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/@changesets/apply-release-plan/node_modules/prettier": { "version": "2.8.8", "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", @@ -565,27 +578,6 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, - "node_modules/@changesets/apply-release-plan/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@changesets/apply-release-plan/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/@changesets/assemble-release-plan": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/@changesets/assemble-release-plan/-/assemble-release-plan-6.0.0.tgz", @@ -600,39 +592,6 @@ "semver": "^7.5.3" } }, - "node_modules/@changesets/assemble-release-plan/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@changesets/assemble-release-plan/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@changesets/assemble-release-plan/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/@changesets/changelog-git": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/@changesets/changelog-git/-/changelog-git-0.2.0.tgz", @@ -755,33 +714,6 @@ "node": ">=4" } }, - "node_modules/@changesets/cli/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@changesets/cli/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/@changesets/cli/node_modules/supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -794,12 +726,6 @@ "node": ">=4" } }, - "node_modules/@changesets/cli/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/@changesets/config": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@changesets/config/-/config-3.0.0.tgz", @@ -896,33 +822,6 @@ "node": ">=4" } }, - "node_modules/@changesets/get-dependents-graph/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@changesets/get-dependents-graph/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/@changesets/get-dependents-graph/node_modules/supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -935,12 +834,6 @@ "node": ">=4" } }, - "node_modules/@changesets/get-dependents-graph/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/@changesets/get-github-info": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/@changesets/get-github-info/-/get-github-info-0.6.0.tgz", @@ -2359,36 +2252,6 @@ } } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - }, "node_modules/@typescript-eslint/parser": { "version": "6.13.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.13.1.tgz", @@ -2496,36 +2359,6 @@ } } }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - }, "node_modules/@typescript-eslint/utils": { "version": "6.13.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.13.1.tgz", @@ -2550,36 +2383,6 @@ "eslint": "^7.0.0 || ^8.0.0" } }, - "node_modules/@typescript-eslint/utils/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@typescript-eslint/utils/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@typescript-eslint/utils/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - }, "node_modules/@typescript-eslint/visitor-keys": { "version": "6.13.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.13.1.tgz", @@ -3060,39 +2863,6 @@ "node": ">=12.9.0" } }, - "node_modules/audit-ci/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/audit-ci/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/audit-ci/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/available-typed-arrays": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", @@ -4263,6 +4033,14 @@ "eslint-plugin-import": "^2.25.2" } }, + "node_modules/eslint-config-airbnb-base/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/eslint-config-airbnb-typescript": { "version": "17.1.0", "resolved": "https://registry.npmjs.org/eslint-config-airbnb-typescript/-/eslint-config-airbnb-typescript-17.1.0.tgz", @@ -4379,17 +4157,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint-plugin-compat/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/eslint-plugin-compat/node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", @@ -4418,25 +4185,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint-plugin-compat/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/eslint-plugin-compat/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - }, "node_modules/eslint-plugin-compat/node_modules/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", @@ -4515,6 +4263,14 @@ "node": ">=0.10.0" } }, + "node_modules/eslint-plugin-import/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/eslint-plugin-json": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/eslint-plugin-json/-/eslint-plugin-json-3.1.0.tgz", @@ -4575,6 +4331,14 @@ "eslint": ">=5.16.0" } }, + "node_modules/eslint-plugin-node/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/eslint-plugin-notice": { "version": "0.9.10", "resolved": "https://registry.npmjs.org/eslint-plugin-notice/-/eslint-plugin-notice-0.9.10.tgz", @@ -4683,6 +4447,14 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/eslint-plugin-react/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/eslint-plugin-security": { "version": "1.7.1", "resolved": "https://registry.npmjs.org/eslint-plugin-security/-/eslint-plugin-security-1.7.1.tgz", @@ -7744,39 +7516,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/make-dir/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/make-dir/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/make-dir/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/map-obj": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz", @@ -9492,11 +9231,17 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dependencies": { + "lru-cache": "^6.0.0" + }, "bin": { "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" } }, "node_modules/semver-compare": { @@ -9515,6 +9260,22 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/semver/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/semver/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, "node_modules/set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", diff --git a/package.json b/package.json index cf4c0e9c..a506846c 100644 --- a/package.json +++ b/package.json @@ -71,6 +71,7 @@ "lodash": "^4.17.21", "prettier": "^3.1.0", "read-pkg-up": "^7.0.1", + "semver": "^7.5.4", "yargs": "^17.7.2" }, "devDependencies": { diff --git a/src/lib/options.ts b/src/lib/options.ts index e9ceffd7..9b0e52d1 100644 --- a/src/lib/options.ts +++ b/src/lib/options.ts @@ -13,6 +13,8 @@ * limitations under the License. */ +import { intersects } from 'semver'; + import { Environment, Framework, @@ -37,40 +39,43 @@ export const BROWSER_LIBRARIES = ['next', 'react', 'preact', 'svelte', 'vue']; const FRAMEWORK_PLUGINS = [ { - packages: ['next'], - plugin: 'eslint-config-next', - }, - { - packages: ['@emotion/react', '@emotion/styled'], - plugin: 'eslint-config-next', + frameworkPackages: ['next'], + pluginPackage: 'eslint-config-next', + supportedRange: '>=10.0.0', }, { - packages: ['@emotion/react', '@emotion/styled'], - plugin: '@emotion/eslint-plugin', + frameworkPackages: ['@emotion/react', '@emotion/styled'], + pluginPackage: '@emotion/eslint-plugin', + supportedRange: '^11.0.0', }, { - packages: ['jest'], - plugin: 'eslint-plugin-jest', + frameworkPackages: ['jest'], + pluginPackage: 'eslint-plugin-jest', + supportedRange: '^27.0.0', }, { - packages: [ + frameworkPackages: [ '@testing-library/dom', '@testing-library/jest-dom', '@testing-library/react', ], - plugin: 'eslint-plugin-testing-library', + pluginPackage: 'eslint-plugin-testing-library', + supportedRange: '^6.0.0', }, { - packages: ['cypress'], - plugin: 'eslint-plugin-cypress', + frameworkPackages: ['cypress'], + pluginPackage: 'eslint-plugin-cypress', + supportedRange: '^2.0.0', }, { - packages: ['@playwright/test'], - plugin: 'eslint-plugin-playwright', + frameworkPackages: ['@playwright/test'], + pluginPackage: 'eslint-plugin-playwright', + supportedRange: '>=0.17.0 <1.0.0', }, { - packages: ['storybook', '@storybook/react'], - plugin: 'eslint-plugin-storybook', + frameworkPackages: ['storybook', '@storybook/react'], + pluginPackage: 'eslint-plugin-storybook', + supportedRange: '>=0.6.0 <1.0.0', }, ]; @@ -78,6 +83,7 @@ export function getOptions(): Required { const packageJson = readPackageJson(); const config = (packageJson.foundry || {}) as Options; + warnAboutUnsupportedPlugins(packageJson); warnAboutMissingPlugins(packageJson); const pick = pickConfigOrDetect(packageJson); @@ -99,10 +105,17 @@ export function pickConfigOrDetect(packageJson: PackageJson) { ) => (explicit !== undefined ? explicit : detectFn(packageJson)); } -export function hasDependency(packageJson: PackageJson, name: string): boolean { +export function getDependencyVersion( + packageJson: PackageJson, + name: string, +): string { const { dependencies = {}, devDependencies = {} } = packageJson; - return Boolean(dependencies[name] || devDependencies[name]); + return dependencies[name] || devDependencies[name]; +} + +export function hasDependency(packageJson: PackageJson, name: string): boolean { + return Boolean(getDependencyVersion(packageJson, name)); } export function detectLanguage(packageJson: PackageJson): Language { @@ -153,15 +166,33 @@ export function detectFrameworks(packageJson: PackageJson): Framework[] { return frameworks; } +export function warnAboutUnsupportedPlugins(packageJson: PackageJson): void { + FRAMEWORK_PLUGINS.forEach(({ pluginPackage, supportedRange }) => { + const version = getDependencyVersion(packageJson, pluginPackage); + + if (!version) { + return; + } + + const isSupported = intersects(version, supportedRange); + + if (!isSupported) { + logger.warn( + `"${pluginPackage}" is installed at version "${version}". Foundry has only been tested with "${supportedRange}". You may find that it works just fine, or you may not.`, + ); + } + }); +} + export function warnAboutMissingPlugins(packageJson: PackageJson): void { - FRAMEWORK_PLUGINS.forEach(({ packages, plugin }) => { - const installedPackage = packages.find((pkg) => + FRAMEWORK_PLUGINS.forEach(({ frameworkPackages, pluginPackage }) => { + const installedPackage = frameworkPackages.find((pkg) => hasDependency(packageJson, pkg), ); - if (installedPackage && !hasDependency(packageJson, plugin)) { + if (installedPackage && !hasDependency(packageJson, pluginPackage)) { logger.warn( - `"${installedPackage}" is installed but not the corresponding ESLint plugin. Please install "${plugin}".`, + `"${installedPackage}" is installed but not the corresponding ESLint plugin. Please install "${pluginPackage}".`, ); } }); From b5f54575491b23377938be568d2d4535021ff35c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Connor=20B=C3=A4r?= Date: Tue, 23 Jan 2024 13:35:40 +0000 Subject: [PATCH 5/7] Add additional unit tests --- src/lib/options.spec.ts | 63 +++++++++++++++++++++++++++++++++++++++-- src/lib/options.ts | 2 +- 2 files changed, 61 insertions(+), 4 deletions(-) diff --git a/src/lib/options.spec.ts b/src/lib/options.spec.ts index 57c17033..1d4c173c 100644 --- a/src/lib/options.spec.ts +++ b/src/lib/options.spec.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { describe, expect, it, vi } from 'vitest'; +import { afterEach, describe, expect, it, vi } from 'vitest'; import { Environment, Framework, Language, Plugin } from '../types/shared'; @@ -27,6 +27,7 @@ import { detectOpenSource, detectPlugins, warnAboutMissingPlugins, + warnAboutUnsupportedPlugins, NODE_LIBRARIES, BROWSER_LIBRARIES, } from './options'; @@ -41,6 +42,10 @@ const basePackageJson = { vi.mock('./logger.ts'); describe('options', () => { + afterEach(() => { + vi.clearAllMocks(); + }); + describe('pickConfigOrDetect', () => { it('should return the config value when defined', () => { const pickFn = pickConfigOrDetect(basePackageJson); @@ -210,6 +215,20 @@ describe('options', () => { expect(actual).toContain(preset); }, ); + + it('should detect multiple libraries', () => { + const packageJson = { + ...basePackageJson, + dependencies: { + '@emotion/eslint-plugin': '^1.0.0', + 'eslint-config-next': '^1.0.0', + }, + }; + const actual = detectPlugins(packageJson); + + expect(actual).toContain(Plugin.EMOTION); + expect(actual).toContain(Plugin.NEXT_JS); + }); }); describe('detectOpenSource', () => { @@ -240,20 +259,58 @@ describe('options', () => { }); }); + describe('warnAboutUnsupportedPlugins', () => { + it('should log a warning if a plugin is installed at a lower version than has been tested with Foundry', () => { + const packageJson = { + ...basePackageJson, + license: 'MIT', + dependencies: { 'eslint-config-next': '^9.0.0' }, + }; + + warnAboutUnsupportedPlugins(packageJson); + + expect(logger.warn).toHaveBeenCalledOnce(); + expect(logger.warn).toHaveBeenCalledWith( + '"eslint-config-next" is installed at version "^9.0.0". Foundry has only been tested with versions ">=10.0.0". You may find that it works just fine, or you may not.', + ); + }); + + it('should log a warning if a plugin is installed at a higher version than has been tested with Foundry', () => { + const packageJson = { + ...basePackageJson, + license: 'MIT', + dependencies: { 'eslint-plugin-playwright': '^1.0.0' }, + }; + + warnAboutUnsupportedPlugins(packageJson); + + expect(logger.warn).toHaveBeenCalledOnce(); + expect(logger.warn).toHaveBeenCalledWith( + '"eslint-plugin-playwright" is installed at version "^1.0.0". Foundry has only been tested with versions ">=0.17.0 <1.0.0". You may find that it works just fine, or you may not.', + ); + }); + }); + describe('warnAboutMissingPlugins', () => { it('should log a warning if a framework is installed but not its corresponding ESLint plugin', () => { const packageJson = { ...basePackageJson, license: 'MIT', - dependencies: { next: '^1.0.0' }, + dependencies: { + 'next': '^1.0.0', + '@emotion/react': '^1.0.0', + }, }; warnAboutMissingPlugins(packageJson); - expect(logger.warn).toHaveBeenCalledOnce(); + expect(logger.warn).toHaveBeenCalledTimes(2); expect(logger.warn).toHaveBeenCalledWith( '"next" is installed but not the corresponding ESLint plugin. Please install "eslint-config-next".', ); + expect(logger.warn).toHaveBeenCalledWith( + '"@emotion/react" is installed but not the corresponding ESLint plugin. Please install "@emotion/eslint-plugin".', + ); }); }); }); diff --git a/src/lib/options.ts b/src/lib/options.ts index 9b0e52d1..2862554f 100644 --- a/src/lib/options.ts +++ b/src/lib/options.ts @@ -178,7 +178,7 @@ export function warnAboutUnsupportedPlugins(packageJson: PackageJson): void { if (!isSupported) { logger.warn( - `"${pluginPackage}" is installed at version "${version}". Foundry has only been tested with "${supportedRange}". You may find that it works just fine, or you may not.`, + `"${pluginPackage}" is installed at version "${version}". Foundry has only been tested with versions "${supportedRange}". You may find that it works just fine, or you may not.`, ); } }); From 832a1d45baba00a8d2a0b1a8ea8fe12f44b9de03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Connor=20B=C3=A4r?= Date: Tue, 23 Jan 2024 13:51:03 +0000 Subject: [PATCH 6/7] Add debug command --- src/cli/debug.ts | 27 +++++++++++++++++++++++++++ src/cli/index.ts | 20 +++++++++++++++----- 2 files changed, 42 insertions(+), 5 deletions(-) create mode 100644 src/cli/debug.ts diff --git a/src/cli/debug.ts b/src/cli/debug.ts new file mode 100644 index 00000000..801b0e71 --- /dev/null +++ b/src/cli/debug.ts @@ -0,0 +1,27 @@ +/** + * Copyright 2024, SumUp Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { readPackageJson } from '../lib/files'; +import { + warnAboutMissingPlugins, + warnAboutUnsupportedPlugins, +} from '../lib/options'; + +export function debug(): void { + const packageJson = readPackageJson(); + + warnAboutUnsupportedPlugins(packageJson); + warnAboutMissingPlugins(packageJson); +} diff --git a/src/cli/index.ts b/src/cli/index.ts index 0b3738fb..f1220538 100644 --- a/src/cli/index.ts +++ b/src/cli/index.ts @@ -19,6 +19,7 @@ import yargs from 'yargs'; import { run, RunParams } from './run'; import { init, InitParams } from './init'; +import { debug } from './debug'; import { DEFAULT_OPTIONS } from './defaults'; // eslint-disable-next-line no-void @@ -55,19 +56,28 @@ void yargs 'Run any of the bundled tools.', execute('run'), ) + .command( + 'debug', + 'See which frameworks and plugins Foundry has detected in your project', + execute('debug'), + ) .showHelpOnFail(true) .demandCommand(1, '') .help() .version().argv; -type CommandType = 'init' | 'run'; +type CommandType = 'init' | 'run' | 'debug'; function execute(command: CommandType) { - const commands = { run, init }; + const commands = { run, init, debug }; const commandFn = commands[command]; - return (args: unknown): void => { - // eslint-disable-next-line no-console - commandFn(args as RunParams & InitParams).catch(console.error); + return async (args: unknown): Promise => { + try { + await commandFn(args as RunParams & InitParams); + } catch (error) { + // eslint-disable-next-line no-console + console.error(error); + } }; } From 26d390a8055c9b985ff0c5f14a9866f3d0bc54f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Connor=20B=C3=A4r?= Date: Tue, 23 Jan 2024 14:12:16 +0000 Subject: [PATCH 7/7] Add changeset --- .changeset/plenty-needles-hunt.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/plenty-needles-hunt.md diff --git a/.changeset/plenty-needles-hunt.md b/.changeset/plenty-needles-hunt.md new file mode 100644 index 00000000..729a0930 --- /dev/null +++ b/.changeset/plenty-needles-hunt.md @@ -0,0 +1,5 @@ +--- +'@sumup/foundry': major +--- + +Removed the ESLint plugins for Cypress, Emotion.js, Jest, Next.js, Playwright, Storybook, and Testing Library from the dependencies.