Skip to content

Commit

Permalink
Prettier
Browse files Browse the repository at this point in the history
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 has been 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.

>>> 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.

>>> First Time Code Base Run

The last task was to run Prettier for the first time on the entire
code base. This revealed multiple style guide violations that
were fixedf through Prettier and the configured linters of the project.

>>> False-Positives

To ensure incorrect examples of the style guide won't be fixed by
Prettier, the affected lines have been excluded from Prettier by
adding the `<!-- prettier-ignore -->` handle for HTML (3).
Note that this also triggers `remark-lint` when added right above
a code block (`no-missing-blank-lines`). This has been fixed by
adding the `<!--lint disable no-missing-blank-lines-->` handle (4)
as well.

References:
  (1) https://prettier.io
  (2) https://prettier.io/docs/en/options.html#print-width
  (3) https://prettier.io/docs/en/ignore.html#html
  (4) https://github.com/remarkjs/remark-lint#configuring-remark-lint

Epic: GH-8
Resolves GH-11
  • Loading branch information
arcticicestudio committed Aug 15, 2019
1 parent db2a43b commit 1025324
Show file tree
Hide file tree
Showing 50 changed files with 6,767 additions and 650 deletions.
24 changes: 12 additions & 12 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,26 @@ 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 or bug report to help maintainers and the community understand and reproduce the behavior, find related reports and to resolve the ticket faster.

* **Ensure the issue has not already been reported by using the [GitHub Issues search](https://github.com/arcticicestudio/styleguide-javascript/issues)** — if it has **and the issue is still open**, add a comment to the existing issue instead of opening this 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 the issue is reproducible** — try to use the [latest version](https://github.com/arcticicestudio/styleguide-javascript/releases/latest) and [`develop`](https://github.com/arcticicestudio/styleguide-javascript/tree/develop) branch.
- **Ensure the issue has not already been reported by using the [GitHub Issues search](https://github.com/arcticicestudio/styleguide-javascript/issues)** — if it has **and the issue is still open**, add a comment to the existing issue instead of opening this 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 the issue is reproducible** — try to use the [latest version](https://github.com/arcticicestudio/styleguide-javascript/releases/latest) and [`develop`](https://github.com/arcticicestudio/styleguide-javascript/tree/develop) branch.

## Metadata Head

The metadata head should be added to the top of the issue as [Markdown text quote](https://help.github.com/articles/basic-writing-and-formatting-syntax) containing the [issue type](#issue-type) and if necessary the ID of other related issues.

> Issue type:
Related issues:
> Related issues:
### Issue Type

Set the *type* of this issue. It determines which information will be required in the following sections when it is an [bug report](https://github.com/arcticicestudio/styleguide-javascript/blob/develop/CONTRIBUTING.md#bug-reports) or an [enhancement suggestion](https://github.com/arcticicestudio/styleguide-javascript/blob/develop/CONTRIBUTING.md#enhancement-suggestions).
Set the _type_ of this issue. It determines which information will be required in the following sections when it is an [bug report](https://github.com/arcticicestudio/styleguide-javascript/blob/develop/CONTRIBUTING.md#bug-reports) or an [enhancement suggestion](https://github.com/arcticicestudio/styleguide-javascript/blob/develop/CONTRIBUTING.md#enhancement-suggestions).

* *feature*
* *improvement*
* *bug*
* *test*
* *task*
* *subtask*
- _feature_
- _improvement_
- _bug_
- _test_
- _task_
- _subtask_

## Description

Expand Down Expand Up @@ -61,8 +61,8 @@ Please provide the version of Styleguide JavaScript your are using and optionall

If possible please provide more context by answering these questions:

* If the problem is related to [Node.js](https://nodejs.org) please provide the Node.js version you're running.
* Are you using any additional CLI arguments for Node.js?
- If the problem is related to [Node.js](https://nodejs.org) please provide the Node.js version you're running.
- Are you using any additional CLI arguments for Node.js?

## Stack Trace and Error Messages

Expand Down
8 changes: 4 additions & 4 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ 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 reported by using the [GitHub Pull Request search](https://github.com/arcticicestudio/styleguide-javascript/pulls)** — if it has **and the pull request is still open**, add a comment to the existing pull request instead of opening this new one. If you find a closed pull request that seems to be similar to this one, include a link to it in the [metadata head](#metadata-head) section of this pull request.
* **Ensure to adhere to the [pull request contribution guidelines](https://github.com/arcticicestudio/styleguide-javascript/blob/feature/gh-12-github-open-source-community-standards/CONTRIBUTING.md#pull-requests)**, especially the one for tests and documentations.
- **Ensure the pull request has not already been reported by using the [GitHub Pull Request search](https://github.com/arcticicestudio/styleguide-javascript/pulls)** — if it has **and the pull request is still open**, add a comment to the existing pull request instead of opening this new one. If you find a closed pull request that seems to be similar to this one, include a link to it in the [metadata head](#metadata-head) section of this pull request.
- **Ensure to adhere to the [pull request contribution guidelines](https://github.com/arcticicestudio/styleguide-javascript/blob/feature/gh-12-github-open-source-community-standards/CONTRIBUTING.md#pull-requests)**, especially the one for tests and documentations.

## 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 keywords](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
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
#
# References:
# https://git-scm.com/docs/git-shortlog#_mapping_authors

Arctic Ice Studio <development@arcticicestudio.com>
Sven Greb <development@svengreb.de>
9 changes: 9 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (C) 2018-present Arctic Ice Studio <development@arcticicestudio.com>
# Copyright (C) 2018-present Sven Greb <development@svengreb.de>
#
# Project: Styleguide JavaScript
# Repository: https://github.com/arcticicestudio/styleguide-javascript
# License: MIT

build/*
**/node_modules/*
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@

<p align="center"><a href="https://github.com/arcticicestudio/styleguide-javascriptscript/blob/develop/LICENSE.md"><img src="https://img.shields.io/badge/License-MIT-5E81AC.svg?style=flat-square"/></a></p>

[docs]: https://arcticicestudio.github.io/styleguide-javascript
[docs-rules]: https://arcticicestudio.github.io/styleguide-javascript/rules/index.html
[docs-rules-react]: https://arcticicestudio.github.io/styleguide-javascript/rules/react/index.html
[docs-rules-react-hoc]: https://arcticicestudio.github.io/styleguide-javascript/rules/react/higher_order_components.html
[docs-rules-react-ordering-methods_and_properties]: https://arcticicestudio.github.io/styleguide-javascript/rules/react/ordering.html#component-methods-and-properties
[docs-rules-react-props]: https://arcticicestudio.github.io/styleguide-javascript/rules/react/props.html
[docs-rules-react]: https://arcticicestudio.github.io/styleguide-javascript/rules/react/index.html
[docs-rules]: https://arcticicestudio.github.io/styleguide-javascript/rules/index.html
[docs]: https://arcticicestudio.github.io/styleguide-javascript
34 changes: 17 additions & 17 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,28 @@ If you are being harassed, notice that someone else is being harassed, or have a

## What we believe in and how we act

* In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. We welcome people regardless of these or other attributes.
* Our community is based on mutual respect, tolerance, and encouragement.
* We believe that a diverse community where people treat each other with respect is stronger, more vibrant and has more potential contributors and more sources for ideas. We aim for more diversity.
* We are kind, welcoming and courteous to everyone.
* We are respectful of others, their positions, their skills, their commitments and their efforts.
* We are attentive in our communications, whether in person or online, and we are tactful and respectful when approaching differing views and experiences.
* We are aware that language shapes reality. Thus, we use inclusive, gender-neutral language in the documents we provide and when we talk to people. When referring to a group of people, we aim to use gender-neutral terms like "team", "folks" or "everyone". <sup>[1][ref-gender-neutral-docs]</sup>
* We respect that people have differences of opinion and criticize constructively.
- In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. We welcome people regardless of these or other attributes.
- Our community is based on mutual respect, tolerance, and encouragement.
- We believe that a diverse community where people treat each other with respect is stronger, more vibrant and has more potential contributors and more sources for ideas. We aim for more diversity.
- We are kind, welcoming and courteous to everyone.
- We are respectful of others, their positions, their skills, their commitments and their efforts.
- We are attentive in our communications, whether in person or online, and we are tactful and respectful when approaching differing views and experiences.
- We are aware that language shapes reality. Thus, we use inclusive, gender-neutral language in the documents we provide and when we talk to people. When referring to a group of people, we aim to use gender-neutral terms like "team", "folks" or "everyone". <sup>[1][ref-gender-neutral-docs]</sup>
- We respect that people have differences of opinion and criticize constructively.

If you are being harassed, notice that someone else is being harassed, or have any other concerns, please contact us via [email][email]. Your reports will be taken seriously and not dismissed or argued with.

## Unacceptable Behavior

* Do not be mean or rude.
* Do not discriminate against anyone.
* Sexism and racism of any kind (including sexist and racist "jokes"), demeaning or insulting behaviour and harassment are seen as direct violations to this Code of Conduct. Harassment includes offensive verbal comments related to age, body size, culture, ethnicity, gender expression, gender identity, level of experience, nationality, personal ability or disability, physical appearance, physical or mental difference, race, religion, set of skills, sexual orientation, socio-economic status, and subculture. Harassment also includes sexual images in public spaces, deliberate intimidation, stalking, following, harassing photography or recording, inappropriate physical contact, and unwelcome sexual attention.
* Respect that some individuals and cultures consider the casual use of profanity offensive and off-putting.
* Derailing, tone arguments and otherwise playing on people's desires to be nice are not welcome, especially in discussions about violations to this Code of Conduct.
* Please avoid unstructured critique.
* Likewise any spamming, trolling, flaming, baiting or other attention-stealing behaviour is not welcome.
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
- Do not be mean or rude.
- Do not discriminate against anyone.
- Sexism and racism of any kind (including sexist and racist "jokes"), demeaning or insulting behaviour and harassment are seen as direct violations to this Code of Conduct. Harassment includes offensive verbal comments related to age, body size, culture, ethnicity, gender expression, gender identity, level of experience, nationality, personal ability or disability, physical appearance, physical or mental difference, race, religion, set of skills, sexual orientation, socio-economic status, and subculture. Harassment also includes sexual images in public spaces, deliberate intimidation, stalking, following, harassing photography or recording, inappropriate physical contact, and unwelcome sexual attention.
- Respect that some individuals and cultures consider the casual use of profanity offensive and off-putting.
- Derailing, tone arguments and otherwise playing on people's desires to be nice are not welcome, especially in discussions about violations to this Code of Conduct.
- Please avoid unstructured critique.
- Likewise any spamming, trolling, flaming, baiting or other attention-stealing behaviour is not welcome.
- Publishing others' private information, such as a physical or electronic address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting

## Responsibilities

Expand Down
Loading

0 comments on commit 1025324

Please sign in to comment.