unicorn/no-blob-to-file
eslint-plugin-unicorn
Suggestion
eslint.config.js
import unicorn from "eslint-plugin-unicorn";
export default [
{
plugins: { unicorn },
rules: {
"unicorn/no-blob-to-file": "error",
},
},
];const file = new File([blob], 'image.jpg');
URL.createObjectURL(file);const file = new File([blob], 'image.jpg');
formData.append('file', file);const file = new File([blob], 'image.jpg');
formData.set('file', file);URL.createObjectURL(blob);formData.append('file', blob, 'image.jpg');formData.set('file', blob, 'image.jpg');Examples from the ESLint documentation.
unicorn/no-blob-to-file
eslint-plugin-unicorn
import unicorn from "eslint-plugin-unicorn";
export default [
{
plugins: { unicorn },
rules: {
"unicorn/no-blob-to-file": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Disallow asynchronous callbacks in synchronous iterator helpers.
Disallow chained comparisons such as a < b < c.
Disallow .fill() after Array.from({length: …}).
Disallow accessing Map, Set, WeakMap, and WeakSet entries with bracket notation.
Add expiration conditions to TODO comments.
Disallow conflicting CSS query and HTML form constraints.