Skip to content

[Beta]: docs(cn): preserving-and-resetting-state.md #679

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

Merged
merged 10 commits into from
May 26, 2022
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