Skip to content

Instantly share code, notes, and snippets.

@istarkov
Last active April 2, 2024 20:18
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save istarkov/7c7dd0d67a6b130d155a to your computer and use it in GitHub Desktop.
Save istarkov/7c7dd0d67a6b130d155a to your computer and use it in GitHub Desktop.

How to setup atom with nuclide plugins.

You need to install next packages

  • hyperclick
  • nuclide-diagnostics-store
  • nuclide-diagnostics-ui
  • nuclide-flow

You need to add .flowconfig

For me the most useful part is this module.name_mapper='react-babel-playground' -> '../src/playground' This tells to flow about your aliases, and libraries locations (if libraries not in node_modules for example)

One of my projects contains next name_mapper module.name_mapper='^\(lib\|components\|actions\|consts\|reducers\)\/\(.*\)$' -> '<PROJECT_ROOT>/app/\1/\2'

You will get 'Goto definition' with cmd-click

goto definition

You will get autocomplete

autocomplete

You will flow error reporting

flow report

[ignore]
.*/node_modules/fbjs/.*
.*/node_modules/babel-types/.*
.*/node_modules/babel-traverse/.*
.*/node_modules/babylon/.*
.*/node_modules/babel-generator/.*
.*/node_modules/babel-core/lib/.*
.*/node_modules/babel-helper.*
[include]
[libs]
src/typedefs
[options]
suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FixMe
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(1[0-6]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*www[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(1[0-6]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*www[a-z,_]*\\)?)\\)? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
esproposal.class_instance_fields=ignore
esproposal.class_static_fields=ignore
module.name_mapper='react-babel-playground' -> '../src/playground'
munge_underscores=true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment