Git Product home page Git Product logo

vscode-react-typescript's People

Contributors

alex3165 avatar cantsdmr avatar davej avatar happyname0617 avatar infeng avatar linonetwo avatar milannankov avatar mlienau avatar nosajio avatar ntower avatar paulirwin avatar rlarave avatar tauka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

vscode-react-typescript's Issues

Importing react and usage of interface

Hi, this is more a question rather than an issue. I was curious about why it was decided to go for
import * as React from 'react'; Instead of import React from 'react'.

The other question is about the usage of interfaces rather than types. I know this is kind of "controvertial" but why it was decided to include one over the other.

Thanks in advance, the snippets are awesome.

default exported version

Currently, it's exported.

But if one file only contains one function, it should be default exported.

Double quotes

Please implement a setting where you can choose between double or single quotes.

When use tsrpfc create function, I will be overwrited

It creates

import * as React from 'react';

export interface IAppProps {
}

export function IApp (props: IAppProps) {
    return (
      <div>
        
      </div>
    );
}

But all IApp are selected, while I in the interface should not be selected.

Supporting documentation/sample demonstrating application structure

This is a really promising tool. Thank you for your work on this. Not so much an issue but a request.

I have found that the image provided in the readme file does not quite give me enough context to build an app using these snippets. It would be really useful if there was a codepen or JSFiddle I could reference to understand how an app using these snippets hangs together.

Many thanks

tsrrc→ tscntr

"tsrrc" command in the documentation shall be corrected to "tscntr"

typescript

Issue Type: Bug

fails

Extension version: 1.3.1
VS Code version: Code 1.51.1 (e5a624b788d92b8d34d1392e4c4d9789406efe8f, 2020-11-11T01:11:34.018Z)
OS version: Darwin x64 20.1.0

System Info
Item Value
CPUs Intel(R) Core(TM) i7-8700B CPU @ 3.20GHz (12 x 3200)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
webgl: enabled
webgl2: enabled
Load (avg) 5, 5, 5
Memory (System) 64.00GB (18.16GB free)
Process Argv --crash-reporter-id 216c0c75-6d64-4284-9807-08dd00785e6d
Screen Reader no
VM 0%

Interface names should not necessarily start with I

I've used this extension for a couple of weeks but today I got tired of removing I-s from Interface names, so I read up on all guidelines and practices I found and it seems most agree with me.

I know this was changed as a response to #11 but I'd like to point out that that problem was caused by a setting in someones tslint file, probably one like this: https://palantir.github.io/tslint/rules/interface-name/

The official Typescript documemtation clearly avoids prefixing interface names with I as seen here: https://www.typescriptlang.org/docs/handbook/interfaces.html, which is reasonable since Typescript is a typed language mostly written in IDEs where syntax hightlighting is good and it is easy to lookup definitions.

Also the guidelines for developing Typescript, while not prescriptive for projects using Typescript, also tells contributors to not prefix interface names with I: https://github.com/Microsoft/TypeScript/wiki/Coding-guidelines

Also here is a stackoverflow answer that add some detail: https://stackoverflow.com/a/41967120

For anyone who says: "but the tslint must be right", I'd like to point out that this is easily adjustable, just set "interface-name": [true, "never-prefix"] and you'll get sane behaviour from tslint from now on :-)

I'll probably just create my own snippets but I thought it was worth pointing out as a way to give something back help avoid people doing what I and many other thinks is a bad thing just because the default template suggest it.

Alternatively we can keep both, just prefix the current ones with dndt_ (for do not do this) and add a comment with a TODO: fix tslint-files to not suggest prefixing interfaces with I, see: https://stackoverflow.com/a/41967120

;-)

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.