Skip to content

Commit

Permalink
Merge pull request #21 from arcticicestudio/feature/gh-16-prettier
Browse files Browse the repository at this point in the history
Merge pull request #21 from arcticicestudio/feature/gh-16-prettier

Integrated Prettier (1), the opinionated code formatter with support for
many languages and integrations with most editors. It ensures that all
outputted code conforms to a consistent style.

>> Configuration

This is one of the main features of Prettier: It already provides the
best and recommended style configurations of-out-the-box.
The only option we will change is the print width (2). It is set to 80
by default which not up-to-date for modern screens (might only be
relevant when working in terminals only like e.g. with Vim). It is now
set to changed to 120 used by all of Arctic Ice Studio's style guides.
The `prettier.config.js` configuration file is placed in the project
root as well as the `.prettierignore` file to also define ignore
pattern.

>> ESLint Compatibility

To be fully compatible with ESLint (implemented in #15),
eslint-plugin-prettier (3) has been included and added to the `plugins`
array of the ESLint configuration (4). To enable full compatibility the
`prettier/prettier` rule must be added with the `error` level.

>> NPM script/task

To allow to format all sources a `format:pretty` npm script/task has
been added to be included in the main `format` script flow later on.

>> Initial Formatting

Afterwards Prettier has been run on the current code base Format and
fixed found style guide violations using the configured linters.

References:

  (1) https://prettier.io
  (2) https://prettier.io/docs/en/options.html#print-width
  (3) https://github.com/prettier/eslint-plugin-prettier
  (4) https://eslint.org/docs/user-guide/configuring#configuring-plugins
  • Loading branch information
arcticicestudio authored Nov 17, 2018
2 parents d4bd783 + 9a3abd7 commit 39af1da
Show file tree
Hide file tree
Showing 9 changed files with 109 additions and 47 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const { resolve } = require("path");

module.exports = {
extends: "arcticicestudio",
plugins: ["babel"],
plugins: ["babel", "prettier"],
parser: "babel-eslint",
env: {
browser: true,
Expand All @@ -34,6 +34,7 @@ module.exports = {
}
},
rules: {
"prettier/prettier": "error",
"no-confusing-arrow": "off",
/* Suppress errors when importing development dependencies */
"import/no-extraneous-dependencies": ["error", { devDependencies: ["./.gatsby/**/*.js"] }],
Expand Down
27 changes: 13 additions & 14 deletions .github/ISSUE_TEMPLATE/bugs.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: Bug Report
about: Report a bug that is caused by the code in this repository

---

<!-- Click on the "Preview" tab to render the instructions in a more readable format -->
Expand All @@ -14,9 +13,9 @@ This section and the instructions in the sections below are only part of this is

Please do your best to provide as much information as possible and use a clear and descriptive title for your bug report to help maintainers and the community understand and reproduce the behavior, find related reports and to resolve the ticket faster.

* **Ensure the bug has not already been reported by using the [GitHub Issues search](https://github.com/arcticicestudio/nord-docs/issues)** — check if this enhancement has already been suggested. If it has **and the issue is still open**, add your additions as comment to the existing issue instead of opening a new one. If you find a closed issue that seems to be similar to this one, include a link to the original issue in the [metadata head](#metadata-head) section of this issue.
* **Ensure your contribution belongs to the correct [main or port project repository](https://github.com/arcticicestudio?&tab=repositories&q=nord).**
* **Ensure the bug is reproducible and has not already been fixed** — use the [latest version](https://github.com/arcticicestudio/nord-docs/releases/latest) and [`develop`](https://github.com/arcticicestudio/nord-docs/tree/develop) branch.
- **Ensure the bug has not already been reported by using the [GitHub Issues search](https://github.com/arcticicestudio/nord-docs/issues)** — check if this enhancement has already been suggested. If it has **and the issue is still open**, add your additions as comment to the existing issue instead of opening a new one. If you find a closed issue that seems to be similar to this one, include a link to the original issue in the [metadata head](#metadata-head) section of this issue.
- **Ensure your contribution belongs to the correct [main or port project repository](https://github.com/arcticicestudio?&tab=repositories&q=nord).**
- **Ensure the bug is reproducible and has not already been fixed** — use the [latest version](https://github.com/arcticicestudio/nord-docs/releases/latest) and [`develop`](https://github.com/arcticicestudio/nord-docs/tree/develop) branch.

## Metadata Head

Expand All @@ -30,9 +29,9 @@ Describe the bug as in many relevant details as possible with a clear and concis

### Steps to Reproduce

1. Step One
2. Step Two
3. ...
1. Step One
2. Step Two
3. ...

### Expected Behavior

Expand All @@ -52,13 +51,13 @@ The recommended way is to upload it as [Gist](https://gist.github.com) or new re

## Environment and Versions

* What is the version of Nord or the port project you are running?
* What is the name and the version of your OS?
* Have you tried to reproduce it on different OS environments and if yes is the behavior the same for all?
* If the problem is related to the runtime of the project (e.g. [Node.js](https://nodejs.org), [Go](https://golang.org) or [Java](https://java.com)) please provide the version you're running.
* Are you using any additional CLI arguments to run the project?
* What is the version of the build tool (e.g. [npm](https://www.npmjs.com), [dep](https://golang.github.io/dep) or [Gradle](https://gradle.org)) you are running?
* Are you using any additional CLI arguments to start the build tool task/script other than defined by the project?
- What is the version of Nord or the port project you are running?
- What is the name and the version of your OS?
- Have you tried to reproduce it on different OS environments and if yes is the behavior the same for all?
- If the problem is related to the runtime of the project (e.g. [Node.js](https://nodejs.org), [Go](https://golang.org) or [Java](https://java.com)) please provide the version you're running.
- Are you using any additional CLI arguments to run the project?
- What is the version of the build tool (e.g. [npm](https://www.npmjs.com), [dep](https://golang.github.io/dep) or [Gradle](https://gradle.org)) you are running?
- Are you using any additional CLI arguments to start the build tool task/script other than defined by the project?

If you've installed [Node.js](https://nodejs.org) on your system you can run [envinfo](https://www.npmjs.com/package/envinfo) via [npx](https://blog.npmjs.org/post/162869356040/introducing-npx-an-npm-package-runner) which will print environment information that help the the community to better reproduce the bug.

Expand Down
7 changes: 3 additions & 4 deletions .github/ISSUE_TEMPLATE/enhancement.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: Enhancement Suggestions
about: Submit an enhancement suggestion for new features or minor improvements to existing functionality

---

<!-- Click on the "Preview" tab to render the instructions in a more readable format -->
Expand All @@ -14,9 +13,9 @@ This section and the instructions in the sections below are only part of this is

Please do your best to provide as much information as possible and use a clear and descriptive title for your enhancement suggestion to help maintainers and the community understand and reproduce the behavior, find related reports and to resolve the ticket faster.

* **Ensure the enhancement has not already been reported by using the [GitHub Issues search](https://github.com/arcticicestudio/nord-docs/issues)** — check if this enhancement has already been suggested. If it has **and the issue is still open**, add your additions as comment to the existing issue instead of opening a new one. If you find a closed issue that seems to be similar to this one, include a link to the original issue in the [metadata head](#metadata-head) section of this issue.
* **Ensure your contribution belongs to the correct [main or port project repository](https://github.com/arcticicestudio?&tab=repositories&q=nord).**
* **Check if the enhancement has already been implemented** — use the [latest version](https://github.com/arcticicestudio/nord-docs/releases/latest) and [`develop`](https://github.com/arcticicestudio/nord-docs/tree/develop) branch to ensure that the feature or improvement has not already been added.
- **Ensure the enhancement has not already been reported by using the [GitHub Issues search](https://github.com/arcticicestudio/nord-docs/issues)** — check if this enhancement has already been suggested. If it has **and the issue is still open**, add your additions as comment to the existing issue instead of opening a new one. If you find a closed issue that seems to be similar to this one, include a link to the original issue in the [metadata head](#metadata-head) section of this issue.
- **Ensure your contribution belongs to the correct [main or port project repository](https://github.com/arcticicestudio?&tab=repositories&q=nord).**
- **Check if the enhancement has already been implemented** — use the [latest version](https://github.com/arcticicestudio/nord-docs/releases/latest) and [`develop`](https://github.com/arcticicestudio/nord-docs/tree/develop) branch to ensure that the feature or improvement has not already been added.

## Metadata Head

Expand Down
12 changes: 6 additions & 6 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ This section and the instructions in the sections below are only part of this pu

Please do your best to provide as much information as possible and use a clear and descriptive title for your enhancement suggestion or bug fix to help maintainers and the community understand and reproduce the behavior, find related pull requests and to merge it faster.

* **Ensure the pull request has not already been submitted by using the [GitHub Issue search](https://github.com/arcticicestudio/nord-docs/issues)** — check if this enhancement or bug fix has already been suggested. If it has **and the pull request is still open**, add your additions as comment or [suggest a change](https://help.github.com/articles/incorporating-feedback-in-your-pull-request/#applying-a-suggested-change) to the existing pull request instead of opening a new one. If you find a closed pull request that seems to be similar to this one, include a link to the original pull request in the [metadata head](#metadata-head) section of this new pull request.
* **Ensure your contribution belongs to the correct [main or port project repository](https://github.com/arcticicestudio?&tab=repositories&q=nord).**
* **Ensure to adhere to the [pull request contribution guidelines](https://github.com/arcticicestudio/nord-docs/blob/develop/CONTRIBUTING.md#pull-requests)**, especially the one for tests and documentations.
* **Check if the enhancement has already been implemented or bug already fixed** — use the [latest version](https://github.com/arcticicestudio/nord-docs/releases/latest) and [`develop`](https://github.com/arcticicestudio/nord-docs/tree/develop) branch to ensure that the enhancement or bug fix has not already been added.
- **Ensure the pull request has not already been submitted by using the [GitHub Issue search](https://github.com/arcticicestudio/nord-docs/issues)** — check if this enhancement or bug fix has already been suggested. If it has **and the pull request is still open**, add your additions as comment or [suggest a change](https://help.github.com/articles/incorporating-feedback-in-your-pull-request/#applying-a-suggested-change) to the existing pull request instead of opening a new one. If you find a closed pull request that seems to be similar to this one, include a link to the original pull request in the [metadata head](#metadata-head) section of this new pull request.
- **Ensure your contribution belongs to the correct [main or port project repository](https://github.com/arcticicestudio?&tab=repositories&q=nord).**
- **Ensure to adhere to the [pull request contribution guidelines](https://github.com/arcticicestudio/nord-docs/blob/develop/CONTRIBUTING.md#pull-requests)**, especially the one for tests and documentations.
- **Check if the enhancement has already been implemented or bug already fixed** — use the [latest version](https://github.com/arcticicestudio/nord-docs/releases/latest) and [`develop`](https://github.com/arcticicestudio/nord-docs/tree/develop) branch to ensure that the enhancement or bug fix has not already been added.

## Metadata Head

The metadata head should be added to the top of the pull request as [Markdown text quote](https://help.github.com/articles/basic-writing-and-formatting-syntax) containing the [GitHub issue keyword(s)](https://help.github.com/articles/closing-issues-using-keywords) to link to the related enhancements suggestions (`Closes`) or bug reports (`Fixes`). You can add additional details like dependencies to other pull requests and the order it needs to be merged.

> Closes ISSUE_ID
Must be merged **after**/**before** ISSUE_ID
> Must be merged **after**/**before** ISSUE_ID
## Description

Describe the changes as in many relevant details as possible. If this is a enhancement suggestion add specific use-cases and explain why this feature or improvement would be useful. If this is a bug fix ensure to provide a *before/after* comparison by describing the current behavior and the new behavior.
Describe the changes as in many relevant details as possible. If this is a enhancement suggestion add specific use-cases and explain why this feature or improvement would be useful. If this is a bug fix ensure to provide a _before/after_ comparison by describing the current behavior and the new behavior.

## References

Expand Down
12 changes: 12 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# 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

.cache/*
build/*
**/node_modules/*
public/*
static/*
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Contributions related to a [Nord port project][gh-profile-repo-search] belong to

### Bug Reports

A bug is a *demonstrable problem* that is caused by the code in the repository. This section guides you through submitting a bug report for Nord. Following these guidelines helps maintainers and the community understand your report, reproduce the behavior and find related reports.
A bug is a _demonstrable problem_ that is caused by the code in the repository. This section guides you through submitting a bug report for Nord. Following these guidelines helps maintainers and the community understand your report, reproduce the behavior and find related reports.

**Do NOT report security vulnerabilities in public issues!** Please only contact one of the core team members or project owner in a responsible manner by [email][gh-mailmap] or via [email protected]. We will assess the issue as soon as possible on a best-effort basis and will give you an estimate for when we have a fix and release available for an eventual public disclosure.

Expand Down Expand Up @@ -100,7 +100,7 @@ Nord uses the [gitflow][gitflow] branching model. The repository consists of two
- `master` - The source code of `HEAD` always reflects a tagged release version.
- `develop` - The default branch where the source code of `HEAD` always reflects a state with the latest development state.

**All [pull requests](#pull-requests) for the limited development lifecycle *story*/*topic* branches must be send against the `develop` branch**.
**All [pull requests](#pull-requests) for the limited development lifecycle _story_/_topic_ branches must be send against the `develop` branch**.

<!-- lint disable no-heading-punctuation -->

Expand Down Expand Up @@ -138,7 +138,7 @@ Nord adheres to the [Arctic Ice Studio Markdown Style Guide][gh-styleguide-markd

### Git Commit Messages

A well-crafted Git commit message is the best way to communicate *context* about a change to the maintainers. The code will tell what changed, but only the commit message can properly tell why. Re-establishing the context of a piece of code is wasteful. We can't avoid it completely, so our efforts should go to reducing it as much as possible.
A well-crafted Git commit message is the best way to communicate _context_ about a change to the maintainers. The code will tell what changed, but only the commit message can properly tell why. Re-establishing the context of a piece of code is wasteful. We can't avoid it completely, so our efforts should go to reducing it as much as possible.

Nord adheres to the [Arctic Ice Studio Git Style Guide][gh-styleguide-git].

Expand All @@ -156,7 +156,7 @@ When [reporting a bug](#bug-reports), sometimes even when [suggesting enhancemen
- …Complete – Provide all parts needed to reproduce the behavior
- …Verifiable – Test the code you're about to provide to make sure it reproduces the behavior

A MCVE is a common practice like on [Stack Overflow][stackoverflow-mcve] and sometimes it is also called [SSCCE][sscce], a *Short, Self Contained, Correct (Compilable), Example*.
A MCVE is a common practice like on [Stack Overflow][stackoverflow-mcve] and sometimes it is also called [SSCCE][sscce], a _Short, Self Contained, Correct (Compilable), Example_.

The recommended way for GitHub based projects is to create it as [Gist][gh-gist] or new repository, but of course you can [attach it to issues and pull requests as files][ghh-attach-file], use any free code paste- or file hosting service or paste the code in [Markdown code blocks][ghh-markdown-code-blocks] into the issue.

Expand All @@ -177,7 +177,7 @@ Make sure all resources and code necessary to reproduce the behavior is included

### Verifiable

To entirely understand your enhancement or bug report, developers will need to verify that it *exists*:
To entirely understand your enhancement or bug report, developers will need to verify that it _exists_:

- **Follow the contribution guidelines regarding the description and details**. Without information developers won't be able to understand and reproduce the behavior.
- **Eliminate any issues that aren't relevant**. Ensure that there are no compile-time errors.
Expand Down
Loading

0 comments on commit 39af1da

Please sign in to comment.