Giter VIP home page Giter VIP logo

react-typescript-toolbox's Introduction

react-typescript-toolbox

toolplusreact

version installs rating

Extension to create TypeScript React Components from Visual Studio Code explorer menu. Available in the VSCode Marketplace.

Features

Create React Components, Typescript Enums, Model Classes (or just ordinary classes), and index files by rightclicking in the context menu of the file explorer and generate it. The files are created with index export files, and the export will be appended to the root index, if it is present.

tool

Tip: Rightclick in Visual Studio Code Explorer and > Generate Component. Tip: Use the settings.json to disable test generation or changing the stylesheet type.

Root Index Sort

If this feature is activated, your root index exports will be sorted if you have a structure like this:

// Models
export a from "./a"
export d from "./c"

// Components
export b from "./b"

// Utils
export c from "./c"

The comments represent layers, the extension will not sort between Components and Models exports for example. There is a selection menu after creating a file, so you can select to which layer the new export is appended.

Requirements

This extension has no dependencies to other extensions. Maybe node.js installed ist required!

Extension Settings

Available Settings:

  • reactTypeScriptToolbox.stylesheet: ('none' | 'less' | 'css' | 'sass')
  • reactTypeScriptToolbox.test: (true | false)
  • reactTypeScriptToolbox.regexCheck: (true | false)
  • reactTypeScriptToolbox.indentation: (tabs | spaces)
  • reactTypeScriptToolbox.sortIndex: (true | false)
  • reactTypeScriptToolbox.testFolder: (same | flat | structured)
  • reactTypeScriptToolbox.removeSemicolonsFromImportsOnSave (still experimental): (true | false)
  • reactTypeScriptToolbox.quotemarksString: double | single | back-tick
  • reactTypeScriptToolbox.quotemarksImportExport: double | single
  • reactTypeScriptToolbox.semicolons: true | false

Known Issues


For more information

react-typescript-toolbox's People

Contributors

jefferymills avatar mikaoelitiana avatar svenliebig avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

react-typescript-toolbox's Issues

Typo in ComponentTest

There is a typo to the word "Enviroment" in the Component test template (src\Templates\ComponentTest\ComponentTest.ts). Can it please be updated to "Environment" please?

Implement setting to choose quotemark

The TSLint on our project is set up to allow single quotes only for strings, however the templates generate them with a double quote. Could this be implemented as a setting for the user to choose between a single and a double quote mark please?

Path issue on generating component

I generate a component on "components" directory and

  1. It creates a folder right outside components called "components\Contact"
  2. It generates 2 files right outside components folder "components\Contact\Contact.tsx" and "components\Contact\index.tsx"

Assuming it tries to use the forward slash, it won't work on Linux systems like mine. Instead it should use /path/to/component and not \path\to\component. I haven't checked out your code, I will try to fix this but I'm not 100% sure I can.

Support more components types

It would be great to create other components types like FunctionComponent or StatelesFunction

import * as React from 'react'

interface IAppProps {}

const App: React.FunctionComponent<IAppProps> = props => {
    return
}

export default App
import * as React from 'react'

export interface IAppScreenProps {}

export function AppScreen(props: IAppScreenProps) {
    return <div></div>
}

Update template to have Props and State reflect Component name

I was wondering whether you would be able to include a feature which sets the

export interface Props {
}

export interface State {
}

generated parts of the template to reflect the component name, so it is easier to avoid naming conflicts.

I would expect a component of FilterBox to have:

export interface FilterBoxProps {
}

export interface FilterBoxState {
}

This could be a setting that could be toggled to prefix component name on state and props

Thanks,

Implement getSemicolon

Could get semicolon be implemented properly so that users can choose whether the code can generate a semicolon or not

I have a PR, but I couldn't push a new branch :/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.