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

gulp-lintspaces

v1.0.1

Published

gulp plugin for lintspaces

Downloads

2,325

Readme

gulp-lintspaces

This project is not actively maintained

A thin wrapper of lintspaces

If you're looking for a gruntjs task to validate your files, take a look at this one:

Installation

This package is available on npm as: gulp-lintspaces

	npm install gulp-lintspaces

Usage

var gulp = require("gulp");
var lintspaces = require("gulp-lintspaces");

gulp.task("YOURTASK", function() {
    return gulp.src("**/*.js")
        .pipe(lintspaces(/* options */))
        .pipe(lintspaces.reporter());
});

Options

newline at end of file option

Tests for newlines at the end of all files. Default value is false.

	newline: true

maximum newlines option

Test for the maximum amount of newlines between code blocks. Default value is false. To enable this validation a number larger than 0 is expected.

	newlineMaximum: 2

trailingspaces option

Tests for useless whitespaces (trailing whitespaces) at each lineending of all files. Default value is false.

	trailingspaces: true

indentation options

Tests for correct indentation using tabs or spaces. Default value is false. To enable indentation check use the value 'tabs' or 'spaces'.

	indentation: 'tabs'

If the indentation option is set to 'spaces', there is also the possibility to set the amount of spaces per indentation using the spaces option. Default value is 4.

	indentation: 'spaces',
	spaces: 2

ignores option

Use the ignores option when special lines such as comments should be ignored. Provide an array of regular expressions to the ignores property.

	ignores: [
		/\/\*[\s\S]*?\*\//g,
		/foo bar/g
	]

There are some build in ignores for comments which you can apply by using these strings:

  • 'js-comments'
  • 'c-comments'
  • 'java-comments'
  • 'as-comments'
  • 'xml-comments'
  • 'html-comments'
  • 'python-comments'
  • 'ruby-comments'
  • 'applescript-comments'

(build in strings and userdefined regular expressions are mixable in the ignores array)

	ignores: [
		'js-comments',
		/foo bar/g
	]

Feel free to contribute some new regular expressions as build in!

.editorconfig option

It's possible to overwrite the default and given options by setting up a path to an external editorconfig file by unsing the editorconfigoption. For a basic configuration of a .editorconfig file check out the EditorConfig Documentation.

	editorconfig: '.editorconfig'

The following .editorconfig values are supported:

  • insert_final_newline will check if a newline is set
  • indent_style will check the indentation
  • indent_size will check the amount of spaces
  • trim_trailing_whitespace will check for useless whitespaces

Contribution

Feel free to contribute. Please run all the tests and validation tasks befor you offer a pull request.

Tests & validation

Run make test to run the tests and validation tasks.

License

This is a fork of the original gulp-lintspaces by @ck86 which was deleted from Github and npm.

LICENSE (MIT)