react-code-dataset / wp-calypso /packages /eslint-plugin-wpcalypso /docs /rules /jsx-classname-namespace.md
react-code-dataset / wp-calypso /packages /eslint-plugin-wpcalypso /docs /rules /jsx-classname-namespace.md
|
Download wp-calypso/packages/eslint-plugin-wpcalypso/docs/rules/jsx-classname-namespace.md from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 921 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/packages/eslint-plugin-wpcalypso/docs/rules/jsx-classname-namespace.md
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/packages/eslint-plugin-wpcalypso/docs/rules/jsx-classname-namespace.md
-
curl -L -o jsx-classname-namespace.md https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/packages/eslint-plugin-wpcalypso/docs/rules/jsx-classname-namespace.md
921 Bytes
| # Ensure JSX className adheres to CSS namespace guidelines | |
| If JSX element includes `className`, it must follow the [Block-Element-Modifier](https://en.bem.info/methodology/naming-convention/) naming principle. | |
| ## Rule Details | |
| The following patterns are considered warnings: | |
| ```jsx | |
| // client/sample-component/index.js | |
| export function myComponent1() { | |
| return <div className="sampleVisibleDiv" />; | |
| } | |
| // client/another-sample/index.js | |
| export function myComponent2() { | |
| return ( | |
| <div className="another-sample"> | |
| <div className="another-sample-child" /> | |
| </div> | |
| ); | |
| } | |
| ``` | |
| The following patterns are not warnings: | |
| ```jsx | |
| // client/sample-component/index.js | |
| export function myComponent1() { | |
| return <div className="sample__visible" />; | |
| } | |
| // client/another-sample/index.js | |
| export function myComponent2() { | |
| return ( | |
| <div className="another-sample"> | |
| <div className="another-sample__child" /> | |
| </div> | |
| ); | |
| } | |
| ``` | |