Skip to content

ophirbucai/eslint-plugin-lorem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eslint-plugin-lorem

npm

ESLint plugin to prevent Lorem Ipsum placeholder text in your code.

Install

npm install eslint-plugin-lorem --save-dev

Quick Start

Add to your .eslintrc.json:

{
  "extends": ["plugin:lorem/recommended"]
}

That's it! The plugin will work with default settings.

Manual Configuration

If you prefer manual setup or need customization:

{
  "plugins": ["lorem"],
  "rules": {
    "lorem/no-lorem": "error"
  }
}

Framework Support

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"
    }
  ]
}

Customization

Add More Strings to Check

{
  "lorem/no-lorem": ["error", {
    "strings": ["dummy text", "placeholder content"]
  }]
}

Override Default Strings

{
  "lorem/no-lorem": ["error", {
    "strings": ["only check this text"],
    "override": true
  }]
}

Custom Error Message

{
  "lorem/no-lorem": ["error", {
    "message": "Please replace placeholder text"
  }]
}

Disabling the Rule

For a Single Line

// eslint-disable-next-line lorem/no-lorem
const text = "Lorem ipsum dolor sit amet";

For a Block

/* eslint-disable lorem/no-lorem */
const text1 = "Lorem ipsum dolor sit amet";
const text2 = "Lorem ipsum dolor sit amet";
/* eslint-enable lorem/no-lorem */

For an Entire File

At the top of the file:

/* eslint-disable lorem/no-lorem */

Default Strings Checked

  • "lorem"
  • "ipsum"
  • "לורם"
  • "איפסום"

License

MIT-0

Releases

No releases published

Packages

No packages published