Skip to content

Commit 149fb24

Browse files
authored
feat: markdown linting (#61)
1 parent 3070da9 commit 149fb24

13 files changed

+166
-24
lines changed

.markdownlint.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
default: true
2+
3+
# Disable line length check, as some services use a linebreak-sensitive renderer, e.g. GitHub comment and BitBucket
4+
line-length: false
5+
6+
no-trailing-punctuation:
7+
# Allow headings to end with question mark for FAQ
8+
punctuation: ".,;:!"

.vscode/extensions.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44

55
// List of extensions which should be recommended for users of this workspace.
66
"recommendations": [
7+
"davidanson.vscode-markdownlint",
8+
"dbaeumer.vscode-eslint",
79
"editorconfig.editorconfig",
8-
"esbenp.prettier-vscode",
9-
"dbaeumer.vscode-eslint"
10+
"esbenp.prettier-vscode"
1011
],
1112

1213
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.

.vscode/settings.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@
55
"**/node_modules": true
66
},
77
"editor.formatOnSave": true,
8-
"prettier.eslintIntegration": true,
8+
// Show eslint warnings and errors in typescript files
99
"eslint.validate": [
1010
"javascript",
1111
"javascriptreact",
1212
"typescript",
1313
"typescriptreact"
14-
]
14+
],
15+
// Prefer `markdownlint`
16+
"prettier.disableLanguages": ["markdown"],
17+
// Run `eslint --fix` after Prettier, follows `npm run format` flow
18+
"prettier.eslintIntegration": true
1519
}

CODE_OF_CONDUCT.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,8 @@ members of the project's leadership.
6767

6868
## Attribution
6969

70-
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71-
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72-
73-
[homepage]: https://www.contributor-covenant.org
70+
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 1.4,
71+
available at [https://www.contributor-covenant.org/version/1/4/code-of-conduct.html](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html)
7472

7573
For answers to common questions about this code of conduct, see
76-
https://www.contributor-covenant.org/faq
74+
[https://www.contributor-covenant.org/faq](https://www.contributor-covenant.org/faq).

lint-staged.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ module.exports = {
44
"package.json": ["npm run format:package", "git add"],
55
".editorconfig": ["prettier --write", "git add"],
66
LICENSE: ["prettier --write", "git add"],
7-
"**/*.{css,gql,graphql,html,json,less,md,mdx,scss,vue,yaml,yml}": [
7+
"**/*.md": ["markdownlint"],
8+
"**/*.{css,gql,graphql,html,json,less,scss,vue,yaml,yml}": [
89
"prettier --write",
910
"git add",
1011
],

package-lock.json

Lines changed: 112 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@
3232
"format:eslint": "eslint --cache --ext .js,.jsx,.ts,.tsx --fix ./ >/dev/null 2>&1 || true",
3333
"format:imports": "import-sort --write '**/*.{js,jsx,ts,tsx}'",
3434
"format:package": "prettier-package-json --write",
35-
"format:prettier": "prettier --write '**/*.{css,gql,graphql,html,js,jsx,json,less,md,mdx,scss,ts,tsx,vue,yaml,yml}' '.editorconfig' 'LICENSE'",
36-
"lint": "eslint --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./",
35+
"format:prettier": "prettier --write '**/*.{css,gql,graphql,html,js,jsx,json,less,scss,ts,tsx,vue,yaml,yml}' '.editorconfig' 'LICENSE'",
36+
"lint": "run-p lint:eslint lint:markdown",
37+
"lint:eslint": "eslint --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./",
38+
"lint:markdown": "markdownlint '**/*.md' --ignore coverage --ignore dist --ignore node_modules",
3739
"lint:watch": "onchange 'src/**/*' --initial --kill --delay 1000 -- npm run lint",
3840
"prepublish": "rimraf dist && npm run build",
3941
"start": "node dist/create-exposed-app.js",
@@ -91,6 +93,7 @@
9193
"import-sort-style-module": "5.0.0",
9294
"jest": "^24.0.0",
9395
"lint-staged": "^8.1.1",
96+
"markdownlint-cli": "^0.14.0",
9497
"nodemon": "^1.18.9",
9598
"npm-run-all": "^4.1.5",
9699
"onchange": "^5.2.0",
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
default: true
2+
3+
# Disable line length check, as some services use a linebreak-sensitive renderer, e.g. GitHub comment and BitBucket
4+
line-length: false
5+
6+
no-trailing-punctuation:
7+
# Allow headings to end with question mark for FAQ
8+
punctuation: ".,;:!"

templates/.vscode/extensions.json.template

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44

55
// List of extensions which should be recommended for users of this workspace.
66
"recommendations": [
7+
"davidanson.vscode-markdownlint",
8+
"dbaeumer.vscode-eslint",
79
"editorconfig.editorconfig",
8-
"esbenp.prettier-vscode",
9-
"dbaeumer.vscode-eslint"
10+
"esbenp.prettier-vscode"
1011
],
1112

1213
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.

templates/.vscode/settings.json.template

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@
55
"**/node_modules": true
66
},
77
"editor.formatOnSave": true,
8-
"prettier.eslintIntegration": true,
8+
// Show eslint warnings and errors in typescript files
99
"eslint.validate": [
1010
"javascript",
1111
"javascriptreact",
1212
"typescript",
1313
"typescriptreact"
14-
]
14+
],
15+
// Prefer `markdownlint`
16+
"prettier.disableLanguages": ["markdown"],
17+
// Run `eslint --fix` after Prettier, follows `npm run format` flow
18+
"prettier.eslintIntegration": true
1519
}

0 commit comments

Comments
 (0)