Skip to content

Commit 750d673

Browse files
committed
Add a lint rule to remind about the placeholder prop
1 parent 5b492d3 commit 750d673

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

.eslintrc.cjs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,15 @@ module.exports = {
6666
"@typescript-eslint/ban-ts-comment": "off",
6767
"@typescript-eslint/no-var-requires": "off",
6868
"@typescript-eslint/ban-types": "off",
69+
"no-restricted-syntax": [
70+
"error",
71+
{
72+
selector:
73+
"JSXElement[openingElement.name.name=/^(Image|NextImage)$/]:not(:has(JSXAttribute[name.name='placeholder']))",
74+
message:
75+
"Pass `placeholder: 'empty' | 'blur'` when calling <Image> or <NextImage>.",
76+
},
77+
],
6978
},
7079
settings: {
7180
tailwindcss: {

0 commit comments

Comments
 (0)