From b281231185997b0cfe140c2ca55915c1ca22e73e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pedro=20Schmitz?= Date: Sun, 10 Oct 2021 15:13:46 -0300 Subject: [PATCH] chore: replace eslint import resolver package --- .eslintrc | 29 ++++++++++++++++++----------- package.json | 21 ++++++++++----------- yarn.lock | 26 +++++++++++--------------- 3 files changed, 39 insertions(+), 37 deletions(-) diff --git a/.eslintrc b/.eslintrc index 0021b6b92..4ab4f8995 100644 --- a/.eslintrc +++ b/.eslintrc @@ -17,7 +17,13 @@ "SharedArrayBuffer": "readonly" }, "plugins": ["react", "react-hooks", "jsx-a11y", "prettier", "jest"], - "extends": ["plugin:react/recommended", "airbnb", "prettier", "plugin:jest/recommended", "plugin:jest/style"], + "extends": [ + "plugin:react/recommended", + "airbnb", + "prettier", + "plugin:jest/recommended", + "plugin:jest/style" + ], "rules": { "jest/prefer-strict-equal": "error", "jest/prefer-to-have-length": "warn", @@ -27,12 +33,12 @@ "react/jsx-filename-extension": "off", "react/jsx-props-no-spreading": "off", "import/no-extraneous-dependencies": [ - "error", + "error", { "devDependencies": [ - "**/*.test.[jt]s", + "**/*.test.[jt]s", "**/*.spec.[jt]s", - "**/*.test.[jt]sx", + "**/*.test.[jt]sx", "**/*.spec.[jt]sx" ] } @@ -69,12 +75,12 @@ "@typescript-eslint/no-use-before-define": [1], "import/no-unresolved": 0, "import/no-extraneous-dependencies": [ - "error", + "error", { "devDependencies": [ - "**/*.test.ts", + "**/*.test.ts", "**/*.spec.ts", - "**/*.test.tsx", + "**/*.test.tsx", "**/*.spec.tsx" ] } @@ -93,11 +99,12 @@ ], "settings": { "import/resolver": { - "root-import": { - "rootPathPrefix": "@", - "rootPathSuffix": "src", - "extensions": [".js", ".ts", ".tsx", ".jsx", ".mdx"] + "typescript": { + "project": "." } + }, + "react": { + "version": "detect" } } } diff --git a/package.json b/package.json index 73659c47d..ca48ed162 100644 --- a/package.json +++ b/package.json @@ -39,25 +39,24 @@ "@babel/preset-typescript": "7.15.0", "@commitlint/cli": "13.2.1", "@commitlint/config-conventional": "13.2.0", - "@types/node": "14.17.21", - "@types/react": "17.0.27", - "@types/react-dom": "17.0.9", - "@typescript-eslint/eslint-plugin": "4.33.0", - "@typescript-eslint/parser": "4.33.0", "@testing-library/dom": "8.7.2", "@testing-library/jest-dom": "5.14.1", "@testing-library/react": "12.1.2", "@testing-library/react-hooks": "7.0.2", "@types/jest": "27.0.2", + "@types/node": "14.17.21", + "@types/react": "17.0.27", + "@types/react-dom": "17.0.9", + "@typescript-eslint/eslint-plugin": "4.33.0", + "@typescript-eslint/parser": "4.33.0", "babel-jest": "27.2.5", - "babel-plugin-root-import": "6.6.0", "babel-preset-gatsby": "1.14.0", "commitizen": "4.2.4", "cz-conventional-changelog": "3.3.0", "eslint": "7.32.0", "eslint-config-airbnb": "18.2.1", "eslint-config-prettier": "8.3.0", - "eslint-import-resolver-root-import": "1.0.4", + "eslint-import-resolver-typescript": "2.5.0", "eslint-plugin-import": "2.24.2", "eslint-plugin-jest": "24.7.0", "eslint-plugin-jsx-a11y": "6.4.1", @@ -65,12 +64,12 @@ "eslint-plugin-react": "7.26.1", "eslint-plugin-react-hooks": "4.2.0", "husky": "7.0.2", - "lint-staged": "11.2.2", - "prettier": "2.4.1", - "typescript": "4.4.3", "identity-obj-proxy": "3.0.0", "jest": "27.2.5", - "ts-jest": "27.0.5" + "lint-staged": "11.2.2", + "prettier": "2.4.1", + "ts-jest": "27.0.5", + "typescript": "4.4.3" }, "config": { "commitizen": { diff --git a/yarn.lock b/yarn.lock index 36cd1db68..9899fc4f1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2912,13 +2912,6 @@ babel-plugin-remove-graphql-queries@^3.14.0: "@babel/runtime" "^7.15.4" gatsby-core-utils "^2.14.0" -babel-plugin-root-import@6.6.0: - version "6.6.0" - resolved "https://registry.yarnpkg.com/babel-plugin-root-import/-/babel-plugin-root-import-6.6.0.tgz#85940840f308a8c292f66ca0b5bdd314046273ed" - integrity sha512-SPzVOHd7nDh5loZwZBxtX/oOu1MXeKjTkz+1VnnzLWC0dk8sJIGC2IDQ2uWIBjE5mUtXlQ35MTHSqN0Xn7qHrg== - dependencies: - slash "^3.0.0" - babel-plugin-transform-react-remove-prop-types@^0.4.24: version "0.4.24" resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-remove-prop-types/-/babel-plugin-transform-react-remove-prop-types-0.4.24.tgz#f2edaf9b4c6a5fbe5c1d678bfb531078c1555f3a" @@ -4749,7 +4742,7 @@ eslint-config-react-app@^6.0.0: dependencies: confusing-browser-globals "^1.0.10" -eslint-import-resolver-node@^0.3.2, eslint-import-resolver-node@^0.3.6: +eslint-import-resolver-node@^0.3.6: version "0.3.6" resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.6.tgz#4048b958395da89668252001dbd9eca6b83bacbd" integrity sha512-0En0w03NRVMn9Uiyn8YRPDKvWjxCWkslUEhGNTdGx15RvPJYQ+lbOlqrlNI2vEAs4pDYK4f/HN2TbDmk5TP0iw== @@ -4757,13 +4750,16 @@ eslint-import-resolver-node@^0.3.2, eslint-import-resolver-node@^0.3.6: debug "^3.2.7" resolve "^1.20.0" -eslint-import-resolver-root-import@1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/eslint-import-resolver-root-import/-/eslint-import-resolver-root-import-1.0.4.tgz#82991138d8014b5e2283b27622ad1ba21f535609" - integrity sha512-c8cUQcELRBe0mnblBZJKEfL+jIUGR8pctK5gdru5N7bBOIve2WZ0R3KoO5GOksXJ4WzZhtcBS2xPaTJYEe4IdQ== +eslint-import-resolver-typescript@2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-2.5.0.tgz#07661966b272d14ba97f597b51e1a588f9722f0a" + integrity sha512-qZ6e5CFr+I7K4VVhQu3M/9xGv9/YmwsEXrsm3nimw8vWaVHRDrQRp26BgCypTxBp3vUp4o5aVEJRiy0F2DFddQ== dependencies: - eslint-import-resolver-node "^0.3.2" - json5 "^2.1.0" + debug "^4.3.1" + glob "^7.1.7" + is-glob "^4.0.1" + resolve "^1.20.0" + tsconfig-paths "^3.9.0" eslint-module-utils@^2.6.2: version "2.6.2" @@ -7757,7 +7753,7 @@ json-stable-stringify-without-jsonify@^1.0.1: resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= -json5@2.x, json5@^2.1.0, json5@^2.1.2: +json5@2.x, json5@^2.1.2: version "2.2.0" resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.0.tgz#2dfefe720c6ba525d9ebd909950f0515316c89a3" integrity sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==