Skip to content

Commit 91a8c32

Browse files
YogaLinNeo42QC-L
authored
[Beta]: docs(cn): preserving-and-resetting-state.md (#679)
Co-authored-by: Hao Jiang ᛋ <[email protected]> Co-authored-by: QiChang Li <[email protected]>
1 parent 86b66cc commit 91a8c32

File tree

5 files changed

+185
-182
lines changed

5 files changed

+185
-182
lines changed

beta/scripts/generateRedirects.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function writeRedirectsFile(redirects, redirectsFilePath) {
4242
* Make sure we dont have the same redirect already
4343
*/
4444
oldConfigContent.redirects.forEach((data) => {
45-
if(vercelRedirects[data.source]){
45+
if (vercelRedirects[data.source]) {
4646
delete vercelRedirects[data.source];
4747
}
4848
});

beta/scripts/headingIDHelpers/validateHeadingIDs.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ function validateHeaderId(line) {
1717
const match = /\{\/\*(.*?)\*\/}/.exec(line);
1818
const id = match;
1919
if (!id) {
20-
console.error(
21-
'Run yarn fix-headings to generate headings.'
22-
);
20+
console.error('Run yarn fix-headings to generate headings.');
2321
process.exit(1);
2422
}
2523
}

beta/scripts/headingIDHelpers/walk.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ const fs = require('fs');
22

33
module.exports = function walk(dir) {
44
let results = [];
5-
/**
5+
/**
66
* If the param is a directory we can return the file
77
*/
8-
if(dir.includes('md')){
8+
if (dir.includes('md')) {
99
return [dir];
1010
}
1111
const list = fs.readdirSync(dir);

beta/scripts/headingIdLinter.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
const validateHeaderIds = require('./headingIDHelpers/validateHeadingIDs');
22
const generateHeadingIds = require('./headingIDHelpers/generateHeadingIDs');
33

4-
/**
4+
/**
55
* yarn lint-heading-ids --> Checks all files and causes an error if heading ID is missing
66
* yarn lint-heading-ids --fix --> Fixes all markdown file's heading IDs
77
* yarn lint-heading-ids path/to/markdown.md --> Checks that particular file for missing heading ID (path can denote a directory or particular file)
88
* yarn lint-heading-ids --fix path/to/markdown.md --> Fixes that particular file's markdown IDs (path can denote a directory or particular file)
9-
*/
9+
*/
1010

1111
const markdownPaths = process.argv.slice(2);
1212
if (markdownPaths.includes('--fix')) {

0 commit comments

Comments
 (0)