ESLint plugin to prevent Lorem Ipsum placeholder text in your code.
npm install eslint-plugin-lorem --save-dev
Add to your .eslintrc.json
:
{
"extends": ["plugin:lorem/recommended"]
}
That's it! The plugin will work with default settings.
If you prefer manual setup or need customization:
{
"plugins": ["lorem"],
"rules": {
"lorem/no-lorem": "error"
}
}
Works out of the box with raw HTML files, React/JSX, Vue, Svelte. It is also compatible with template literals (escapes special characters) and regular TypeScript/JavaScript strings.
For HTML files, add to your .eslintrc.json
:
{
"overrides": [
{
"files": ["*.html"],
"parser": "eslint-html-parser"
}
]
}
{
"lorem/no-lorem": ["error", {
"strings": ["dummy text", "placeholder content"]
}]
}
{
"lorem/no-lorem": ["error", {
"strings": ["only check this text"],
"override": true
}]
}
{
"lorem/no-lorem": ["error", {
"message": "Please replace placeholder text"
}]
}
// eslint-disable-next-line lorem/no-lorem
const text = "Lorem ipsum dolor sit amet";
/* eslint-disable lorem/no-lorem */
const text1 = "Lorem ipsum dolor sit amet";
const text2 = "Lorem ipsum dolor sit amet";
/* eslint-enable lorem/no-lorem */
At the top of the file:
/* eslint-disable lorem/no-lorem */
- "lorem"
- "ipsum"
- "לורם"
- "איפסום"
MIT-0