eslint-plugin-unicorn
eslint-plugin-unicorn copied to clipboard
Add `no-invalid-fetch-options` rule
Fixes #1989
These doesn't thows
fetch('/', {method: 'OPTIONS', body: 'foo'})
fetch('/', {method: 'TRACE', body: 'foo'})
fetch('/', {method: 'CONNECT', body: 'foo'})
The spec only forbids GET and HEAD.
These doesn't thows
fetch('/', {method: 'OPTIONS', body: 'foo'}) fetch('/', {method: 'TRACE', body: 'foo'}) fetch('/', {method: 'CONNECT', body: 'foo'})The spec only forbids
GETandHEAD.
Ok, then MDN is just inaccurate.
Thanks @fisker!