Skip to content

Commit 0a16779

Browse files
committed
feat: add lint settings
1 parent 1ef1478 commit 0a16779

17 files changed

+381
-1
lines changed

.devcontainer/devcontainer.json

+110
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
{
2+
"dockerComposeFile": ["../docker-compose.yml", "docker-compose.yml"],
3+
"service": "qiita",
4+
"workspaceFolder": "/workspace",
5+
"extensions": [
6+
////
7+
/// Preview
8+
//
9+
10+
// Qiita Markdown Preview
11+
// https://marketplace.visualstudio.com/items?itemName=ryokat3.vscode-qiita-markdown-preview
12+
"ryokat3.vscode-qiita-markdown-preview",
13+
14+
// Markdown Emoji
15+
// https://marketplace.visualstudio.com/items?itemName=bierner.markdown-emoji
16+
"bierner.markdown-emoji",
17+
18+
// Markdown Footnotes
19+
// https://marketplace.visualstudio.com/items?itemName=bierner.markdown-footnotes
20+
"bierner.markdown-footnotes",
21+
22+
////
23+
/// Writing(Markdown, HTML)
24+
//
25+
26+
// Markdown All in One
27+
// https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one
28+
"yzhang.markdown-all-in-one",
29+
30+
// :emojisense:
31+
// https://marketplace.visualstudio.com/items?itemName=bierner.emojisense
32+
"bierner.emojisense",
33+
34+
// Insert Date String
35+
// https://marketplace.visualstudio.com/items?itemName=jsynowiec.vscode-insertdatestring
36+
"jsynowiec.vscode-insertdatestring",
37+
38+
// Copy file name
39+
// https://marketplace.visualstudio.com/items?itemName=nemesv.copy-file-name
40+
"nemesv.copy-file-name",
41+
42+
// Path Intellisense
43+
// https://marketplace.visualstudio.com/items?itemName=christian-kohler.path-intellisense
44+
"christian-kohler.path-intellisense",
45+
46+
// markdownlint
47+
// https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint
48+
"davidanson.vscode-markdownlint",
49+
50+
// vscode-textlint
51+
// https://marketplace.visualstudio.com/items?itemName=taichi.vscode-textlint
52+
"taichi.vscode-textlint",
53+
54+
// Prettier - Code formatter
55+
// https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode
56+
"esbenp.prettier-vscode",
57+
58+
// Code Spell Checker
59+
// https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker
60+
"streetsidesoftware.code-spell-checker",
61+
62+
////
63+
/// Git
64+
//
65+
66+
// GitLens — Git supercharged
67+
// https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens
68+
"eamodio.gitlens",
69+
70+
// gitignore
71+
// https://marketplace.visualstudio.com/items?itemName=codezombiech.gitignore
72+
"codezombiech.gitignore",
73+
74+
// GitHub Pull Requests and Issues
75+
// https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-pull-request-github
76+
"github.vscode-pull-request-github",
77+
78+
// Git Graph
79+
// https://marketplace.visualstudio.com/items?itemName=mhutchie.git-graph
80+
"mhutchie.git-graph",
81+
82+
////
83+
/// Docker
84+
//
85+
86+
// Docker
87+
// https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker
88+
"ms-azuretools.vscode-docker",
89+
90+
// Dev Containers
91+
// https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers
92+
"ms-vscode-remote.remote-containers",
93+
94+
////
95+
/// Other
96+
//
97+
98+
// Output Colorizer
99+
// https://marketplace.visualstudio.com/items?itemName=IBM.output-colorizer
100+
"ibm.output-colorizer",
101+
102+
// Todo Tree
103+
// https://marketplace.visualstudio.com/items?itemName=Gruntfuggly.todo-tree
104+
"gruntfuggly.todo-tree",
105+
106+
// Japanese Language Pack for Visual Studio Code
107+
// https://marketplace.visualstudio.com/items?itemName=MS-CEINTL.vscode-language-pack-ja
108+
"ms-ceintl.vscode-language-pack-ja"
109+
]
110+
}

.devcontainer/docker-compose.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
version: "3.9"
2+
3+
services:
4+
qiita:
5+
command: /bin/sh -c "while sleep 1000; do :; done"

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
.DS_Store

.lintstagedrc.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
"*.{md}": ["yarn lint:markdown", "yarn lint:text"],
3+
"*": ["yarn lint:prettier", "yarn lint:cspell"],
4+
};

.markdownlint-cli2.jsonc

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"config": {
3+
"line-length": {
4+
// MD013: Adjust the maximum number of characters per sentence
5+
"line_length": 120
6+
},
7+
"no-duplicate-heading": false, // MD024: Allow duplicate heading text
8+
"no-trailing-punctuation": false, // MD026: Allow headings with . ,;:
9+
"no-inline-html": false, // MD033: Allow HTML description
10+
"no-bare-urls": false // MD034: Allow URLs to be written as is
11+
},
12+
"ignores": ["node_modules"]
13+
}

.prettierignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules
2+
.cspell.json
3+
*.log*
4+
*.md

.textlintrc

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{
2+
"plugins": {
3+
"@textlint/markdown": {
4+
"extensions": [
5+
".md"
6+
]
7+
}
8+
},
9+
"filters": {
10+
"comments": true
11+
},
12+
"rules": {
13+
"prh": {
14+
"rulePaths": [
15+
"./prh/index.yml"
16+
]
17+
},
18+
"preset-ja-technical-writing": {
19+
"sentence-length": {
20+
"max": 150
21+
},
22+
"no-exclamation-question-mark": {
23+
"allowFullWidthExclamation": true,
24+
"allowFullWidthQuestion": true
25+
},
26+
"ja-no-successive-word": false,
27+
"ja-no-mixed-period": {
28+
"allowPeriodMarks": [
29+
":",
30+
":"
31+
]
32+
},
33+
"no-doubled-joshi": {
34+
"strict": false,
35+
"allow": [
36+
"も",
37+
"や",
38+
"か"
39+
],
40+
"separatorCharacters": [
41+
",",
42+
",",
43+
"、",
44+
".",
45+
".",
46+
"。",
47+
"?",
48+
"!",
49+
"?",
50+
"!",
51+
"「",
52+
"」",
53+
"\"",
54+
"”",
55+
"“"
56+
]
57+
}
58+
},
59+
"preset-ja-spacing": {
60+
"ja-space-around-code": {
61+
"before": true,
62+
"after": true
63+
}
64+
}
65+
}
66+
}

.vscode/keybinding.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"key": "shift+cmd+i",
3+
"command": "insertDateString.insertDateTime",
4+
"when": "editorTextFocus"
5+
}

.vscode/markdown.code-snippets

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
{
2+
"table": {
3+
"prefix": "table",
4+
"body": [
5+
"| Head | Head | Head |",
6+
"| ---- | ---- | ---- |",
7+
"| Text | Text | Text |",
8+
"| Text | Text | Text |"
9+
],
10+
"description": "Table(Markdown)"
11+
},
12+
"codeBlock": {
13+
"prefix": "code-block",
14+
"body": ["```ts:file-name.ts", "", "", "```"],
15+
"description": "Code block(Markdown)"
16+
},
17+
"codeBlockDiff": {
18+
"prefix": "code-block-diff",
19+
"body": ["```diff_ts:file-name.ts", "", "", "```"],
20+
"description": "Code block diff(Markdown)"
21+
},
22+
"checkBox": {
23+
"prefix": "check-box",
24+
"body": ["- [ ] タスク1", "- [x] タスク2"],
25+
"description": "Checkbox(Markdown)"
26+
},
27+
"blockquote": {
28+
"prefix": "blockquote",
29+
"body": ["> ", "> ", "> "],
30+
"description": "blockquote(Markdown)"
31+
},
32+
"footnote": {
33+
"prefix": "footnote",
34+
"body": ["[^1]: Footnote1"],
35+
"description": "Footnote(Markdown)"
36+
},
37+
"hr": {
38+
"prefix": "hr",
39+
"body": ["-----"],
40+
"description": "Separator line(Markdown)"
41+
},
42+
"comment": {
43+
"prefix": "comment",
44+
"body": ["<!-- Comment -->"],
45+
"description": "Inline comment(Markdown)"
46+
},
47+
"plantuml": {
48+
"prefix": "plantuml",
49+
"body": ["```plantuml", "Bob->Alice : Hello!", "```"],
50+
"description": "PlantUML(Markdown)"
51+
},
52+
"mermaid": {
53+
"prefix": "mermaid",
54+
"body": ["```mermaid", "flowchart LR", " A-->B", "```"],
55+
"description": "Mermaid(Markdown)"
56+
},
57+
"qiitaDetails": {
58+
"prefix": "qiita-details",
59+
"body": ["```<details><summary></summary>", "", "</details>"],
60+
"description": "Details(Qiita)"
61+
},
62+
"qiitaNoteInfo": {
63+
"prefix": "qiita-note-info",
64+
"body": [":::note info", "Leave a note here.", ":::"],
65+
"description": "Note info(Qiita)"
66+
},
67+
"qiitaNoteWarn": {
68+
"prefix": "qiita-note-warn",
69+
"body": [":::note warn", "Leave a note here.", ":::"],
70+
"description": "Note warn(Qiita)"
71+
},
72+
"qiitaNoteAlert": {
73+
"prefix": "qiita-note-alert",
74+
"body": [":::note alert", "Leave a note here.", ":::"],
75+
"description": "Note alert(Qiita)"
76+
},
77+
"descriptionList": {
78+
"prefix": "dl",
79+
"body": ["<dl>", " <dt>リンゴ</dt>", " <dd>赤いフルーツ</dd>", " <dt>オレンジ</dt>", " <dd>橙色のフルーツ</dd>", "</dl>"],
80+
"description": "Description List(Qiita)"
81+
},
82+
83+
}

.vscode/settings.json

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,23 @@
11
{
2+
// Markdown word wrap & suggestions
3+
"[markdown]": {
4+
"editor.wordWrap": "on",
5+
"editor.quickSuggestions": {
6+
"other": true,
7+
"comments": true,
8+
"strings": true
9+
},
10+
"editor.snippetSuggestions": "top"
11+
},
12+
13+
// Qiita theme
214
"workbench.colorCustomizations": {
3-
// Qiita theme
415
"editor.background": "#fff",
516
"statusBar.background": "#56C501",
617
"sideBar.background": "#F5F6F6"
718
},
19+
20+
// Markdownlint
821
"markdownlint.config": {
922
"line-length": {
1023
// MD013: Adjust the maximum number of characters per sentence

articles/.keep

Whitespace-only changes.

docker-compose.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
version: "3.9"
2+
3+
services:
4+
qiita:
5+
container_name: qiita
6+
build:
7+
context: .
8+
dockerfile: docker/Dockerfile
9+
volumes:
10+
- .:/workspace:delegated
11+
- node_modules:/workspace/node_modules
12+
ports:
13+
- 8000:8000
14+
restart: always
15+
16+
volumes:
17+
node_modules:

docker/Dockerfile

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM node:lts-slim
2+
3+
WORKDIR /workspace
4+
5+
ADD package.json ./package.json
6+
ADD yarn.lock ./yarn.lock
7+
8+
RUN apt-get update && apt-get install -y git yarn && yarn
9+
10+
EXPOSE 8000

images/.keep

Whitespace-only changes.

package.json

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "qiita-content-boilerplate",
3+
"version": "1.0.0",
4+
"private": true,
5+
"description": "Qiita content boilerplate",
6+
"repository": "https://github.com/waicode/qiita-content-boilerplate.git",
7+
"author": "waicode",
8+
"scripts": {
9+
"lint:markdown": "markdownlint-cli2 \"**/*.md\"",
10+
"lint:text": "textlint \"**/*.md\"",
11+
"lint:prettier": "prettier --ignore-path .prettierignore --check .",
12+
"lint:cspell": "cspell \"**\" .",
13+
"prepare": "husky install"
14+
},
15+
"devDependencies": {
16+
"cspell": "^6.12.0",
17+
"husky": "^8.0.1",
18+
"lint-staged": "^13.0.3",
19+
"markdownlint-cli2": "^0.5.1",
20+
"prettier": "^2.7.1",
21+
"textlint": "^12.2.2",
22+
"textlint-filter-rule-comments": "^1.2.2",
23+
"textlint-rule-preset-ja-spacing": "^2.2.0",
24+
"textlint-rule-preset-ja-technical-writing": "^7.0.0",
25+
"textlint-rule-prh": "^5.3.0"
26+
},
27+
"license": "MIT"
28+
}

prh/index.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
imports:
2+
- ./rules/tech.yml

0 commit comments

Comments
 (0)