Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lint-staged #17

Closed
2 tasks done
arcticicestudio opened this issue Nov 17, 2018 · 0 comments
Closed
2 tasks done

lint-staged #17

arcticicestudio opened this issue Nov 17, 2018 · 0 comments

Comments

@arcticicestudio
Copy link
Contributor

arcticicestudio commented Nov 17, 2018

Must be resolved after #14 #15 #16
Must be resolved before #18

Integrate lint-staged to run linters against staged Git files to prevent to add code that violates any style guide into the code base.

Configuration

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

  1. prettier --list-different - Run Prettier (Prettier #16) against *.{js,json,jsx,mdx,yml} to ensure all files are formatted correctly. The --list-different prints the found files that are not conform to the Prettier configuration.
  2. eslint - Run ESLint (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 (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.

Tasks

  • Install lint-staged package.
  • Implement lint-staged.config.js configuration file.
@arcticicestudio arcticicestudio added this to the 0.1.0 milestone Nov 17, 2018
@arcticicestudio arcticicestudio self-assigned this Nov 17, 2018
@arcticicestudio arcticicestudio mentioned this issue Nov 17, 2018
2 tasks
arcticicestudio added a commit that referenced this issue Nov 17, 2018
Installed "lint-staged" to run linters against staged Git files to
prevent to add code that violates any style guide into the code base.

GH-17
arcticicestudio added a commit that referenced this issue Nov 17, 2018
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
arcticicestudio added a commit that referenced this issue Nov 17, 2018
Merge pull request #22 from arcticicestudio/task/gh-17-lint-staged

Integrated lint-staged (1) to run linters against staged Git files to
prevent to add code that violates any style guide into the code base.

>> Configuration

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
@arcticicestudio arcticicestudio removed their assignment Nov 17, 2018
arcticicestudio added a commit that referenced this issue Nov 17, 2018
The `.huskyrc.js` file is placed in the project root and includes the
commands to run for any supported Git hook (1). This commits initially
adds configs for the following hook:

- `pre-commit` - Run lint-staged (GH-17) before each commit (via
  `lint-staged` command) to ensure all staged files are compliant to
  all style guides.

References:

  (1) https://github.com/typicode/husky/blob/master/DOCS.md#supported-hooks
arcticicestudio added a commit that referenced this issue Nov 17, 2018
Integrated Husky (1), the tool that make Git hooks easy and can prevent
bad Git commits, pushes and more 🐶 _woof_!

>> Configuration

The configuration file `.huskyrc.js` has been placed in the project root
and includes the commands to run for any supported Git hook (2). It will
at least contain configs for the following hooks:

- `pre-commit` - Run lint-staged (GH-17) before each commit (via
  `lint-staged` command) to ensure all staged files are compliant to all
  style guides.

References:

  (1)https://github.com/typicode/husky
  (2) https://github.com/typicode/husky/blob/master/DOCS.md#supported-hooks
  (3) https://github.com/typicode/husky/blob/master/DOCS.md#supported-hooks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant