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

Update index.js to remove flowtype eslint rules #720

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ajbogh
Copy link
Contributor

@ajbogh ajbogh commented Jan 25, 2020

Flowtype rules shouldn't be included in the Fusion eslint rules because Fusion can be run on systems that don't include flowtype, such as Typescript. Requiring these rules would force projects to install eslint-plugin-flowtype even though they don't need it to run Fusion. Those projects would then have to include the following to disable flowtype linting errors:

rules: {
    "flowtype/require-valid-file-annotation": 0,
    "flowtype/no-types-missing-file-annotation": 0,

A recommendation is to split flowtype and typescript rules into their own packages, such as eslint-config-fusion-flowtype and eslint-config-fusion-typescript. The users of Fusion can choose which package to install, or the scaffolding tool can select the appropriate package depending on the type of project (if that choice becomes available in the future).

Flowtype rules shouldn't be included in the Fusion eslint rules because Fusion can be run on systems that don't include flowtype, such as Typescript. Requiring these rules would force projects to install eslint-plugin-flowtype even though they don't need it to run Fusion. Those projects would then have to include the following to disable flowtype linting errors:

```
rules: {
    "flowtype/require-valid-file-annotation": 0,
    "flowtype/no-types-missing-file-annotation": 0,
```

A recommendation is to split flowtype and typescript rules into their own packages, such as eslint-config-fusion-flowtype and eslint-config-fusion-typescript. The users of Fusion can choose which package to install, or the scaffolding tool can select the appropriate package depending on the type of project (if that choice becomes available in the future).
@chrisgervang
Copy link

This proposal makes sense and follows fusions style of splitting components into smaller libraries.

@ajbogh ajbogh changed the title Update index.js Update index.js to remove flowtype eslint rules Jan 27, 2020
@AlexMSmithCA
Copy link
Member

AlexMSmithCA commented Jan 27, 2020

👍 This approach sounds reasonable to me.

In order to support folks using the Flow rules today, we would also need to (1) publish the Flow-specific ruleset, and (2) include a codemod to add a dependency on the Flow-specific package in create-uber-web (internal link).

Copy link
Member

@chrisdothtml chrisdothtml left a comment

Choose a reason for hiding this comment

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

@ajbogh I would recommend remaking this PR in the private fusion monorepo to include all the changes @AlexMSmithCA mentioned. Feel free to ping me if you need any help

@ajbogh
Copy link
Contributor Author

ajbogh commented Jan 28, 2020

@chrisdothtml I'll be glad to attempt the requested codemod for the create-uber-web project. I'll add an additional public PR for the new packages so that this work can be tracked in the public repo and conversations can be available to everyone.

eslint-plugin-flowtype should be installed as a separate package. It is left in devDeps to allow this project to still use flowtype, but it's removed from peerDeps so that peers are not required to use flowtype.
@ajbogh
Copy link
Contributor Author

ajbogh commented Jan 28, 2020

This should not be merged until #723 is approved and merged first AND a codemod is available for internal projects.

It's recommended that eslint-config-fusion use a major version bump when this is merged.

UberOpenSourceBot pushed a commit that referenced this pull request Jan 29, 2020
#723

See PR #720

Added separate packages for Typescript and Flowtype eslint rules.

Co-authored-by: Chris Deacy <chrisdothtml@gmail.com>
Co-authored-by: Chris Deacy <deacy@uber.com>
@gutenye
Copy link

gutenye commented Nov 22, 2020

#723 has been merged, any updates on this one? (I'm trying to use fusionjs with typescript and get blocked by this).

@CLAassistant
Copy link

CLAassistant commented Jul 29, 2021

CLA assistant check
All committers have signed the CLA.

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

Successfully merging this pull request may close these issues.

None yet

7 participants