diff --git a/packages/kbn-i18n/package.json b/packages/kbn-i18n/package.json index 0897df5f56f9..af7485773acb 100644 --- a/packages/kbn-i18n/package.json +++ b/packages/kbn-i18n/package.json @@ -21,7 +21,6 @@ "@babel/preset-typescript": "^7.1.0", "@kbn/dev-utils": "1.0.0", "@types/intl-relativeformat": "^2.1.0", - "@types/json5": "^0.0.30", "@types/react-intl": "^2.3.11", "del": "^3.0.0", "getopts": "^2.2.3", @@ -32,7 +31,6 @@ "intl-format-cache": "^2.1.0", "intl-messageformat": "^2.2.0", "intl-relativeformat": "^2.1.0", - "json5": "^2.0.1", "prop-types": "^15.6.2", "react": "^16.3.0", "react-intl": "^2.7.0" diff --git a/packages/kbn-i18n/src/__fixtures__/test_plugin_2/translations/fr.json b/packages/kbn-i18n/src/__fixtures__/test_plugin_2/translations/fr.json index 88d3f27d9126..e6207873f600 100644 --- a/packages/kbn-i18n/src/__fixtures__/test_plugin_2/translations/fr.json +++ b/packages/kbn-i18n/src/__fixtures__/test_plugin_2/translations/fr.json @@ -1,5 +1,5 @@ { - messages: { - test: 'test' // JSON5 test + "messages": { + "test": "test" } } diff --git a/packages/kbn-i18n/src/loader.test.ts b/packages/kbn-i18n/src/loader.test.ts index 72cfeb09974a..ed9715d7bd62 100644 --- a/packages/kbn-i18n/src/loader.test.ts +++ b/packages/kbn-i18n/src/loader.test.ts @@ -166,7 +166,7 @@ describe('I18n loader', () => { }); }); - test('should return translation messages from JSON5 file', async () => { + test('should return translation messages from JSON file', async () => { i18nLoader.registerTranslationFile( join(__dirname, './__fixtures__/test_plugin_2/translations/fr.json') ); diff --git a/packages/kbn-i18n/src/loader.ts b/packages/kbn-i18n/src/loader.ts index 6efafc18ae79..2d68079735c0 100644 --- a/packages/kbn-i18n/src/loader.ts +++ b/packages/kbn-i18n/src/loader.ts @@ -18,7 +18,6 @@ */ import { readFile } from 'fs'; -import * as JSON5 from 'json5'; import * as path from 'path'; import { promisify } from 'util'; @@ -65,12 +64,12 @@ function getLocaleFromFileName(fullFileName: string) { } /** - * Loads file and parses it as JSON5 + * Loads file and parses it as JSON * @param pathToFile * @returns */ async function loadFile(pathToFile: string): Promise { - return JSON5.parse(await asyncReadFile(pathToFile, 'utf8')); + return JSON.parse(await asyncReadFile(pathToFile, 'utf8')); } /** diff --git a/yarn.lock b/yarn.lock index 8b88378b77ff..39a8d63fcb81 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1306,11 +1306,6 @@ resolved "https://registry.yarnpkg.com/@types/json-stable-stringify/-/json-stable-stringify-1.0.32.tgz#121f6917c4389db3923640b2e68de5fa64dda88e" integrity sha512-q9Q6+eUEGwQkv4Sbst3J4PNgDOvpuVuKj79Hl/qnmBMEIPzB5QoFRUtjcgcg2xNUZyYUGXBk5wYIBKHt0A+Mxw== -"@types/json5@^0.0.30": - version "0.0.30" - resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.30.tgz#44cb52f32a809734ca562e685c6473b5754a7818" - integrity sha512-sqm9g7mHlPY/43fcSNrCYfOeX9zkTTK+euO5E6+CVijSMm5tTjkVdwdqRkY3ljjIAf8679vps5jKUoJBCLsMDA== - "@types/jsonwebtoken@^7.2.7": version "7.2.8" resolved "https://registry.yarnpkg.com/@types/jsonwebtoken/-/jsonwebtoken-7.2.8.tgz#8d199dab4ddb5bba3234f8311b804d2027af2b3a" @@ -12463,13 +12458,6 @@ json5@^1.0.1: dependencies: minimist "^1.2.0" -json5@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.0.1.tgz#3d6d0d1066039eb50984e66a7840e4f4b7a2c660" - integrity sha512-t6N/86QDIRYvOL259jR5c5TbtMnekl2Ib314mGeMh37zAwjgbWHieqijPH7pWaogmJq1F2I4Sphg19U1s+ZnXQ== - dependencies: - minimist "^1.2.0" - jsonfile@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-3.0.1.tgz#a5ecc6f65f53f662c4415c7675a0331d0992ec66"