All Projects → theenadayalank → lint-prepush

theenadayalank / lint-prepush

Licence: MIT License
Lint committed files on pre-push 🔬

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to lint-prepush

Husky.Net
Git hooks made easy with Husky.Net internal task runner! 🐶 It brings the dev-dependency concept to the .NET world!
Stars: ✭ 394 (+2088.89%)
Mutual labels:  lint, linter, husky
elint
A easy way to lint your code
Stars: ✭ 38 (+111.11%)
Mutual labels:  lint, linter, husky
openapi-lint-vscode
OpenAPI 2.0/3.0.x intellisense, validator, linter, converter and resolver extension for Visual Studio Code
Stars: ✭ 47 (+161.11%)
Mutual labels:  lint, linter
rubocop-linter-action
Rubocop Linter Action: A GitHub Action to run Rubocop against your code!
Stars: ✭ 86 (+377.78%)
Mutual labels:  lint, linter
dockerfile-utils
A library and command line interface for formatting and linting Dockerfiles.
Stars: ✭ 17 (-5.56%)
Mutual labels:  lint, linter
mllint
`mllint` is a command-line utility to evaluate the technical quality of Python Machine Learning (ML) projects by means of static analysis of the project's repository.
Stars: ✭ 67 (+272.22%)
Mutual labels:  lint, linter
li18nt
🌎 Lint your i18n translation files. Detect conflicting properties, duplicates and make it more readable and easier to maintain by formatting it!
Stars: ✭ 29 (+61.11%)
Mutual labels:  lint, linter
arduino-lint
Tool to check for problems with Arduino projects
Stars: ✭ 63 (+250%)
Mutual labels:  lint, linter
lint-html-with-css
Lint HTML with CSS. A collection of CSS snippets from the hashtag #lintHTMLwithCSS on twitter. These CSS snippets intend to warn developers about common mistakes made in HTML.
Stars: ✭ 35 (+94.44%)
Mutual labels:  lint, linter
folderslint
📁 Directory structure linter for JavaScript projects
Stars: ✭ 131 (+627.78%)
Mutual labels:  lint, linter
breakcheck
Backwards compatibility linter for Go.
Stars: ✭ 66 (+266.67%)
Mutual labels:  lint, linter
relint
General purpose RegEx based file linter.
Stars: ✭ 33 (+83.33%)
Mutual labels:  lint, linter
eslint-plugin-roku
ESLint plugin to parse and lint BrightScript files
Stars: ✭ 44 (+144.44%)
Mutual labels:  lint, linter
therapist
Work out your commitment issues.
Stars: ✭ 29 (+61.11%)
Mutual labels:  lint, linter
makefiles
No description or website provided.
Stars: ✭ 23 (+27.78%)
Mutual labels:  lint, linter
npm-groovy-lint
Lint, format and auto-fix your Groovy / Jenkinsfile / Gradle files using command line
Stars: ✭ 124 (+588.89%)
Mutual labels:  lint, linter
litho-lint-rules
Lint rules for Litho by Facebook http://fblitho.com/
Stars: ✭ 14 (-22.22%)
Mutual labels:  lint, linter
extra pedantic
Stricter Dart analyzer linter settings and best practices.
Stars: ✭ 28 (+55.56%)
Mutual labels:  lint, linter
actionlint
Static checker for GitHub Actions workflow files
Stars: ✭ 1,385 (+7594.44%)
Mutual labels:  lint, linter
lints
Lint all your JavaScript, CSS, HTML, Markdown and Dockerfiles with a single command
Stars: ✭ 14 (-22.22%)
Mutual labels:  lint, linter

lint-prepush

npm version npm downloads GitHub license Build Status

Run linters on committed files of a GIT Branch🔬

Getting Started 🔮

This package will run linters on your project for the committed files in your branch.

Prerequisites🔭

  • This package requires Node.js >=10.
  • A package to manage git hooks.

Installing

npm

npm install --save-dev husky lint-prepush

using yarn:

yarn add --dev husky lint-prepush

Usage

Configure the following scripts in package.json to lint your committed files 🔧. You can also follow any of the cosmiconfig methods to configure lint-prepush.

  • Here Husky is used for managing git hooks.
{
+ "husky": {
+   "hooks": {
+     "pre-push": "lint-prepush"
+   }
+ },
+ "lint-prepush": {
+   "base": "master",
+    "tasks": {
+      "*.js": [
+        "eslint"
+      ]
+    }
+  }
}

The above scrips will lint the js files while pushing to git. It will terminate the process if there are any errors, otherwise, the changes will be pushed.

Without Errors

WithoutErrors

With Errors

With Erros

Concurrent Tasks

Tasks for a file group will by default run in linear order (eg. "*.js": [ "jest", "eslint"] will run jest first, then after it's done run eslint). If you'd like to run tasks for a file group concurrently instead (eg. jest and eslint in parallel), use the concurrent property like so:

{
+ "lint-prepush": {
+    "tasks": {
+      "*.js": {
+        concurrent: [ "jest", "eslint" ]
+      }
+    }
+  }
}

Verbose

By default when the tasks succeed, there is no output printed to the console. Sometimes you might need to show linter rules configured for warn which should be displayed even if the tasks succeed. In order to achieve this, you can pass the config verbose: true so that the task output is printed to the console when the tasks succeed.

"lint-prepush": {
  "verbose": true,
  "tasks": {
    ...
  }
}

Built With

Contributing

  • If you have any ideas, just open an issue and tell us what you think.
  • Pull requests are warmly welcome, If you would like to contribute to this project.

Versioning

This package use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

See also the list of contributors who participated in this project.

Acknowledgments

License

MIT @ Theena Dayalan

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].