Git Product home page Git Product logo

component-hint's Introduction

Component Hint

Component Hint is a linting tool for Component.io. The main goal is to detect nuisances prior to publication and alleviate debugging time (e.g. missing paths for local dependencies).

Implemented Checks

  • Ensures a given components contains a component.json file
  • Checks each local dependency exists in exactly one of the given paths
  • Detects any unused paths in the component.json file
  • Check each external dependency exists in exactly one of the given dependency paths (--dep-paths)
  • Check dependencies are only required at a single version through the project
  • Checks that a component doesn't have itself as a dependency
  • Checks that any files listed in the component.json file (i.e. scripts, styles, etc.) actually exist

Other Features

  • In the event a local dependency isn't resolved, it will give you a hint as to where you can find it (uses the given --lookupPaths option)
  • Skips folders with the same name as a dependency if it does not contain a component.json file
  • Recurses into dependencies and checks if there are any other dependency errors (this can be switched to warning level by using --warn-on-deps option)

To Do

  • Parse scripts for usages of require() and ensure those components exist in the component.json
  • Check that the name inside the component.json file is the name used for the folder
  • Other issues

Installation

npm install component-hint
./node_modules/.bin/component-hint

OR if installed globally component-hint can be accessed like any other component command

npm install -g component-hint
component hint

Usage

  Usage: component-hint [options] <component_path ...>

  Options:

    -h, --help                  output usage information
    -V, --version               output the version number
    -v, --verbose               Be verbose during tests. (cannot be used with --quiet
                                or --silent)
    -q, --quiet                 Display only the final outcome.
    -s, --silent                Suppress all output.
    -r, --recursive             Recurse into local and external dependencies.
    -d, --dep-paths <paths>     Colon separated list of paths to external
                                dependencies. (default: "./components")
    -w, --warn-on-deps          Errors caused by external dependencies will only
                                result in a warning and not return a fail status
                                code.
    -i, --ignore-paths <paths>  Colon separated list of paths component-hint should
                                ignore. (supports minimatch globbing)
    -l, --lookup-paths <paths>  Colon separated list of paths to check for the
                                existence of missing local dependencies. This is used
                                to give the user a hint where they can find them.
        --reporter <path>       Path to reporter file to use for output formatting.

  Examples:

    Check multiple component entry points
    $ component-hint /path/to/single/component /path/to/another/component

    Check multiple component entry point which exist in the same folder
    $ component-hint /path/to/multiple/component/folder/*/

License

Component Hint is distributed under the MIT License.

component-hint's People

Contributors

almirkadric avatar

Watchers

 avatar  avatar

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.