1.0.3 • Published 5 years ago

gull-component v1.0.3

Weekly downloads
5
License
-
Repository
github
Last release
5 years ago

Gull New Component

Default Imports

  {
    "label": "React",
    "description": "import React from 'react';",
    "picked": true,
  },
  {
    "label": "Styled Components",
    "description": "import styled from 'styled-components';",
    "picked": true,
  },
  {
    "label": "Prop Types",
    "description": "import PropTypes from 'prop-types';",
  },
  {
    "label": "Axios",
    "description": "import axios from 'axios';",
  }

Config File

Allows you to specify additional imports on a per project basis.

The filename must be gullconfig.js and placed in the project root.

PropertyDescription
labelThe import name.
descriptionThe import syntax as needed.
pickedWhether or not the import should be preselected in the GullComponent extension dropdown.

Example config:

{
  "imports": [
    {
      "label": "Object Path",
      "description": "import objectPath from 'object-path';",
      "picked": true
    },
    {
      "label": "Styled Components",
      "description": "import styled, { css } from 'styled-components';",
      "picked": true
    },
    {
      "label": "DateFns",
      "description": "import { format } from 'date-fns';",
    }
  ]
}

Specifying an import with a label that exists as a default will override that default.

See Styled Components in the output below when selecting Styled Components from the GullComponent extension dropdown with the above config in place.

import React from 'react';
import axios from 'axios';
import styled, { css } from 'styled-components';
import { format } from 'date-fns';

const MyComponent = (props) => (

);

export default MyComponent