Skip to content

Commit

Permalink
Install and configure lint-staged
Browse files Browse the repository at this point in the history
Installed `lint-staged` (1) to run linters against staged Git files to
prevent to add code that violates any style guide into the code base.

The `lint-staged.config.js` configuration file has been placed in
the project root and includes the commands that should be run for
matching file extensions (globs). It includes at least the three
following entries with the same order as listed here:

1. `prettier --list-different` - Run Prettier (GH-37) against
  `*.{js,json,md,yml}` to ensure all files are formatted correctly.
  The `--list-different` prints the found files that are not conform to
  the Prettier configuration.
2. `remark --no-stdout` - Run remark-lint (GH-36) against `*.md` to
  ensure all Markdown files are compliant to the style guide
   The `--no-stdout` flag suppresses the output of the parsed file
   content.

References:
  (1) https://github.com/okonet/lint-staged

Epic: GH-33
Depends on GH-36 GH-37 GH-47 GH-49
Blocks GH-45
Resolves GH-44
  • Loading branch information
arcticicestudio committed Jun 22, 2019
1 parent be3e59a commit 2696968
Show file tree
Hide file tree
Showing 3 changed files with 867 additions and 0 deletions.
20 changes: 20 additions & 0 deletions lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright (C) 2017-present Arctic Ice Studio <development@arcticicestudio.com>
* Copyright (C) 2017-present Sven Greb <development@svengreb.de>
*
* Project: snowsaw
* Repository: https://github.com/arcticicestudio/snowsaw
* License: MIT
*/

/**
* @file The lint-staged configuration.
* @author Arctic Ice Studio <development@arcticicestudio.com>
* @author Sven Greb <development@svengreb.de>
* @see https://github.com/okonet/lint-staged#configuration
*/

module.exports = {
"*.{js,json,md,yml}": "prettier --list-different",
"*.md": "remark --no-stdout"
};
Loading

0 comments on commit 2696968

Please sign in to comment.