Skip to content

Commit 2696968

Browse files
Install and configure lint-staged
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
1 parent be3e59a commit 2696968

File tree

3 files changed

+867
-0
lines changed

3 files changed

+867
-0
lines changed

lint-staged.config.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* Copyright (C) 2017-present Arctic Ice Studio <[email protected]>
3+
* Copyright (C) 2017-present Sven Greb <[email protected]>
4+
*
5+
* Project: snowsaw
6+
* Repository: https://github.com/arcticicestudio/snowsaw
7+
* License: MIT
8+
*/
9+
10+
/**
11+
* @file The lint-staged configuration.
12+
* @author Arctic Ice Studio <[email protected]>
13+
* @author Sven Greb <[email protected]>
14+
* @see https://github.com/okonet/lint-staged#configuration
15+
*/
16+
17+
module.exports = {
18+
"*.{js,json,md,yml}": "prettier --list-different",
19+
"*.md": "remark --no-stdout"
20+
};

0 commit comments

Comments
 (0)