Skip to content

Commit

Permalink
fix(storybook): change storybook tsconfig path in eslint file too (#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
mandarini authored Jul 13, 2023
1 parent 4bba066 commit e545db7
Showing 1 changed file with 23 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -721,17 +721,29 @@ export function renameAndMoveOldTsConfig(

const projectTsConfig = joinPathFragments(projectRoot, 'tsconfig.json');

if (!tree.exists(projectTsConfig)) {
return;
if (tree.exists(projectTsConfig)) {
updateJson(tree, projectTsConfig, (json) => {
for (let i = 0; i < json.references?.length; i++) {
if (json.references[i].path === './.storybook/tsconfig.json') {
json.references[i].path = './tsconfig.storybook.json';
break;
}
}
return json;
});
}

updateJson(tree, projectTsConfig, (json) => {
for (let i = 0; i < json.references?.length; i++) {
if (json.references[i].path === './.storybook/tsconfig.json') {
json.references[i].path = './tsconfig.storybook.json';
break;
}
}
return json;
});
const projectEsLintFile = joinPathFragments(projectRoot, '.eslintrc.json');

if (tree.exists(projectEsLintFile)) {
updateJson(tree, projectEsLintFile, (json) => {
const jsonString = JSON.stringify(json);
const newJsonString = jsonString.replace(
/\.storybook\/tsconfig\.json/g,
'tsconfig.storybook.json'
);
json = JSON.parse(newJsonString);
return json;
});
}
}

1 comment on commit e545db7

@vercel
Copy link

@vercel vercel bot commented on e545db7 Jul 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nx-dev – ./

nx-dev-nrwl.vercel.app
nx-dev-git-master-nrwl.vercel.app
nx-five.vercel.app
nx.dev

Please sign in to comment.