Skip to content
Closed
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
3 changes: 3 additions & 0 deletions .github/actions/lint/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,6 @@ runs:
- name: Check formatting
shell: bash
run: yarn run format-check
- name: Lint markdown
shell: bash
run: yarn run lint-markdown
2 changes: 1 addition & 1 deletion .github/actions/yarn-install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ runs:
ATTEMPT=0
WAIT_TIME=20
while [ $ATTEMPT -lt $MAX_ATTEMPTS ]; do
yarn install --non-interactive --frozen-lockfile && break
yarn install --non-interactive --frozen-lockfile --ignore-engines && break
echo "yarn install failed. Retrying in $WAIT_TIME seconds..."
sleep $WAIT_TIME
ATTEMPT=$((ATTEMPT + 1))
Expand Down
42 changes: 42 additions & 0 deletions .markdownlint-cli2.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/

import relativeLinksRule from 'markdownlint-rule-relative-links';

const config = {
config: {
'heading-increment': true,
'no-reversed-links': true,
'no-missing-space-atx': true,
'no-duplicate-heading': {
siblings_only: true,
},
'single-title': true,
'no-trailing-punctuation': true,
'no-space-in-emphasis': true,
'no-space-in-code': true,
'no-space-in-links': true,
'fenced-code-language': true,
'first-line-heading': true,
'no-empty-links': true,
'no-alt-text': true,
'link-fragments': true,
'table-column-count': true,

// The rest of default rules are already handled by prettier

// Custom rules
'relative-links': true,
},
globs: ['**/__docs__/*.md'],
ignores: ['**/node_modules'],
customRules: [relativeLinksRule],
};

export default config;
2 changes: 2 additions & 0 deletions __docs__/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Native and contribute to it. **End users of React Native are meant to use the
For details on how we approach technical documentation in this repository, see
[GUIDELINES.md](./GUIDELINES.md).

[This link does not exist!](./doesnotexist.md).

## Usage

This repository is not meant to be consumed directly by end users. Instead, it
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"featureflags": "yarn --cwd packages/react-native featureflags",
"lint-ci": "./.github/workflow-scripts/analyze_code.sh && yarn shellcheck",
"lint-java": "node ./scripts/lint-java.js",
"lint-markdown": "markdownlint-cli2 2>&1",
"lint": "eslint .",
"prettier": "prettier --write \"./**/*.{js,md,yml,ts,tsx}\"",
"print-packages": "node ./scripts/monorepo/print",
Expand Down Expand Up @@ -90,6 +91,8 @@
"jest-diff": "^29.7.0",
"jest-junit": "^10.0.0",
"jest-snapshot": "^29.7.0",
"markdownlint-cli2": "^0.17.2",
"markdownlint-rule-relative-links": "^4.0.1",
"metro-babel-register": "^0.82.0",
"metro-memory-fs": "^0.82.0",
"metro-transform-plugins": "^0.82.0",
Expand Down
Loading