Skip to content

Update javascript.md #72

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 2 commits into from
May 2, 2022
Merged

Update javascript.md #72

merged 2 commits into from
May 2, 2022

Conversation

ntwb
Copy link
Member

@ntwb ntwb commented May 2, 2022

Follow up to #66 to update markdown format for https://developer.wordpress.org/coding-standards/wordpress-coding-standards/javascript/#type-checks

This resolves most issues with this file except for these four issues:

wordpress-coding-standards/javascript.md:44:59 MD033/no-inline-html Inline HTML [Element: sup]
wordpress-coding-standards/javascript.md:45:96 MD033/no-inline-html Inline HTML [Element: sup]
wordpress-coding-standards/javascript.md:46:123 MD033/no-inline-html Inline HTML [Element: sup]
wordpress-coding-standards/javascript.md:48:1 MD033/no-inline-html Inline HTML [Element: a]

For this section of code:

- Any `!` negation operator should have a following space.<sup>*</sup>
- All function bodies are indented by one tab, even if the entire file is wrapped in a closure.<sup>*</sup>
- Spaces may align code within documentation blocks or within a line, but only tabs should be used at the start of a line.<sup>*</sup>
<a name="spacing-whitespace">*</a>: The WordPress JavaScript standards prefer slightly broader whitespace rules than the jQuery style guide. These deviations are for consistency between the PHP and JavaScript files in the WordPress codebase.

This can be updated in a follow up pull request using the footnotes format:

https://www.markdownguide.org/extended-syntax/#footnotes

Possibly the above might not play well in the parser, so performing that as a separate PR will help if it needs to be reverted if it doesn't work, if that's the case using ^1 or ¹ can work in this case

@@ -49,7 +49,7 @@ These rules encourage liberal spacing for improved developer readability. The mi

Whitespace can easily accumulate at the end of a line – avoid this, as trailing whitespace is caught as an error in JSHint. One way to catch whitespace buildup is enabling visible whitespace characters within your text editor.

### Objects
### Object Declarations
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ntwb ntwb merged commit 6840250 into master May 2, 2022
@ntwb ntwb deleted the update-javascript branch May 2, 2022 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants