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(react): pass linter option properly to storybook cypress setup #2903

Merged
merged 2 commits into from
Apr 29, 2020

Conversation

juristr
Copy link
Member

@juristr juristr commented Apr 23, 2020

Current Behavior (This is the behavior we have today, before the PR is merged)

When generating a new storybook configuration for a library with a Cypress setup, the Cypress setup uses tslint, rather than eslint. this leads to an issue because tslint requires the angular-devkit/build-angular package which isn't available in a React workspace (and shouldn't be).

Expected Behavior (This is the new behavior we can expect after the PR is merged)

  • the Cypress test setup uses eslint
  • a default linter option is configured for the @nrwl/react:storybook-configuration in the workspace.json

Issue

@juristr juristr force-pushed the fix-linter-for-storybook-cypress-setup branch from 7ac1aa5 to 59a10c1 Compare April 28, 2020 19:20
@juristr
Copy link
Member Author

juristr commented Apr 28, 2020

@jaysoo so there are a couple of things here. This PR fixes the currently broken behavior in that the React Cypress setup for Storybooks is generated with tslint, which has a dependency to angular.

While fixing this, I found that the linter defaults are set in a variety of places:

  • shared-new.ts - apparently sets linter options for all schematics when react is being used. Not the cleanest way, but went for it.
  • There was a problem though in the react init schematic, which had overwritten all previous @nrwl/react defaults (this PR fixes that)
  • And then again the application schematic again added some of the defaults previously set in the shared-new.

So it works now, but we may want to improve how all these defaults are being initialized.

@juristr juristr marked this pull request as ready for review April 28, 2020 19:55
@juristr juristr requested a review from jaysoo April 28, 2020 19:55
@jaysoo jaysoo merged commit c9cac2d into master Apr 29, 2020
@FrozenPandaz FrozenPandaz deleted the fix-linter-for-storybook-cypress-setup branch May 15, 2020 14:03
@github-actions
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants