diff --git a/vscode/.eslintrc.json b/vscode/.eslintrc.json deleted file mode 100644 index 5b437c21d..000000000 --- a/vscode/.eslintrc.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "root": true, - "parser": "@typescript-eslint/parser", - "extends": [ - "plugin:@shopify/typescript", - "plugin:@shopify/typescript-type-checking", - "plugin:@shopify/prettier" - ], - "parserOptions": { - "project": "tsconfig.json" - }, - "settings": { - "import/resolver": { - "typescript": { - "project": "tsconfig.json" - } - } - }, - "rules": { - "@typescript-eslint/no-floating-promises": "error", - "consistent-return": "off", - "no-warning-comments": "off", - "no-console": "warn", - "@shopify/no-debugger": "warn", - "no-template-curly-in-string": "warn", - "eqeqeq": "error", - "no-invalid-this": "error", - "no-lonely-if": "error", - "max-len": [ - "error", - { - "code": 120 - } - ] - } -} diff --git a/vscode/eslint.config.mjs b/vscode/eslint.config.mjs new file mode 100644 index 000000000..b3a2535c8 --- /dev/null +++ b/vscode/eslint.config.mjs @@ -0,0 +1,52 @@ +import tsParser from "@typescript-eslint/parser"; +import tsPlugin from "@typescript-eslint/eslint-plugin"; +import shopifyPlugin from "@shopify/eslint-plugin"; + +const config = [ + ...shopifyPlugin.configs.core, + ...shopifyPlugin.configs.typescript, + ...shopifyPlugin.configs.prettier, + { + languageOptions: { + parser: tsParser, + ecmaVersion: 5, + sourceType: "script", + + parserOptions: { + project: "tsconfig.json", + }, + }, + + plugins: { + "@typescript-eslint": tsPlugin, + }, + + settings: { + "import/resolver": { + typescript: { + project: "tsconfig.json", + }, + }, + }, + + "rules": { + "@typescript-eslint/no-floating-promises": "error", + "consistent-return": "off", + "no-warning-comments": "off", + "no-console": "warn", + "@shopify/no-debugger": "warn", + "no-template-curly-in-string": "warn", + "eqeqeq": "error", + "no-invalid-this": "error", + "no-lonely-if": "error", + "max-len": [ + "error", + { + "code": 120 + } + ] + } + } +] + +export default config; diff --git a/vscode/package.json b/vscode/package.json index 03c9f0827..ffaf4a038 100644 --- a/vscode/package.json +++ b/vscode/package.json @@ -643,7 +643,9 @@ }, "devDependencies": { "@babel/core": "^7.25.2", - "@shopify/eslint-plugin": "^45.0.0", + "@eslint/eslintrc": "^3.1.0", + "@eslint/js": "^9.8.0", + "@shopify/eslint-plugin": "^46.0.0", "@shopify/prettier-config": "^1.1.2", "@types/glob": "^8.1.0", "@types/mocha": "^10.0.7", diff --git a/vscode/yarn.lock b/vscode/yarn.lock index d35f41460..a21a13979 100644 --- a/vscode/yarn.lock +++ b/vscode/yarn.lock @@ -455,11 +455,31 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" +"@eslint/eslintrc@^3.1.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-3.1.0.tgz#dbd3482bfd91efa663cbe7aa1f506839868207b6" + integrity sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ== + dependencies: + ajv "^6.12.4" + debug "^4.3.2" + espree "^10.0.1" + globals "^14.0.0" + ignore "^5.2.0" + import-fresh "^3.2.1" + js-yaml "^4.1.0" + minimatch "^3.1.2" + strip-json-comments "^3.1.1" + "@eslint/js@8.57.0": version "8.57.0" resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.57.0.tgz#a5417ae8427873f1dd08b70b3574b453e67b5f7f" integrity sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g== +"@eslint/js@^9.8.0": + version "9.8.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.8.0.tgz#ae9bc14bb839713c5056f5018bcefa955556d3a4" + integrity sha512-MfluB7EUfxXtv3i/++oh89uzAr4PDI4nn201hsp+qaXqsjAWzinlZEHEfPgAX4doIlKvPG/i0A9dpKxOLII8yA== + "@humanwhocodes/config-array@^0.11.14": version "0.11.14" resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.14.tgz#d78e481a039f7566ecc9660b4ea7fe6b1fec442b" @@ -583,10 +603,10 @@ resolved "https://registry.yarnpkg.com/@pkgr/core/-/core-0.1.1.tgz#1ec17e2edbec25c8306d424ecfbf13c7de1aaa31" integrity sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA== -"@shopify/eslint-plugin@^45.0.0": - version "45.0.0" - resolved "https://registry.yarnpkg.com/@shopify/eslint-plugin/-/eslint-plugin-45.0.0.tgz#e4a87e66f89f4a09f1268378bd8caef713661744" - integrity sha512-aRgVkl+EovLk6OC4WzT+C6hgAyta5VReEIdetpe+/bJhVovlqbFjYa3yHGvEM4VuWv8sim7XH2VV3ZsDiwpgvQ== +"@shopify/eslint-plugin@^46.0.0": + version "46.0.0" + resolved "https://registry.yarnpkg.com/@shopify/eslint-plugin/-/eslint-plugin-46.0.0.tgz#1943e4d5064fd33311047358ddeb3bb41856cc71" + integrity sha512-sYUKGaBMXcTEyvMxSECb1H8YPQojgsv6FkUWDN1isLNDrTyk52VETCmRFiS9Aj/hon8W6x8IL5597FyN/SC+qg== dependencies: "@babel/eslint-parser" "^7.16.3" "@babel/eslint-plugin" "^7.14.5" @@ -608,6 +628,7 @@ eslint-plugin-react "^7.34.1" eslint-plugin-react-hooks "^4.6.2" eslint-plugin-sort-class-members "^1.20.0" + globals "^15.8.0" jsx-ast-utils "^3.2.1" pkg-dir "^5.0.0" pluralize "^8.0.0" @@ -893,6 +914,11 @@ acorn-jsx@^5.3.2: resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== +acorn@^8.12.0: + version "8.12.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.12.1.tgz#71616bdccbe25e27a54439e0046e89ca76df2248" + integrity sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg== + acorn@^8.9.0: version "8.11.3" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.3.tgz#71e0b14e13a4ec160724b38fb7b0f233b1b81d7a" @@ -2158,6 +2184,11 @@ eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4 resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800" integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== +eslint-visitor-keys@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz#e3adc021aa038a2a8e0b2f8b0ce8f66b9483b1fb" + integrity sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw== + eslint@^8.57.0: version "8.57.0" resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.57.0.tgz#c786a6fd0e0b68941aaf624596fb987089195668" @@ -2202,6 +2233,15 @@ eslint@^8.57.0: strip-ansi "^6.0.1" text-table "^0.2.0" +espree@^10.0.1: + version "10.1.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-10.1.0.tgz#8788dae611574c0f070691f522e4116c5a11fc56" + integrity sha512-M1M6CpiE6ffoigIOWYO9UDP8TMUw9kqb21tf+08IgDYjCsOvCuDt4jQcZmoYxx+w7zlKw9/N0KXfto+I8/FrXA== + dependencies: + acorn "^8.12.0" + acorn-jsx "^5.3.2" + eslint-visitor-keys "^4.0.0" + espree@^9.6.0, espree@^9.6.1: version "9.6.1" resolved "https://registry.yarnpkg.com/espree/-/espree-9.6.1.tgz#a2a17b8e434690a5432f2f8018ce71d331a48c6f" @@ -2518,6 +2558,16 @@ globals@^13.19.0: dependencies: type-fest "^0.20.2" +globals@^14.0.0: + version "14.0.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-14.0.0.tgz#898d7413c29babcf6bafe56fcadded858ada724e" + integrity sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ== + +globals@^15.8.0: + version "15.9.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-15.9.0.tgz#e9de01771091ffbc37db5714dab484f9f69ff399" + integrity sha512-SmSKyLLKFbSr6rptvP8izbyxJL4ILwqO9Jg23UA0sDlGlu58V59D1//I3vlc0KJphVdUR7vMjHIplYnzBxorQA== + globalthis@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.3.tgz#5852882a52b80dc301b0660273e1ed082f0b6ccf"