Skip to content

Commit

Permalink
Implement "lint-staged" configuration file
Browse files Browse the repository at this point in the history
The configuration file `lint-staged.config.js` (1) 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 (#16) against
   `*.{js,json,jsx,mdx,yml}` to ensure all files are formatted
   correctly. The `--list-different` flag prints the found files that
   are not conform to the Prettier configuration.
2. `eslint` - Run ESLint (#15) against `*.{js,jsx}` to ensure all
   JavaScript files are compliant to the style guide after being
   formatted with Prettier.
3. `remark --no-stdout` - Run remark-lint (#14) 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

GH-17
  • Loading branch information
arcticicestudio committed Nov 17, 2018
1 parent 32a46f1 commit 1af462b
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright (C) 2018-present Arctic Ice Studio <[email protected]>
* Copyright (C) 2018-present Sven Greb <[email protected]>
*
* Project: Nord Docs
* Repository: https://github.com/arcticicestudio/nord-docs
* License: MIT
*/

/**
* @file The lint-staged configuration.
* @author Arctic Ice Studio <[email protected]>
* @author Sven Greb <[email protected]>
* @see https://github.com/okonet/lint-staged#configuration
*/

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

0 comments on commit 1af462b

Please sign in to comment.