-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
track and enforce whitespace and key ordering
- Loading branch information
Showing
17 changed files
with
325 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
exports[`test check-key-order:locales/en.json 1`] = ` | ||
"{ | ||
keep_one: en, | ||
asdf: { | ||
keep_two: en | ||
} | ||
}" | ||
`; | ||
|
||
exports[`test check-key-order:locales/pt-BR.json 1`] = ` | ||
"{ | ||
asdf: { | ||
keep_two: pt-BR | ||
}, | ||
keep_one: pt-BR | ||
}" | ||
`; | ||
|
||
exports[`test check-key-order:stderr.txt 1`] = ` | ||
" | ||
THROWN: | ||
Error: [i18next-json-sync] check failed -- files have unordered keys or unexpected whitespace. Run again without check mode to correct files | ||
... | ||
" | ||
`; | ||
|
||
exports[`test check-key-order:stdout.txt 1`] = `""`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { IOptions } from '../../src'; | ||
const options: IOptions = { | ||
check: true | ||
}; | ||
export = options; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"keep_one": "en", | ||
"asdf": { | ||
"keep_two": "en" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"asdf": { | ||
"keep_two": "pt-BR" | ||
}, | ||
"keep_one": "pt-BR" | ||
} |
103 changes: 103 additions & 0 deletions
103
tests/check-plurals-already-in-sync/__snapshots__/runner.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
exports[`test check-plurals-already-in-sync:locales/de.json 1`] = ` | ||
"{ | ||
add: { | ||
also_not_0_x: also not a plural, | ||
brick: brick en, | ||
brick_plural: bricks en, | ||
not_plural_x: not a plural | ||
}, | ||
keep: { | ||
other_one: other one de, | ||
other_value: other two de, | ||
value: value de, | ||
value_plural: values de | ||
}, | ||
remove: { | ||
}, | ||
replace: { | ||
book: book de, | ||
book_plural: books de, | ||
keep_one: one de, | ||
keep_two: two de | ||
} | ||
}" | ||
`; | ||
|
||
exports[`test check-plurals-already-in-sync:locales/en.json 1`] = ` | ||
"{ | ||
add: { | ||
also_not_0_x: also not a plural, | ||
brick: brick en, | ||
brick_plural: bricks en, | ||
not_plural_x: not a plural | ||
}, | ||
keep: { | ||
other_one: other one en, | ||
other_value: other two en, | ||
value: value en, | ||
value_plural: values en | ||
}, | ||
remove: { | ||
}, | ||
replace: { | ||
book: book en, | ||
book_plural: books en, | ||
keep_one: one en, | ||
keep_two: two en | ||
} | ||
}" | ||
`; | ||
|
||
exports[`test check-plurals-already-in-sync:locales/ja.json 1`] = ` | ||
"{ | ||
add: { | ||
also_not_0_x: also not a plural, | ||
brick_0: bricks en, | ||
not_plural_x: not a plural | ||
}, | ||
keep: { | ||
other_one: other one ja, | ||
other_value: other two ja, | ||
value_0: values ja | ||
}, | ||
remove: { | ||
}, | ||
replace: { | ||
book_0: books en, | ||
keep_one: one ja, | ||
keep_two: two ja | ||
} | ||
}" | ||
`; | ||
|
||
exports[`test check-plurals-already-in-sync:locales/ru.json 1`] = ` | ||
"{ | ||
add: { | ||
also_not_0_x: also not a plural, | ||
brick_0: bricks en, | ||
brick_1: bricks en, | ||
brick_2: bricks en, | ||
not_plural_x: not a plural | ||
}, | ||
keep: { | ||
other_one: other one ru, | ||
other_value: other two ru, | ||
value_0: values ru 0, | ||
value_1: values ru 1, | ||
value_2: values ru 2 | ||
}, | ||
remove: { | ||
}, | ||
replace: { | ||
book_0: books en, | ||
book_1: books en, | ||
book_2: books en, | ||
keep_one: one ru, | ||
keep_two: two ru | ||
} | ||
}" | ||
`; | ||
|
||
exports[`test check-plurals-already-in-sync:stderr.txt 1`] = `""`; | ||
|
||
exports[`test check-plurals-already-in-sync:stdout.txt 1`] = `""`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { IOptions } from '../../src'; | ||
const options: IOptions = { | ||
check: true | ||
}; | ||
export = options; |
22 changes: 22 additions & 0 deletions
22
tests/check-plurals-already-in-sync/project/locales/de.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"add": { | ||
"also_not_0_x": "also not a plural", | ||
"brick": "brick en", | ||
"brick_plural": "bricks en", | ||
"not_plural_x": "not a plural" | ||
}, | ||
"keep": { | ||
"other_one": "other one de", | ||
"other_value": "other two de", | ||
"value": "value de", | ||
"value_plural": "values de" | ||
}, | ||
"remove": { | ||
}, | ||
"replace": { | ||
"book": "book de", | ||
"book_plural": "books de", | ||
"keep_one": "one de", | ||
"keep_two": "two de" | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
tests/check-plurals-already-in-sync/project/locales/en.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"add": { | ||
"also_not_0_x": "also not a plural", | ||
"brick": "brick en", | ||
"brick_plural": "bricks en", | ||
"not_plural_x": "not a plural" | ||
}, | ||
"keep": { | ||
"other_one": "other one en", | ||
"other_value": "other two en", | ||
"value": "value en", | ||
"value_plural": "values en" | ||
}, | ||
"remove": { | ||
}, | ||
"replace": { | ||
"book": "book en", | ||
"book_plural": "books en", | ||
"keep_one": "one en", | ||
"keep_two": "two en" | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
tests/check-plurals-already-in-sync/project/locales/ja.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"add": { | ||
"also_not_0_x": "also not a plural", | ||
"brick_0": "bricks en", | ||
"not_plural_x": "not a plural" | ||
}, | ||
"keep": { | ||
"other_one": "other one ja", | ||
"other_value": "other two ja", | ||
"value_0": "values ja" | ||
}, | ||
"remove": { | ||
}, | ||
"replace": { | ||
"book_0": "books en", | ||
"keep_one": "one ja", | ||
"keep_two": "two ja" | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
tests/check-plurals-already-in-sync/project/locales/ru.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"add": { | ||
"also_not_0_x": "also not a plural", | ||
"brick_0": "bricks en", | ||
"brick_1": "bricks en", | ||
"brick_2": "bricks en", | ||
"not_plural_x": "not a plural" | ||
}, | ||
"keep": { | ||
"other_one": "other one ru", | ||
"other_value": "other two ru", | ||
"value_0": "values ru 0", | ||
"value_1": "values ru 1", | ||
"value_2": "values ru 2" | ||
}, | ||
"remove": { | ||
}, | ||
"replace": { | ||
"book_0": "books en", | ||
"book_1": "books en", | ||
"book_2": "books en", | ||
"keep_one": "one ru", | ||
"keep_two": "two ru" | ||
} | ||
} |
Oops, something went wrong.