Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Adding defineConfig() to cspell-types #5399

Merged
merged 3 commits into from Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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"