Giter Club home page Giter Club logo

linters's Introduction

Gradle Linters Plugin

Adds support for linting code in a bunch of front end languages including Javascript, HTML, CSS and Less.

Getting Started

plugins {
  id 'com.github.rahulsom.linters' version '0.2'
}

Versions

0.1

Deprecated. Initial version.

0.1.1

Pins version numbers of npm packages. Supports Node 0.12.

0.2

Uses more recent npm packages. No support for Node 0.12.

Configuration

linters {
  jscs = true
  htmlcs = true
  jshint = true
  stylelint = true

  jsIncludes  = ['src/assets/**/*.js']
  jsExcludes  = ['src/assets/bower/**']
  htmlIncludes = ['src/assets/**/*.html']
  htmlExcludes = ['src/assets/bower/**']
  stylesIncludes = ['src/assets/**/*.less', 'src/assets/**/*.css']
  stylesExcludes = ['src/assets/bower/**']

  format = 'checkstyle' // or 'text'
}
parameter description default

jscs

run jscs (boolean)

true

html

run htmlcs (boolean)

true

jshint

run jshint (boolean)

true

stylelint

run stylelint (boolean)

true

format

output format for linters ('text' or 'checkstyle')

'text'

jsIncludes

Glob pattern to include as javascript sources

['src/assets/**/*.js']

jsExcludes

Glob pattern to exclude as javascript sources

['src/assets/bower/**']

htmlIncludes

Glob pattern to include as html sources

['src/assets/**/*.html']

htmlExcludes

Glob pattern to exclude as html sources

['src/assets/bower/**']

stylesIncludes

Glob pattern to include as styles sources

['src/assets/**/*.less', 'src/assets/**/*.css']

stylesExcludes

Glob pattern to exclude as styles sources

['src/assets/bower/**']

Usage

It adds the following tasks to your module

  • htmlcs - Runs htmlcs on all html files matched. Checks rules from .htmlcsrc

  • htmlcsFix - Fixes code with best effort on all html files matched

  • jscs - Runs jscs on all javascript files matched. Checks rules from .jscsrc

  • jscsFix - Fixes code with best effort on all javascript files matched

  • jshint - Runs jshint on all javascript files matched. Checks rules from .jshintrc

  • stylelint - Runs stylelint on all styles files matched. Checks rules from .stylelintrc

All these tasks will create a default rc file of the name if they don’t find one. You might not like the defaults though, so please tweak those and commit them to version control.

linters's People

Contributors

rahulsom avatar

Watchers

Cuong Nguyen 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.