Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/gorgeous-ladybugs-push.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"prettier-plugin-sh": minor
---

feat: add `.node-version` and `.nvmrc` support
10 changes: 10 additions & 0 deletions packages/sh/test/__snapshots__/fixtures.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ node_modules
"
`;

exports[`parser and printer > should format all fixtures > .nvmrc 1`] = `
"v1.2.3
"
`;

exports[`parser and printer > should format all fixtures > .nvmrc 2`] = `
"v1.2.3
"
`;

exports[`parser and printer > should format all fixtures > .properties 1`] = `
"# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
Expand Down
1 change: 1 addition & 0 deletions packages/sh/test/fixtures/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v1.2.3
7 changes: 7 additions & 0 deletions scripts/languages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ const EXTRA_SH_LANGUAGES: SupportLanguage[] = [
filenames: ['.env.*'],
vscodeLanguageIds: ['dotenv'],
},
{
name: 'nvmrc',
since: '0.14.0',
parsers: ['sh'],
extensions: ['.node-version', '.nvmrc'],
filenames: ['.node-version', '.nvmrc'],
},
]

const getSupportLanguages = (
Expand Down