Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Issues
  • #7546
Closed
Open
Issue created Aug 16, 2019 by Administrator@rootContributor

Detect .flowconfig and automatically enable ESLint rule to enforce Flow headers

Created by: FezVrasta

Is your proposal related to a problem?

Right now I need to use customize-cra just to extend the react-app ESLint preset with the following rule:

rules: {
  'flowtype/require-valid-file-annotation': [
    'warn',
    'always',
  ],
},

which, basically, forces every file to have a // @flow (or // @noflow) comment on top of them.

Describe the solution you'd like

CRA should check for the presence of the .flowconfig file and automatically enable the Flow-related ESLint rule.

Describe alternatives you've considered

Alternatively, following the --typescript flag approach, provide a --flow flag that can be used to initialize the project with the above Flow-related rule enabled.

Additional context

I'm willing to work on a PR to introduce this if you are interested. Actually, I just prepared it since it was quick to do: https://github.com/facebook/create-react-app/pull/7547

Assignee
Assign to
Time tracking