Skip to content
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

[Docs] Auto-generate list of rules in README #2541

Open
wants to merge 1 commit into
base: master
from

Conversation

@ybiquitous
Copy link
Contributor

ybiquitous commented Jan 13, 2020

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

See also #1742

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
@ybiquitous ybiquitous force-pushed the ybiquitous:auto-gen-list-of-rules branch from 2219bae to ecfccfb Jan 13, 2020
@ybiquitous ybiquitous marked this pull request as ready for review Jan 13, 2020
Copy link
Collaborator

ljharb left a comment

Thanks, this is great!

@@ -11,7 +11,9 @@
"pretest": "npm run lint",
"test": "npm run unit-test",
"type-check": "tsc",
"unit-test": "istanbul cover node_modules/mocha/bin/_mocha tests/lib/**/*.js tests/util/**/*.js tests/index.js"
"unit-test": "istanbul cover node_modules/mocha/bin/_mocha tests/lib/**/*.js tests/util/**/*.js tests/index.js",
"generate-list-of-rules": "./scripts/generate-list-of-rules.js README.md",

This comment has been minimized.

Copy link
@ljharb

ljharb Jan 13, 2020

Collaborator

this would be great as a published package, so we can use it in eslint-plugin-react and eslint-plugin-jsx-a11y as well :-D (but we should wait until this PR lands to do that)

const TAG_BASIC_RULES = '<!-- BASIC_RULES_SECTION -->';
const TAG_JSX_RULES = '<!-- JSX_RULES_SECTION -->';

const newContent = targetFileContent.replace(

This comment has been minimized.

Copy link
@ljharb

ljharb Jan 13, 2020

Collaborator

perhaps it would be worth using something like https://www.npmjs.com/package/markdown-magic rather than messing with regexes?

This comment has been minimized.

Copy link
@ybiquitous

ybiquitous Jan 14, 2020

Author Contributor

Looks good! I will try it on this PR later, thanks! 👍

This comment has been minimized.

Copy link
@ybiquitous

ybiquitous Jan 14, 2020

Author Contributor

I will try it with #1742.

@ybiquitous

This comment has been minimized.

Copy link
Contributor Author

ybiquitous commented Jan 14, 2020

I've synced this PR with #1742, so closing this.

@ybiquitous ybiquitous closed this Jan 14, 2020
@ljharb

This comment has been minimized.

Copy link
Collaborator

ljharb commented Jan 14, 2020

To be clear, i need both to stay open until both are merged :-)

@ljharb ljharb reopened this Jan 14, 2020
@ybiquitous

This comment has been minimized.

Copy link
Contributor Author

ybiquitous commented Jan 14, 2020

Sorry, I see 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.