Lint Rules

noHeaderScope (since v11.0.0)

Check that the scope attribute is only used on th elements.

ESLint Equivalent: scope

Examples

Invalid

<div scope={scope} />
nursery/noHeaderScope.js:1:6 lint/nursery/noHeaderScope  FIXABLE  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

   Avoid using the scope attribute on elements other than th elements.
  
  > 1 │ <div scope={scope} />
        ^^^^^^^^^^^^^
    2 │ 
  
   Suggested fix: Remove the scope attribute.
  
    1 │ <div·scope={scope}·/>
       --------------  
<div scope="col" />
nursery/noHeaderScope.js:1:6 lint/nursery/noHeaderScope  FIXABLE  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

   Avoid using the scope attribute on elements other than th elements.
  
  > 1 │ <div scope="col" />
        ^^^^^^^^^^^
    2 │ 
  
   Suggested fix: Remove the scope attribute.
  
    1 │ <div·scope="col"·/>
       ------------  

Valid

<th scope={scope}></th>
<th scope="col"></th>