Skip to content

Commit

Permalink
[Beta]: docs(cn): preserving-and-resetting-state.md (#679)
Browse files Browse the repository at this point in the history
Co-authored-by: Hao Jiang ᛋ <22409868+Neo42@users.noreply.github.com>
Co-authored-by: QiChang Li <github@liqichang.com>
  • Loading branch information
3 people authored May 26, 2022
1 parent 86b66cc commit 91a8c32
Show file tree
Hide file tree
Showing 5 changed files with 185 additions and 182 deletions.
2 changes: 1 addition & 1 deletion beta/scripts/generateRedirects.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function writeRedirectsFile(redirects, redirectsFilePath) {
* Make sure we dont have the same redirect already
*/
oldConfigContent.redirects.forEach((data) => {
if(vercelRedirects[data.source]){
if (vercelRedirects[data.source]) {
delete vercelRedirects[data.source];
}
});
Expand Down
4 changes: 1 addition & 3 deletions beta/scripts/headingIDHelpers/validateHeadingIDs.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ function validateHeaderId(line) {
const match = /\{\/\*(.*?)\*\/}/.exec(line);
const id = match;
if (!id) {
console.error(
'Run yarn fix-headings to generate headings.'
);
console.error('Run yarn fix-headings to generate headings.');
process.exit(1);
}
}
Expand Down
4 changes: 2 additions & 2 deletions beta/scripts/headingIDHelpers/walk.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ const fs = require('fs');

module.exports = function walk(dir) {
let results = [];
/**
/**
* If the param is a directory we can return the file
*/
if(dir.includes('md')){
if (dir.includes('md')) {
return [dir];
}
const list = fs.readdirSync(dir);
Expand Down
4 changes: 2 additions & 2 deletions beta/scripts/headingIdLinter.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const validateHeaderIds = require('./headingIDHelpers/validateHeadingIDs');
const generateHeadingIds = require('./headingIDHelpers/generateHeadingIDs');

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

const markdownPaths = process.argv.slice(2);
if (markdownPaths.includes('--fix')) {
Expand Down
Loading

0 comments on commit 91a8c32

Please sign in to comment.