Skip to content

Commit 2162a03

Browse files
authored
vscode-extensions.esbenp.prettier-vscode: refactor (#407386)
2 parents f8c342a + a6049de commit 2162a03

File tree

3 files changed

+76
-32
lines changed

3 files changed

+76
-32
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
jq,
3+
lib,
4+
moreutils,
5+
vscode-utils,
6+
eslint,
7+
}:
8+
9+
vscode-utils.buildVscodeMarketplaceExtension {
10+
mktplcRef = {
11+
name = "vscode-eslint";
12+
publisher = "dbaeumer";
13+
version = "3.0.13";
14+
hash = "sha256-l5VvhQPxPaQsPhXUbFW2yGJjaqnNvijn4QkXPjf1WXo=";
15+
};
16+
17+
nativeBuildInputs = [
18+
jq
19+
moreutils
20+
];
21+
22+
buildInputs = [ eslint ];
23+
24+
postInstall = ''
25+
cd "$out/$installPrefix"
26+
jq '.contributes.configuration.properties."eslint.nodePath".default = "${eslint}/lib/node_modules"' package.json | sponge package.json
27+
'';
28+
29+
meta = {
30+
changelog = "https://marketplace.visualstudio.com/items/dbaeumer.vscode-eslint/changelog";
31+
description = "Integrates ESLint JavaScript into VS Code";
32+
downloadPage = "https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint";
33+
homepage = "https://github.com/Microsoft/vscode-eslint";
34+
license = lib.licenses.mit;
35+
maintainers = [ lib.maintainers.datafoo ];
36+
};
37+
}

pkgs/applications/editors/vscode/extensions/default.nix

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,22 +1308,7 @@ let
13081308
};
13091309
};
13101310

1311-
dbaeumer.vscode-eslint = buildVscodeMarketplaceExtension {
1312-
mktplcRef = {
1313-
name = "vscode-eslint";
1314-
publisher = "dbaeumer";
1315-
version = "3.0.13";
1316-
hash = "sha256-l5VvhQPxPaQsPhXUbFW2yGJjaqnNvijn4QkXPjf1WXo=";
1317-
};
1318-
meta = {
1319-
changelog = "https://marketplace.visualstudio.com/items/dbaeumer.vscode-eslint/changelog";
1320-
description = "Integrates ESLint JavaScript into VS Code";
1321-
downloadPage = "https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint";
1322-
homepage = "https://github.com/Microsoft/vscode-eslint";
1323-
license = lib.licenses.mit;
1324-
maintainers = [ lib.maintainers.datafoo ];
1325-
};
1326-
};
1311+
dbaeumer.vscode-eslint = callPackage ./dbaeumer.vscode-eslint { };
13271312

13281313
dendron.adjust-heading-level = callPackage ./dendron.adjust-heading-level { };
13291314

@@ -1789,22 +1774,7 @@ let
17891774
};
17901775
};
17911776

1792-
esbenp.prettier-vscode = buildVscodeMarketplaceExtension {
1793-
mktplcRef = {
1794-
name = "prettier-vscode";
1795-
publisher = "esbenp";
1796-
version = "11.0.0";
1797-
hash = "sha256-pNjkJhof19cuK0PsXJ/Q/Zb2H7eoIkfXJMLZJ4lDn7k=";
1798-
};
1799-
meta = {
1800-
changelog = "https://marketplace.visualstudio.com/items/esbenp.prettier-vscode/changelog";
1801-
description = "Code formatter using prettier";
1802-
downloadPage = "https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode";
1803-
homepage = "https://github.com/prettier/prettier-vscode";
1804-
license = lib.licenses.mit;
1805-
maintainers = [ lib.maintainers.datafoo ];
1806-
};
1807-
};
1777+
esbenp.prettier-vscode = callPackage ./esbenp.prettier-vscode { };
18081778

18091779
ethansk.restore-terminals = buildVscodeMarketplaceExtension {
18101780
mktplcRef = {
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
jq,
3+
lib,
4+
moreutils,
5+
vscode-utils,
6+
nodePackages,
7+
}:
8+
9+
vscode-utils.buildVscodeMarketplaceExtension {
10+
mktplcRef = {
11+
name = "prettier-vscode";
12+
publisher = "esbenp";
13+
version = "11.0.0";
14+
hash = "sha256-pNjkJhof19cuK0PsXJ/Q/Zb2H7eoIkfXJMLZJ4lDn7k=";
15+
};
16+
17+
nativeBuildInputs = [
18+
jq
19+
moreutils
20+
];
21+
22+
buildInputs = [ nodePackages.prettier ];
23+
24+
postInstall = ''
25+
cd "$out/$installPrefix"
26+
jq '.contributes.configuration.properties."prettier.prettierPath".default = "${nodePackages.prettier}/lib/node_modules/prettier"' package.json | sponge package.json
27+
'';
28+
29+
meta = {
30+
changelog = "https://marketplace.visualstudio.com/items/esbenp.prettier-vscode/changelog";
31+
description = "Code formatter using prettier";
32+
downloadPage = "https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode";
33+
homepage = "https://github.com/prettier/prettier-vscode";
34+
license = lib.licenses.mit;
35+
maintainers = [ lib.maintainers.datafoo ];
36+
};
37+
}

0 commit comments

Comments
 (0)