Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add .node-version and .nvmrc support #341

Merged
merged 5 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
JounQin marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"prettier-plugin-sh": minor
---

feat: add `.nvmrc` support
JoshuaKGoldberg marked this conversation as resolved.
Show resolved Hide resolved
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
8 changes: 8 additions & 0 deletions scripts/languages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ const EXTRA_SH_LANGUAGES: SupportLanguage[] = [
filenames: ['.env.*'],
vscodeLanguageIds: ['dotenv'],
},
{
name: 'nvmrc',
since: '0.14.0',
parsers: ['sh'],
extensions: ['.nvmrc'],
filenames: ['.nvmrc'],
JoshuaKGoldberg marked this conversation as resolved.
Show resolved Hide resolved
vscodeLanguageIds: ['ignore'],
JoshuaKGoldberg marked this conversation as resolved.
Show resolved Hide resolved
},
]

const getSupportLanguages = (
Expand Down
Loading