Skip to content

fix: correct additionalData typo #204

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

Merged
merged 1 commit into from
Feb 19, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Please note that no options are required. However, depending on your configurati

| Option | Default value | Description |
| -------------------------- | ---------------------------------- | ------------------------------------------------------------------------------ |
| `additonalData` | `undefined` | An optional string to append to the top of source files. |
| `additionalData` | `undefined` | An optional string to append to the top of source files. |
| `allowUnknownClassnames` | `false` | Disables TypeScript warnings on unknown classnames (for default imports only). |
| `classnameTransform` | `"asIs"` | See [`classnameTransform`](#classnameTransform) below. |
| `customMatcher` | `"\\.module\\.(c\|le\|sa\|sc)ss$"` | Changes the file extensions that this plugin processes. |
Expand Down
4 changes: 2 additions & 2 deletions src/helpers/__tests__/getDtsSnapshot.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,11 +331,11 @@ describe('helpers / cssSnapshots', () => {
});
});

describe('with additonalData enabled', () => {
describe('with additionalData enabled', () => {
const fileName = join(__dirname, 'fixtures', 'test.module.scss');
const css = readFileSync(fileName, 'utf8');
const options: Options = {
additonalData: '.my-data {\n color: red;\n}\n\n',
additionalData: '.my-data {\n color: red;\n}\n\n',
};

const cssExports = getCssExports({
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/getCssExports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const getCssExports = ({
compilerOptions: tsModule.CompilerOptions;
directory: string;
}): CSSExportsWithSourceMap => {
const rawCss = options.additonalData ? options.additonalData + css : css;
const rawCss = options.additionalData ? options.additionalData + css : css;

const fileType = getFileType(fileName);
const rendererOptions = options.rendererOptions ?? {};
Expand Down
2 changes: 1 addition & 1 deletion src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export interface RendererOptions {
}

export interface Options {
additonalData?: string;
additionalData?: string;
allowUnknownClassnames?: boolean;
classnameTransform?: ClassnameTransformOptions;
customMatcher?: string;
Expand Down