Skip to content

Commit

Permalink
fix(svg-generator): add ts-nocheck on generated files
Browse files Browse the repository at this point in the history
  • Loading branch information
shaharkazaz committed Sep 20, 2023
1 parent d4c1a4d commit 7753b03
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions svg-generator/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ import { GeneratorConfig, defaultConfig } from './config';
import { createTree, INDEX } from './tree';
import { createTypeFile } from './create-types';

function skipTsCheck(fileContent: string) {
return `// @ts-nocheck\n${fileContent}`;
}

export function generateSVGIcons(config: GeneratorConfig | null) {
if (!config) {
console.log(`Can't find a config object!`);
Expand All @@ -24,15 +28,15 @@ export function generateSVGIcons(config: GeneratorConfig | null) {
.filter(({ name }) => name !== INDEX)
.map(({ content }) => content)
.join('\n\n');
outputFileSync(join(mergedConfig.outputPath, `${mergedConfig.rootBarrelFileName}.ts`), allExports, {
outputFileSync(join(mergedConfig.outputPath, `${mergedConfig.rootBarrelFileName}.ts`), skipTsCheck(allExports), {
encoding: 'utf-8',
});

names = virtualTree.filter(({ name }) => name !== INDEX).map(({ name }) => name);
} else {
virtualTree.forEach(({ path, content, name }) => {
name !== INDEX && names.push(name);
outputFileSync(path, content, { encoding: 'utf-8' });
outputFileSync(path, skipTsCheck(content), { encoding: 'utf-8' });
});
}

Expand Down
2 changes: 1 addition & 1 deletion svg-generator/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ngneat/svg-generator",
"version": "7.0.1",
"version": "7.0.2",
"description": "svg generator",
"main": "generator.js",
"bin": {
Expand Down

0 comments on commit 7753b03

Please sign in to comment.