Skip to content

Commit 0009cf2

Browse files
feat: add .node-version and .nvmrc support (#341)
Co-authored-by: JounQin <[email protected]>
1 parent 80e1909 commit 0009cf2

File tree

4 files changed

+23
-0
lines changed

4 files changed

+23
-0
lines changed

.changeset/gorgeous-ladybugs-push.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"prettier-plugin-sh": minor
3+
---
4+
5+
feat: add `.node-version` and `.nvmrc` support

packages/sh/test/__snapshots__/fixtures.spec.ts.snap

+10
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@ node_modules
2222
"
2323
`;
2424

25+
exports[`parser and printer > should format all fixtures > .nvmrc 1`] = `
26+
"v1.2.3
27+
"
28+
`;
29+
30+
exports[`parser and printer > should format all fixtures > .nvmrc 2`] = `
31+
"v1.2.3
32+
"
33+
`;
34+
2535
exports[`parser and printer > should format all fixtures > .properties 1`] = `
2636
"# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2737
# yarn lockfile v1

packages/sh/test/fixtures/.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v1.2.3

scripts/languages.ts

+7
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ const EXTRA_SH_LANGUAGES: SupportLanguage[] = [
2727
filenames: ['.env.*'],
2828
vscodeLanguageIds: ['dotenv'],
2929
},
30+
{
31+
name: 'nvmrc',
32+
since: '0.14.0',
33+
parsers: ['sh'],
34+
extensions: ['.node-version', '.nvmrc'],
35+
filenames: ['.node-version', '.nvmrc'],
36+
},
3037
]
3138

3239
const getSupportLanguages = (

0 commit comments

Comments
 (0)