项目作者: hendrikniemann

项目描述 :
Autoimport unresolved identifiers using @flowtype
高级语言: JavaScript
项目地址: git://github.com/hendrikniemann/atom-autoimport.git
创建时间: 2018-02-13T10:15:28Z
项目社区:https://github.com/hendrikniemann/atom-autoimport

开源协议:MIT License

下载


Atom auto import plugin

Introduction

I love the new ES2015 module system and so do you. But writing imports at the beginning of your file is tiring. You have to jump around in your code and most of the time the import statement is very trivial. Why is there no editor plugin that writes these imports for me? Look no further, powered by flow this plugin should be able to write 98% of the imports for you!

Requirements

This plugin uses flow to find unresolved identifiers in your code and add them to the import section of your file. This project is in an early stage and does not offer a lot of configuration. Instead it assumes a standard JavaScript project setup.

Checklist

  • You will need a project structure like this
    1. project/
    2. node_modules/
    3. .bin/
    4. flow # Flow executable exists in node_modules
    5. src/ # This is where you write your JavaScript and run the import plugin on files
    6. package.json # This file contains your dependencies
    7. .flowconfig # This
    Where project is your root directory that flow will be executed in.
  • You have flow-bin@>0.66.0 installed as a devDependency or dependency and you use it to type-check your code

This repository is setup in that manner and can be used as a reference.

Installation and usage

Install the autoimport package using the settings or use the cli:

  1. apm install autoimport

To execute the autoimport:import command use CMD CTRL o on Mac or execute the command manually.