-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 2ddaed0
Showing
14 changed files
with
448 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
// prettier-ignore | ||
extends: [ | ||
'@commitlint/config-conventional', | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# EditorConfig is awesome: http://EditorConfig.org | ||
|
||
# top-most EditorConfig file | ||
root = true | ||
|
||
[*] | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
end_of_line = lf | ||
indent_style = space | ||
indent_size = 2 | ||
charset = utf-8 | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* text=auto | ||
*.js text eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# gitignore | ||
|
||
### macOS ### | ||
.DS_Store | ||
tmp | ||
Thumbs.db | ||
|
||
### Node ### | ||
node_modules | ||
|
||
# Logs | ||
logs | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Only apps should have lockfiles | ||
yarn.lock | ||
package-lock.json | ||
|
||
.npm | ||
.eslintcache | ||
coverage | ||
|
||
# dotenv environment variables file | ||
.env | ||
|
||
### Build ### | ||
build.log | ||
build | ||
dist | ||
|
||
### VS Code ### | ||
.vscode | ||
!.vscode/settings.json | ||
!.vscode/tasks.json | ||
!.vscode/launch.json | ||
!.vscode/extensions.json | ||
!.vscode/appc/config.json | ||
.history | ||
|
||
### intelliJ ### | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
hooks: { | ||
'pre-commit': 'lint-staged && npm run test', | ||
'commit-msg': 'npm run lint:commit', | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module.exports = { | ||
// prettier-ignore | ||
'** /*.+(js|ts|vue|json)': [ | ||
'eslint --fix', | ||
'prettier --write', | ||
'git add', | ||
], | ||
'**/*.+(css|sass|less|graphql|yml|yaml|scss)': [ | ||
'prettier --write', | ||
'git add', | ||
], | ||
// prettier-ignore | ||
'(README|readme).md': [ | ||
'prettier --write', | ||
'markdownlint', | ||
'git add', | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
{ | ||
"comment": "Be explicit by listing every available rule. https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md", | ||
"comment": "Note that there will be numeric gaps, not every MD number is implemented in markdownlint.", | ||
"comment": "MD001: Header levels should only increment by one level at a time.", | ||
"header-increment": true, | ||
"comment": "MD002: First header should be a top level header.", | ||
"first-header-h1": true, | ||
"comment": "MD003: Header style: start with hashes.", | ||
"header-style": { | ||
"style": "atx" | ||
}, | ||
"comment": "MD004: Unordered list style", | ||
"ul-style": { | ||
"style": "dash" | ||
}, | ||
"comment": "MD005: Consistent indentation for list items at the same level.", | ||
"list-indent": true, | ||
"comment": "MD006: Consider starting bulleted lists at the beginning of the line.", | ||
"ul-start-left": false, | ||
"comment": "MD007: Unordered list indentation: 2 spaces.", | ||
"ul-indent": { | ||
"indent": 2 | ||
}, | ||
"comment": "MD009: Disallow trailing spaces!", | ||
"no-trailing-spaces": { | ||
"br_spaces": 0, | ||
"comment": "Empty lines inside list items should not be indented.", | ||
"list_item_empty_lines": false | ||
}, | ||
"comment": "MD010: No hard tabs, not even in code blocks.", | ||
"no-hard-tabs": { | ||
"code_blocks": true | ||
}, | ||
"comment": "MD011: Prevent reversed link syntax", | ||
"no-reversed-links": true, | ||
"comment": "MD012: Disallow multiple consecutive blank lines.", | ||
"no-multiple-blanks": { | ||
"maximum": 1 | ||
}, | ||
"comment": "MD013: Line length", | ||
"line-length": false, | ||
"comment": "MD014: Disallow use of dollar signs($) before commands without showing output.", | ||
"commands-show-output": true, | ||
"comment": "MD018: Disallow space after hash on atx style header.", | ||
"no-missing-space-atx": true, | ||
"comment": "MD019: Disallow multiple spaces after hash on atx style header.", | ||
"no-multiple-space-atx": true, | ||
"comment": "MD020: No space should be inside hashes on closed atx style header.", | ||
"no-missing-space-closed-atx": true, | ||
"comment": "MD021: Disallow multiple spaces inside hashes on closed atx style header.", | ||
"no-multiple-space-closed-atx": true, | ||
"comment": "MD022: Headers should be surrounded by blank lines.", | ||
"comment": "Some headers have preceeding HTML anchors. Unfortunate that we have to disable this, as it otherwise catches a real problem that trips up some Markdown renderers", | ||
"blanks-around-headers": false, | ||
"comment": "MD023: Headers must start at the beginning of the line.", | ||
"header-start-left": true, | ||
"comment": "MD024: Disallow multiple headers with the same content.", | ||
"no-duplicate-header": true, | ||
"comment": "MD025: Disallow multiple top level headers in the same document.", | ||
"comment": "Gotta have a matching closing brace at the end.", | ||
"single-h1": false, | ||
"comment": "MD026: Disallow trailing punctuation in header.", | ||
"comment": "You must have a semicolon after the ending closing brace.", | ||
"no-trailing-punctuation": { | ||
"punctuation": ".,:!?" | ||
}, | ||
"comment": "MD027: Dissalow multiple spaces after blockquote symbol", | ||
"no-multiple-space-blockquote": true, | ||
"comment": "MD028: Blank line inside blockquote", | ||
"comment": "Some 'Why?' and 'Why not?' blocks are separated by a blank line", | ||
"no-blanks-blockquote": false, | ||
"comment": "MD029: Ordered list item prefix", | ||
"ol-prefix": { | ||
"style": "one" | ||
}, | ||
"comment": "MD030: Spaces after list markers", | ||
"list-marker-space": { | ||
"ul_single": 1, | ||
"ol_single": 1, | ||
"ul_multi": 1, | ||
"ol_multi": 1 | ||
}, | ||
"comment": "MD031: Fenced code blocks should be surrounded by blank lines", | ||
"blanks-around-fences": true, | ||
"comment": "MD032: Lists should be surrounded by blank lines", | ||
"comment": "Some lists have preceeding HTML anchors. Unfortunate that we have to disable this, as it otherwise catches a real problem that trips up some Markdown renderers", | ||
"blanks-around-lists": false, | ||
"comment": "MD033: Disallow inline HTML", | ||
"comment": "HTML is needed for explicit anchors", | ||
"no-inline-html": false, | ||
"comment": "MD034: No bare URLs should be used", | ||
"no-bare-urls": true, | ||
"comment": "MD035: Horizontal rule style", | ||
"hr-style": { | ||
"style": "consistent" | ||
}, | ||
"comment": "MD036: Do not use emphasis instead of a header.", | ||
"no-emphasis-as-header": false, | ||
"comment": "MD037: Disallow spaces inside emphasis markers.", | ||
"no-space-in-emphasis": true, | ||
"comment": "MD038: Disallow spaces inside code span elements.", | ||
"no-space-in-code": true, | ||
"comment": "MD039: Disallow spaces inside link text.", | ||
"no-space-in-links": true, | ||
"comment": "MD040: Fenced code blocks should have a language specified.", | ||
"fenced-code-language": true, | ||
"comment": "MD041: First line in file should be a top level header.", | ||
"first-line-h1": true, | ||
"comment": "MD042: No empty links", | ||
"no-empty-links": true, | ||
"comment": "MD043: Required header structure.", | ||
"required-headers": false, | ||
"comment": "MD044: Proper names should have the correct capitalization.", | ||
"proper-names": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
### macOS ### | ||
._* | ||
.DS_Store | ||
|
||
### CVS ### | ||
.git* | ||
|
||
### Node ### | ||
node_modules | ||
npm-debug.log | ||
yarn-error.log | ||
|
||
### Code Linting / Quality ### | ||
.eslint* | ||
.editorconfig | ||
.huskyrc.js | ||
.lintstagedrc.js | ||
.prettier* | ||
!.prettierignore | ||
.markdownlint* | ||
.commitlintrc* | ||
|
||
### VSCode ### | ||
.vscode | ||
.history |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
registry=http://registry.npmjs.org/ | ||
|
||
# Only apps should have lock files | ||
package-lock=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
### Node ### | ||
node_modules | ||
**/package.json | ||
**/package-lock.json | ||
|
||
### Builds ### | ||
dist | ||
coverage | ||
build | ||
|
||
### VSCode ### | ||
.vscode | ||
.history | ||
|
||
### Titanium Mobile ### | ||
Resources | ||
app/widgets | ||
./i18n | ||
./platform |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
MIT License | ||
|
||
Copyright (c) 2018 Konstantin Büschel <konstantin.bueschel+npm@gmail.com> | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
this software and associated documentation files (the "Software"), to deal in | ||
the Software without restriction, including without limitation the rights to | ||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | ||
the Software, and to permit persons to whom the Software is furnished to do so, | ||
subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS | ||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | ||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | ||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
# prettier-config-kbshl | ||
|
||
[](http://commitizen.github.io/cz-cli/) | ||
[](https://www.npmjs.com/package/prettier-config-kbshl) | ||
[](https://www.npmjs.com/package/prettier-config-kbshl) | ||
[](https://www.npmjs.com/package/prettier-config-kbshl) | ||
[](https://github.com/kbshl/prettier-config-kbshl/stargazers/) | ||
|
||
> [Prettier](https://prettier.io/) shareable configuration for my Javascript based projects (Web and Mobile) | ||
## Installation | ||
|
||
```shell | ||
npm install --save-dev prettier-config-kbshl | ||
``` | ||
|
||
## Usage | ||
|
||
**.prettierrc.js** | ||
|
||
```javascript | ||
module.exports = require('prettier-config-kbshl'); | ||
``` | ||
|
||
**.prettierignore** | ||
|
||
Copy and paste the following snippet: | ||
|
||
```txt | ||
### Node ### | ||
node_modules | ||
**/package.json | ||
**/package-lock.json | ||
### Builds ### | ||
dist | ||
coverage | ||
build | ||
### VSCode ### | ||
.vscode | ||
.history | ||
### Titanium Mobile ### | ||
Resources | ||
app/widgets | ||
./i18n | ||
./platform | ||
``` | ||
|
||
or do something like this: | ||
|
||
```shell | ||
cat ./node_modules/prettier-config-kbshl/.prettierignore >> .prettierignore | ||
``` | ||
|
||
**package.json** | ||
|
||
e.g. | ||
|
||
```json | ||
... | ||
"scripts": { | ||
"format": "prettier --write \"src/**/*.+(js|ts|vue|json)\"" | ||
} | ||
... | ||
``` | ||
|
||
## Recommendations | ||
|
||
I recommend to use [Prettier](https://www.prettier.io) together with [husky](https://www.npmjs.com/package/husky) and [lint-staged](https://www.npmjs.com/package/lint-staged) as a `pre-commit` git hook. | ||
|
||
### Installation | ||
|
||
```shell | ||
npm install --save-dev husky lint-staged | ||
``` | ||
|
||
### Usage | ||
|
||
**package.json** | ||
|
||
e.g. | ||
|
||
```json | ||
... | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "lint-staged" | ||
} | ||
}, | ||
"lint-staged": { | ||
"**/*.+(js|ts|vue|json|css|sass|less|graphql|yml|yaml|scss|md)": [ | ||
"prettier --write", | ||
"git add", | ||
] | ||
} | ||
... | ||
``` | ||
|
||
## License | ||
|
||
MIT © [Konstantin Büschel](https://github.com/kbshl) |
Oops, something went wrong.