mirror of
https://codeberg.org/forgejo/docs.git
synced 2024-11-20 17:26:56 -05:00
add linting for docs markdown content
This commit is contained in:
parent
8b922f661d
commit
4e059dc7f9
11 changed files with 2034 additions and 7 deletions
|
@ -10,6 +10,9 @@ indent_size = 2
|
|||
indent_style = tab
|
||||
insert_final_newline = true
|
||||
|
||||
[*.json]
|
||||
indent_style = space
|
||||
|
||||
[*.md]
|
||||
indent_style = space
|
||||
trim_trailing_whitespace = false
|
||||
|
|
|
@ -10,6 +10,12 @@ jobs:
|
|||
image: node:20
|
||||
steps:
|
||||
- uses: https://code.forgejo.org/actions/checkout@v3
|
||||
- name: lint
|
||||
run: |
|
||||
corepack enable
|
||||
pnpm install --frozen-lockfile
|
||||
pnpm run lint:remark
|
||||
pnpm run lint:prettier
|
||||
- name: get forgejo.org and move the docs
|
||||
run: |
|
||||
git clone --recursive --depth 1 https://codeberg.org/forgejo/website/ /tmp/website
|
||||
|
@ -20,12 +26,6 @@ jobs:
|
|||
cd /tmp/website
|
||||
corepack enable
|
||||
pnpm install --frozen-lockfile
|
||||
- name: lint:eslint
|
||||
run: |
|
||||
cd /tmp/website
|
||||
corepack enable
|
||||
pnpm run format-ci
|
||||
pnpm run lint:eslint
|
||||
- name: preview
|
||||
if: ${{ secrets.WEBSITETOKEN != '' }}
|
||||
run: |
|
||||
|
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1 +1,2 @@
|
|||
*~
|
||||
node_modules
|
||||
|
|
4
.husky/pre-commit
Executable file
4
.husky/pre-commit
Executable file
|
@ -0,0 +1,4 @@
|
|||
#!/usr/bin/env sh
|
||||
. "$(dirname -- "$0")/_/husky.sh"
|
||||
|
||||
pnpm exec lint-staged
|
2
.npmrc
Normal file
2
.npmrc
Normal file
|
@ -0,0 +1,2 @@
|
|||
# Expose `remark-cli` for `pnpm` users
|
||||
shamefully-hoist=true
|
3
.prettierignore
Normal file
3
.prettierignore
Normal file
|
@ -0,0 +1,3 @@
|
|||
node_modules
|
||||
pnpm-lock.yaml
|
||||
.pnpm-store
|
16
.prettierrc
Normal file
16
.prettierrc
Normal file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"printWidth": 120,
|
||||
"semi": true,
|
||||
"singleQuote": true,
|
||||
"tabWidth": 2,
|
||||
"trailingComma": "es5",
|
||||
"useTabs": true,
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["*.json", "*.md", "*.toml", "*.yml"],
|
||||
"options": {
|
||||
"useTabs": false
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
3
.vscode/extensions.json
vendored
Normal file
3
.vscode/extensions.json
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"recommendations": ["unifiedjs.vscode-remark", "esbenp.prettier-vscode"]
|
||||
}
|
51
package.json
Normal file
51
package.json
Normal file
|
@ -0,0 +1,51 @@
|
|||
{
|
||||
"name": "docs",
|
||||
"version": "0.0.0",
|
||||
"description": "Forgejo Documentation",
|
||||
"author": "Forgejo Contributors",
|
||||
"license": "CC-BY-SA-4.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"lint:remark": "remark . --quiet --frail",
|
||||
"lint:prettier": "prettier --check .",
|
||||
"format:remark": "remark . --quiet --frail --output",
|
||||
"format:prettier": "prettier -w --cache .",
|
||||
"prepare": "husky install"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.md": "remark --quiet --frail",
|
||||
"*": "prettier -w --cache --ignore-unknown"
|
||||
},
|
||||
"remarkConfig": {
|
||||
"plugins": [
|
||||
"remark-frontmatter",
|
||||
"remark-preset-lint-consistent",
|
||||
"remark-preset-lint-recommended",
|
||||
[
|
||||
"remark-lint-list-item-indent",
|
||||
"space"
|
||||
],
|
||||
[
|
||||
"remark-lint-heading-style",
|
||||
"atx"
|
||||
],
|
||||
[
|
||||
"remark-lint-no-undefined-references",
|
||||
false
|
||||
]
|
||||
]
|
||||
},
|
||||
"devDependencies": {
|
||||
"husky": "^8.0.3",
|
||||
"lint-staged": "^14.0.0",
|
||||
"prettier": "^3.0.2",
|
||||
"remark-cli": "^11.0.0",
|
||||
"remark-frontmatter": "^4.0.1",
|
||||
"remark-lint-heading-style": "^3.1.2",
|
||||
"remark-lint-list-item-indent": "^3.1.2",
|
||||
"remark-lint-no-undefined-references": "^4.2.1",
|
||||
"remark-preset-lint-consistent": "^5.1.2",
|
||||
"remark-preset-lint-recommended": "^6.1.3"
|
||||
}
|
||||
}
|
1944
pnpm-lock.yaml
Normal file
1944
pnpm-lock.yaml
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue