Code Monkey home page Code Monkey logo

lint-enforcer's Introduction

To use the lint enforcer pre-commit git hook:

Install the hook

To install the hook, run these two commands inside your repository:
curl https://raw.githubusercontent.com/vincentbello/lint-enforcer/master/pre-push -o ".git/hooks/pre-push"
chmod +x .git/hooks/pre-push

When you push to GitHub: If the JS files validate with JSHint and the Google Closure Linter, then the push will occur. If not, the hook will prevent the push and display the errors that must be fixed.

Ignore files/directories

If you want the two linters to ignore files/directories, put the file names in .jshintignore, with one file name per line. You may access the file with command open .jshintignore from inside your repository.

How the linters ignore files

- JSHint naturally ignores files in .jshintignore (one filename per line). - For GCL to ignore files, you need to add -x ignored1.js,ignored2.js ( -x followed by a list of comma-separated file names) to the gjslint -r . command. The hook gets the contents from .jshintignore, parses the file names to comma-separated values, and feeds them into the gjslint command. Therefore, the user only has to put the names of the files to ignore in .jshintignore, with one filename per line, and the hook skips them with both linters.

lint-enforcer's People

Contributors

vincentbello avatar

Stargazers

Roman avatar Tom Hirschfeld avatar

Watchers

James Cloos avatar Tom Hirschfeld 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.