Skip to content

Commit

Permalink
chore: autofix
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Mar 20, 2024
1 parent fa254da commit 282cc33
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/__mocks__/path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const join = (...segments: string[]): string => {
return trimmed.join('/');
};

const normalize = (path: string) => path.replace(/\\/g, '/');
const normalize = (path: string) => path.replaceAll('\\', '/');

const isAbsolute = (path: string) => path.startsWith('/root');

Expand Down
2 changes: 1 addition & 1 deletion src/generators/asset-types/__tests__/eot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jest.mock('ttf2eot', () =>
);

const mockOptions = (eotOptions = { __mock: 'options__' } as any) =>
({} as unknown as FontGeneratorOptions);
({}) as unknown as FontGeneratorOptions;

const ttf = '::ttf::' as unknown as Buffer;

Expand Down
2 changes: 1 addition & 1 deletion src/generators/asset-types/__tests__/json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const mockOptions = (jsonOptions: any = {}) =>
({
codepoints: mockCodepoints,
formatOptions: { [OtherAssetType.JSON]: jsonOptions }
} as any);
}) as any;

const renderAndParse = async (jsonOptions?: any) =>
JSON.parse(
Expand Down
4 changes: 2 additions & 2 deletions src/generators/asset-types/__tests__/svg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jest.mock('fs', () => ({

jest.mock('svgicons2svgfont', () => {
class MockStream {
public events = new EventEmitter();
public events = new EventEmitter(); // eslint-disable-line unicorn/prefer-event-target
public content = '';

public write(chunk: any) {
Expand Down Expand Up @@ -56,7 +56,7 @@ const mockOptions = (svgOptions = { __mock: 'options__' } as any) =>
foo: { id: 'foo', absolutePath: '/root/foo.svg' },
bar: { id: 'bar', absolutePath: '/root/bar.svg' }
}
} as unknown as FontGeneratorOptions);
}) as unknown as FontGeneratorOptions;

describe('`SVG` font generator', () => {
beforeEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/generators/asset-types/__tests__/ts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const mockOptions = {
} as any;

const cleanWhiteSpace = (subject: string): string =>
subject.replace(/\n+/, '').replace(/\s+/g, ' ');
subject.replace(/\n+/, '').replaceAll(/\s+/g, ' ');

const getCleanGen = async (options = {}) =>
cleanWhiteSpace(
Expand Down
2 changes: 1 addition & 1 deletion src/generators/asset-types/__tests__/ttf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jest.mock('svg2ttf', () =>
const mockOptions = (ttfOptions = { __mock: 'options__' } as any) =>
({
formatOptions: { [FontAssetType.TTF]: ttfOptions }
} as unknown as FontGeneratorOptions);
}) as unknown as FontGeneratorOptions;

const svg = '::svg::';

Expand Down
2 changes: 1 addition & 1 deletion src/generators/asset-types/__tests__/woff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jest.mock('ttf2woff', () =>
const mockOptions = (woffOptions = { __mock: 'options__' } as any) =>
({
formatOptions: { [FontAssetType.WOFF]: woffOptions }
} as unknown as FontGeneratorOptions);
}) as unknown as FontGeneratorOptions;

const ttf = '::ttf::' as unknown as Buffer;

Expand Down
2 changes: 1 addition & 1 deletion src/generators/asset-types/__tests__/woff2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jest.mock('ttf2woff2', () =>
);

const mockOptions = (woffOptions = { __mock: 'options__' } as any) =>
({} as unknown as FontGeneratorOptions);
({}) as unknown as FontGeneratorOptions;

const ttf = '::ttf::' as unknown as Buffer;

Expand Down
2 changes: 1 addition & 1 deletion src/utils/icon-id.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { GetIconIdFn } from '../types/misc';
import { removeExtension } from './path';

export const getIconId: GetIconIdFn = ({ relativeFilePath }) =>
slug(removeExtension(relativeFilePath).replace(/([./\\])+/g, '-'), {
slug(removeExtension(relativeFilePath).replaceAll(/([./\\])+/g, '-'), {
replacement: '-',
remove: /['"`]/g
});

0 comments on commit 282cc33

Please sign in to comment.