Skip to content

Commit

Permalink
fix: Upgrade to commend-json 4.2.2 (#2399)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason3S committed Feb 4, 2022
1 parent a1ccfe0 commit e5f643e
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 21 deletions.
18 changes: 9 additions & 9 deletions packages/cspell-lib/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/cspell-lib/package.json
Expand Up @@ -51,7 +51,7 @@
"@cspell/cspell-bundled-dicts": "^5.18.2",
"@cspell/cspell-types": "^5.18.2",
"clear-module": "^4.1.2",
"comment-json": "^4.1.1",
"comment-json": "^4.2.2",
"configstore": "^5.0.1",
"cosmiconfig": "^7.0.1",
"cspell-glob": "^5.18.2",
Expand Down
8 changes: 7 additions & 1 deletion packages/cspell-lib/src/util/resolveFile.test.ts
Expand Up @@ -13,7 +13,7 @@ interface Config {
const defaultConfigFile = require.resolve('@cspell/cspell-bundled-dicts/cspell-default.json');
const defaultConfigLocation = path.dirname(defaultConfigFile);

const config: Config = parse(fs.readFileSync(defaultConfigFile, 'utf-8'));
const config = readConfig(defaultConfigFile);

const ext = path.extname(__filename);
const notFound = '1fgh0dld6y56cr1wls.r9bp0ckc00ds0gna.json';
Expand Down Expand Up @@ -59,3 +59,9 @@ describe('Validate resolveFile', () => {
expect(r.found).toBe(found);
});
});

function readConfig(filename: string): Config {
const parsed = parse(fs.readFileSync(filename, 'utf-8'));
if (!parsed || typeof parsed !== 'object') throw new Error(`Unable to parse "${filename}"`);
return parsed as unknown as Config;
}
18 changes: 9 additions & 9 deletions packages/cspell/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/cspell/package.json
Expand Up @@ -73,7 +73,7 @@
"@cspell/cspell-pipe": "^5.18.2",
"chalk": "^4.1.2",
"commander": "^9.0.0",
"comment-json": "^4.1.1",
"comment-json": "^4.2.2",
"cspell-gitignore": "^5.18.2",
"cspell-glob": "^5.18.2",
"cspell-lib": "^5.18.2",
Expand Down

0 comments on commit e5f643e

Please sign in to comment.