Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: adding a md linter to the lint process #41

Merged
merged 4 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,5 @@ end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
max_line_length = 80
max_line_length = 100
trim_trailing_whitespace = true

[*.md]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep the config in the rules section so its one place

insert_final_newline = false
trim_trailing_whitespace = false
3 changes: 1 addition & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
build/
.eslintrc.js
.eslintrc.md.js
docs/test-api
./node_modules/*
*.md
*.mdx
LICENSE
34 changes: 34 additions & 0 deletions .eslintrc.md.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
module.exports = {
extends: [
"plugin:markdownlint/recommended",
],
"parser": "eslint-plugin-markdownlint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
},
},
rules: {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@m4sterbunny all the various rules to get things going. Have fixed up the bits in md/mdx as well so it now runs as part of the lint step

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joaniefromtheblock FYI Josh has setup some of the rules to get ES link going

// https://github.com/DavidAnson/markdownlint?tab=readme-ov-file
"markdownlint/md001": "off",
"markdownlint/md003": "warn",
// line length
"markdownlint/md013": ["error", {
"line_length": 100,
"code_block_line_length": 100,
"code_blocks": true,
}],
// allow headings with the same content
"markdownlint/md024": "off",
// allow multiple ## and # in the same file
"markdownlint/md025": ["error", {
"level": 3
}],
// allow inline html
"markdownlint/md033": "off",
// allowed here, not for real docs
"markdownlint/md051": "off",
}
};
22 changes: 22 additions & 0 deletions .github/workflows/spelling.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Check for spelling with vale

on:
pull_request:
branches:
- main

jobs:
vale:
name: Spelling
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4

- name: Vale
uses: ConsenSys/docs-gha/spelling@main
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@m4sterbunny If you merge #6 , or copy pasta the content as a branch directly into docs-gha ^ change the above line main to your branch's name and you can test things on this repo?

with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

18 changes: 18 additions & 0 deletions .github/workflows/trivy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: Trivy

on:
pull_request:
branches:
- main

jobs:
trivy:
name: Run trivy scanner
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Trivy
uses: ConsenSys/docs-gha/trivy@main
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading
Loading