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: update react-scripts and cli-style at same time to use eslint 7 #475

Merged
merged 7 commits into from
Oct 30, 2020

Conversation

varl
Copy link
Contributor

@varl varl commented Oct 30, 2020

Update to newest cli-style and react-scripts to ensure that we get the improvements made in react-scripts for the changes in eslint related to resolving plugins.

Supersedes #473

@amcgee

This comment has been minimized.

@varl

This comment has been minimized.

@amcgee

This comment has been minimized.

@varl

This comment has been minimized.

@varl
Copy link
Contributor Author

varl commented Oct 30, 2020

Actually, react-scripts @ 4 might work for us:

https://github.com/facebook/create-react-app/releases/tag/v4.0.0

ESLint

We've upgraded to ESLint 7 and added many new rules including some for Jest and React Testing Library as well as the import/no-anonymous-default-export rule. We've also upgraded eslint-plugin-hooks to version 4.0.0 and removed the EXTEND_ESLINT flag as it is no longer required to customize the ESLint config.

Since ESLint changed their plugin resolution mechanisms for ESLint 6 and
after upgrading to ESLint 6 in cli-style 7, this changes fixes the
problem where `cli-app-scripts build` fails for apps that use
cli-style.

Since we manually extend the existing ESLint configuration from the
project in the shell ESLint configuration, and all dependencies are
hoisted, we can avoid leveraging ESLint's internal module resolution
which is based on CWD (project/.d2/shell).
@varl varl changed the title fix: do not automatically extend eslint configuration fix: update react-scripts and cli-style at same time to use eslint 7 Oct 30, 2020
@varl varl changed the base branch from master to next October 30, 2020 09:55
@varl varl changed the base branch from next to alpha October 30, 2020 09:58
@varl
Copy link
Contributor Author

varl commented Oct 30, 2020

@amcgee I'd like to update cli-style and react-scripts to the latest versions in app-platform, and release it on alpha to test it out fully. It does the trick locally.

@varl varl merged commit 8fd9225 into alpha Oct 30, 2020
@varl varl deleted the do-not-extend-eslint-conf branch October 30, 2020 10:58
@@ -8,27 +8,29 @@
},
"workspaces": {
"packages": [
"examples/simple-app",
Copy link
Member

Choose a reason for hiding this comment

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

Why did we decide to do this in this change? I think there were some issues I tried it previously... don't remember exactly what they were

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can revert it in alpha before we cut the proper release. The reason I went ahead with it was that I was having issues with the simple-app when I was testing out the shell changes, and this made it work.

"build": "yarn build:adapter && yarn build:example",
"build:adapter": "yarn workspace @dhis2/app-adapter build",
"build:example": "yarn workspace simple-app build",
"install:example": "yarn workspace simple-app install --force --check-files",
Copy link
Member

Choose a reason for hiding this comment

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

If we're using the workspace here I don't think the install step is necessary

dhis2-bot added a commit that referenced this pull request Oct 30, 2020
## [5.4.1-alpha.1](v5.4.0...v5.4.1-alpha.1) (2020-10-30)

### Bug Fixes

* update react-scripts and cli-style at same time to use eslint 7 ([#475](#475)) ([8fd9225](8fd9225))
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 5.4.1-alpha.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

dhis2-bot added a commit that referenced this pull request Oct 30, 2020
## [5.4.1](v5.4.0...v5.4.1) (2020-10-30)

### Bug Fixes

* update react-scripts and cli-style at same time to use eslint 7 ([#475](#475)) ([8fd9225](8fd9225))
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 5.4.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

3 participants