Coder Social home page Coder Social logo

componentlook's Introduction

Componentlook

The writing styles of React and Vue components

We can write React components in two ways, just as function component or class component.

In the Vue project, maybe we have several api styles, such as:

  1. Vue JSX
  2. Composition API
  3. Option API
  4. Vue Class API

There may be many different coding styles in the codebase, and we want to use tools to differentiate them and do some appropriate refactoring.

Usage

npm i componentlook -g

componentlook --help

  Description
    find component types in your project

  Usage
    $ componentlook [options]

  Options
    --tsconfig       Specify a tsconfig file
    -v, --version    Displays current version
    -h, --help       Displays this message

  Examples
    $ componentlook my-entry

Example

The tsconfig is needed in the workspace root.

# you type
cd fixtures/react
componentlook src/index.tsx

# output
#React Function Component(2):
#/Users/weipingxiang/github/componentlook/fixtures/react/head.tsx
#/Users/weipingxiang/github/componentlook/fixtures/react/foot.tsx

#React Class Component(1):
#/Users/weipingxiang/github/componentlook/fixtures/react/index.tsx

License

MIT@brandonxiang

componentlook's People

Contributors

brandonxiang avatar

Stargazers

 avatar

Watchers

 avatar  avatar

componentlook's Issues

suggestion

i think it's not enough for this project that only provide a command. need to export a function to help users to use it by creating some scripts. the parameters of this function maybe include component-type and file-content.

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.