• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

AlbertoElias/gulp-lintspaces: Gulp plugin for node-lintspaces. Fork of removed g ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

AlbertoElias/gulp-lintspaces

开源软件地址(OpenSource Url):

https://github.com/AlbertoElias/gulp-lintspaces

开源编程语言(OpenSource Language):

JavaScript 95.7%

开源软件介绍(OpenSource Introduction):

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)




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
buddyspike/gulp-jspm-build: Gulp plugin for jspm.发布时间:2022-06-21
下一篇:
crecotun/gulp-sprite-generation: Gulp sprite generation demo发布时间:2022-06-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap