npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

yocto-hint

v2.1.3

Published

Manage and process code usage on yocto.re project. Valid current code with Eslint.

Downloads

24

Readme

NPM

alt text Node Required version alt text Build Status

Motivation

Code style and good programming rules are very important to create a solid and comprehensive program.

All the time we need to install many tools to hint our code source for a complete validation.

That why we created an unique and ready to use tool for a complete programming validation for source code based on javascript, node, angular .

Breaking changes

In previous version we used Jshint and Jscs. Since few time Jscs and Eslint decided to work on the same tool, so we decided to forgot Jshint for Eslint.

This tools was completely rewrite, and has no compatibility with 1.x.x version.

How to install ?

npm install yocto-hint --save-dev

General usage

In your project's Gruntfile, add a section named yoctohint to the data object passed into grunt.initConfig().

'use strict';

module.exports = function (grunt) {
  // Project configuration.
  grunt.initConfig({
    // Default package
    pkg : grunt.file.readJSON('package.json'),

    // Configuration to be run (and then tested).
    yoctohint : {
      json : [
        'package.json'
      ],
      node : [
        'Gruntfile.js',
        'tasks/yoctohint.js'
      ]
    }
  });

  // Actually load this plugin's task(s).
  grunt.loadNpmTasks('yocto-hint');

  // Load npm task
  grunt.registerTask('test', [ 'yoctohint' ]);
  grunt.registerTask('default', [ 'test' ]);
};

// and run grunt hint in your shell

Usage for lint JSON files

For Json files you must specify the json key on your Gruntfile like below.

Usage for lint Node files

For Node files you must specify the node key on your Gruntfile like below.

Usage for lint Angular files

For Angular files you must specify the angular key on your Gruntfile like below.

ES5 vs ES6

This tools is based on eslint so we support ES6 lint features. To enable the ES6 feature you must defined in options property the env key on your Gruntfile, for example :

'use strict';

module.exports = function (grunt) {
  // Project configuration.
  grunt.initConfig({
    // Default package
    pkg : grunt.file.readJSON('package.json'),

    // Configuration to be run (and then tested).
    yoctohint : {
      json : [
        'package.json'
      ],
      node : [
        'Gruntfile.js',
        'tasks/yoctohint.js'
      ],
      options : {
        env : {
          es6 : true // this will be enable es6 for all your node files
        }
      }
    }
  });

  // Actually load this plugin's task(s).
  grunt.loadNpmTasks('yocto-hint');

  // Load npm task
  grunt.registerTask('test', [ 'yoctohint' ]);
  grunt.registerTask('default', [ 'test' ]);
};

How to use --fix options of linter

Some errors can be automatically fix by the linter, go do this just go :

grunt --fix

Compatibility with older hint process

In some case we need use compatibility ruls from our older tool. To use this compatibility and not check old rules with grunt like below :

'use strict';

module.exports = function (grunt) {
  // Project configuration.
  grunt.initConfig({
    // Default package
    pkg : grunt.file.readJSON('package.json'),

    // Configuration to be run (and then tested).
    yoctohint : {
      json : [
        'package.json'
      ],
      node : [
        'Gruntfile.js',
        'tasks/yoctohint.js'
      ],
      options : {
        compatibility : true // to enable compatibility rules enabled
      }
    }
  });

  // Actually load this plugin's task(s).
  grunt.loadNpmTasks('yocto-hint');

  // Load npm task
  grunt.registerTask('test', [ 'yoctohint' ]);
  grunt.registerTask('default', [ 'test' ]);
};