Skip to content

Commit

Permalink
feat: add .node-version and .nvmrc support (#341)
Browse files Browse the repository at this point in the history
Co-authored-by: JounQin <admin@1stg.me>
  • Loading branch information
JoshuaKGoldberg and JounQin committed Jan 17, 2024
1 parent 80e1909 commit 0009cf2
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/gorgeous-ladybugs-push.md
@@ -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
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
@@ -0,0 +1 @@
v1.2.3
7 changes: 7 additions & 0 deletions scripts/languages.ts
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

0 comments on commit 0009cf2

Please sign in to comment.