Skip to content

Commit

Permalink
feat: add support for $schema field (#210)
Browse files Browse the repository at this point in the history
  • Loading branch information
foray1010 authored Nov 20, 2020
1 parent 04c1f73 commit 78f1110
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ const sortScripts = onObject((scripts) => {
// field.key{string}: field name
// field.over{function}: sort field subKey
const fields = [
{ key: '$schema' },
{ key: 'name' },
/* vscode */ { key: 'displayName' },
{ key: 'version' },
Expand Down
1 change: 1 addition & 0 deletions tests/fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const gitHooks = require('git-hooks-list')

// fields sort keep as it is
for (const field of [
'$schema',
'name',
'displayName',
'version',
Expand Down
Binary file modified tests/snapshots/cli.js.snap
Binary file not shown.
2 changes: 2 additions & 0 deletions tests/snapshots/main.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Generated by [AVA](https://avajs.dev).
{
input: `{␊
"$schema": "$schema",␊
"activationEvents": "activationEvents",␊
"assets": "assets",␊
"author": "author",␊
Expand Down Expand Up @@ -104,6 +105,7 @@ Generated by [AVA](https://avajs.dev).
}`,
options: undefined,
output: `{␊
"$schema": "$schema",␊
"name": "name",␊
"displayName": "displayName",␊
"version": "version",␊
Expand Down
Binary file modified tests/snapshots/main.js.snap
Binary file not shown.

0 comments on commit 78f1110

Please sign in to comment.