Skip to content

Commit 93b015a

Browse files
authored
fix: 🚑 [HOTFIX] Fix extension activation error (#37)
1 parent e0a0963 commit 93b015a

3 files changed

Lines changed: 40 additions & 14 deletions

File tree

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"type": "git",
1616
"url": "https://github.com/idahogurl/vs-code-prettier-eslint"
1717
},
18-
"version": "5.0.0",
18+
"version": "5.0.1",
1919
"engines": {
2020
"vscode": "^1.63.0",
2121
"node": "^16.13.0"
@@ -50,7 +50,6 @@
5050
"dev": "NODE_ENV=dev node ./scripts/build.js",
5151
"watch": "NODE_ENV=dev,watch node ./scripts/build.js",
5252
"build": "NODE_ENV=prod node ./scripts/build.js",
53-
"vscode:prepublish": "yarn build",
5453
"package": "vsce package --yarn",
5554
"contributors:add": "all-contributors add",
5655
"contributors:generate": "all-contributors generate"
@@ -62,6 +61,7 @@
6261
"@types/vscode": "^1.42.0",
6362
"all-contributors-cli": "^6.16.0",
6463
"esbuild": "^0.14.38",
64+
"esbuild-plugin-text-replace": "^1.2.0",
6565
"eslint": "^8.14.0",
6666
"eslint-config-airbnb-base": "^15.0.0",
6767
"eslint-plugin-import": "^2.26.0",
@@ -76,8 +76,9 @@
7676
},
7777
"dependencies": {
7878
"core-js": "^3.9.1",
79+
"espree": "^9.3.1",
7980
"find-up": "^5.0.0",
8081
"ignore": "^5.1.8",
81-
"prettier-eslint": "^14.0.1"
82+
"prettier-eslint": "^14.0.2"
8283
}
8384
}

scripts/build.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
// eslint-disable-next-line import/no-extraneous-dependencies
1+
/* eslint-disable import/no-extraneous-dependencies */
22
const esbuild = require('esbuild');
3+
const textReplace = require('esbuild-plugin-text-replace');
34

45
const buildEnv = {
56
dev: false,
@@ -18,15 +19,20 @@ const options = {
1819
outfile: './dist/extension.js',
1920
format: 'cjs',
2021
platform: 'node',
21-
external: ['vscode', '@typescript-eslint/parser', 'vue-eslint-parser', 'espree'],
22+
external: ['vscode', '@typescript-eslint/parser', 'vue-eslint-parser'],
2223
bundle: true,
2324
sourcemap: buildEnv.dev,
2425
minify: buildEnv.prod,
2526
watch: buildEnv.watch,
27+
plugins: [
28+
textReplace({
29+
include: /rule-tester/,
30+
// TODO: Until I figure out how to resolve
31+
pattern: [['const espreePath = require.resolve("espree");', 'const espreePath = ""']],
32+
}),
33+
],
2634
};
2735

28-
esbuild
29-
.build(options)
30-
.catch((err) => {
31-
throw err;
32-
});
36+
esbuild.build(options).catch((err) => {
37+
throw err;
38+
});

yarn.lock

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -822,6 +822,11 @@ copy-descriptor@^0.1.0:
822822
resolved "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz"
823823
integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=
824824

825+
core-js@^3.4.1:
826+
version "3.22.2"
827+
resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.22.2.tgz#3ea0a245b0895fa39d1faa15fe75d91ade504a01"
828+
integrity sha512-Z5I2vzDnEIqO2YhELVMFcL1An2CIsFe9Q7byZhs8c/QxummxZlAHw33TUHbIte987LkisOgL0LwQ1P9D6VISnA==
829+
825830
core-js@^3.9.1:
826831
version "3.18.3"
827832
resolved "https://registry.npmjs.org/core-js/-/core-js-3.18.3.tgz"
@@ -1210,6 +1215,13 @@ esbuild-openbsd-64@0.14.38:
12101215
resolved "https://registry.yarnpkg.com/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.38.tgz#1ca29bb7a2bf09592dcc26afdb45108f08a2cdbd"
12111216
integrity sha512-CDswYr2PWPGEPpLDUO50mL3WO/07EMjnZDNKpmaxUPsrW+kVM3LoAqr/CE8UbzugpEiflYqJsGPLirThRB18IQ==
12121217

1218+
esbuild-plugin-text-replace@^1.2.0:
1219+
version "1.2.0"
1220+
resolved "https://registry.yarnpkg.com/esbuild-plugin-text-replace/-/esbuild-plugin-text-replace-1.2.0.tgz#43d87d88c5c1314151d8046d490aa21605fe1feb"
1221+
integrity sha512-04kdAMjxqGG+TEV/F+uGQVMFZlh65Eb11xo8b532io8FjOg5x2faoCXGicJo97BovXYARCPUhiZEECKZrFQq7Q==
1222+
dependencies:
1223+
ts-replace-all "^1.0.0"
1224+
12131225
esbuild-sunos-64@0.14.38:
12141226
version "0.14.38"
12151227
resolved "https://registry.yarnpkg.com/esbuild-sunos-64/-/esbuild-sunos-64-0.14.38.tgz#c9446f7d8ebf45093e7bb0e7045506a88540019b"
@@ -3294,10 +3306,10 @@ prelude-ls@^1.2.1:
32943306
resolved "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz"
32953307
integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==
32963308

3297-
prettier-eslint@^14.0.1:
3298-
version "14.0.1"
3299-
resolved "https://registry.yarnpkg.com/prettier-eslint/-/prettier-eslint-14.0.1.tgz#982ebc5a314bcf63d068e81ce1d00d6acc33c5ec"
3300-
integrity sha512-crsXH/dZ2uWxUZI43md0euicqGAJcojUamdMHJolotF/+BV8g2ULKpisiROGCvQXWtjNF869qFElcqnvO6fZdQ==
3309+
prettier-eslint@^14.0.2:
3310+
version "14.0.2"
3311+
resolved "https://registry.yarnpkg.com/prettier-eslint/-/prettier-eslint-14.0.2.tgz#22450cf62dfed4536100c2d31e883de4c3cc6d13"
3312+
integrity sha512-bU0fKT5xNLk/WQQkNeVApe5OU8I834MzP5AcTpGPOHfjffU3HmRXW8dsD35dUhPTl3/qkgrTPTnHF90YZIuKGw==
33013313
dependencies:
33023314
"@typescript-eslint/parser" "^5.10.0"
33033315
common-tags "^1.4.0"
@@ -4056,6 +4068,13 @@ tr46@~0.0.3:
40564068
resolved "https://registry.npmjs.org/traverse/-/traverse-0.3.9.tgz"
40574069
integrity sha1-cXuPIgzAu3tE5AUUwisui7xw2Lk=
40584070

4071+
ts-replace-all@^1.0.0:
4072+
version "1.0.0"
4073+
resolved "https://registry.yarnpkg.com/ts-replace-all/-/ts-replace-all-1.0.0.tgz#ef28283ccdb4da7d69fb03cf543e09e51711659b"
4074+
integrity sha512-6uBtdkw3jHXkPtx/e9xB/5vcngMm17CyJYsS2YZeQ+9FdRnt6Ev5g931Sg2p+dxbtMGoCm13m3ax/obicTZIkQ==
4075+
dependencies:
4076+
core-js "^3.4.1"
4077+
40594078
tsconfig-paths@^3.14.1:
40604079
version "3.14.1"
40614080
resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz#ba0734599e8ea36c862798e920bcf163277b137a"

0 commit comments

Comments
 (0)