Skip to content

Commit

Permalink
fix: Adding defineConfig() to cspell-types (#5399)
Browse files Browse the repository at this point in the history
Co-authored-by: Shahab Movahhedi <45717968+movahhedi@users.noreply.github.com>
  • Loading branch information
Jason3S and movahhedi committed Mar 25, 2024
1 parent 60085cf commit 983ca42
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 0 deletions.
Expand Up @@ -229,6 +229,7 @@ exports[`Validate the cspell API > Verify API exports 1`] = `
],
"defaultFileName": "cspell.json",
"defaultSettingsFilename": "cspell.json",
"defineConfig": [Function],
"determineFinalDocumentSettings": [Function],
"extractDependencies": [Function],
"extractImportErrors": [Function],
Expand Down
1 change: 1 addition & 0 deletions packages/cspell-types/src/__snapshots__/index.test.ts.snap
Expand Up @@ -5,5 +5,6 @@ exports[`Validate that the types build > Make sure exports do not change. 1`] =
"ConfigFields",
"IssueType",
"MessageTypes",
"defineConfig",
]
`;
11 changes: 11 additions & 0 deletions packages/cspell-types/src/defineConfig.test.ts
@@ -0,0 +1,11 @@
import { describe, expect, test } from 'vitest';

import { defineConfig } from './defineConfig.js';

describe('defineConfig', () => {
test('defineConfig is a pure pass-through', () => {
const config = { name: 'test' };
Object.freeze(config);
expect(defineConfig(config)).toBe(config);
});
});
5 changes: 5 additions & 0 deletions packages/cspell-types/src/defineConfig.ts
@@ -0,0 +1,5 @@
import { CSpellSettings } from "./CSpellSettingsDef";

export function defineConfig(config: CSpellSettings) {
return config;
}
1 change: 1 addition & 0 deletions packages/cspell-types/src/index.ts
Expand Up @@ -112,3 +112,4 @@ export type { ParsedText, Parser, ParseResult, ParserName, ParserOptions } from
export type { SuggestionCostMapDef, SuggestionCostsDefs } from './suggestionCostsDef.js';
export type { MappedText } from './TextMap.js';
export type { TextDocumentOffset, TextOffset } from './TextOffset.js';
export { defineConfig } from "./defineConfig.js"

0 comments on commit 983ca42

Please sign in to comment.