[Docs] Re-sort all rules alphabetically #1742
…cally To make it easier to find rules. This adds a script to auto-generate the list of rules and embeds special tags to README. Usage: $ npm run generate-list-of-rules Check whether the auto-generated changes are committed: $ npm run generate-list-of-rules:check Use `markdown-magic` package to transform README https://www.npmjs.com/package/markdown-magic
Thanks for your review!
I think it is easiest to use regular expressions, so what do you think?
const pattern = /# List of supported rules([\s\S]+?)#/; const source = '<README.md contents...>'; const ruleListText = source.match(pattern); const ruleList = ruleListText.trim().split('*'); // check sorting...
(I think using the markdown parser is too heavy for this task...)
Sorry for late reply
Thanks, I will try it!