2

I have an audio file that im querying from contentful but instead of display the data I keep getting this eslintrule pop, It's an audio file so it has no captions. Is there a way of disabling this or correctly disabling it ?

this is the code

{data.allContentfulPodcast.edges.map(video => 
          <div>
          <audio key={video} src={video.node.video.file.url}/>
         
         
          </div>
          )}
Ferran Buireu
  • 28,630
  • 6
  • 39
  • 67
someone
  • 661
  • 1
  • 9
  • 26

2 Answers2

3

You may be able to disable that rule for the file by adding this comment at the top:

/* eslint-disable jsx-a11y/media-has-caption */
Cloud
  • 938
  • 1
  • 8
  • 24
0

You can also add rule to disable that specific line:

{data.allContentfulPodcast.edges.map(video => 
        <div>
          /* eslint-disable-next-line jsx-a11y/media-has-caption */
          <audio key={video} src={video.node.video.file.url}/>
       </div>
)}
Maqsood Ahmed
  • 1,853
  • 1
  • 10
  • 18