1.1.2 • Published 5 months ago

eslint-plugin-lorem v1.1.2

Weekly downloads
-
License
MIT-0
Repository
-
Last release
5 months ago

eslint-plugin-lorem

npm

Tired of placeholder text creeping into your production code? Meet eslint-plugin-lorem – a lightweight ESLint plugin designed to catch unwanted strings (like Lorem Ipsum) in your codebase before they ever see the light of day.

Why Use It?

  • Keep Your Code Clean:

    Prevent accidental placeholder text (and the inevitable scolding from the marketing team) from ending up in your production code.

  • Easy to Configure:

    With a simple setup, you can tailor the plugin to fit the specific needs of your project.

Features

  • Multi-file Support: Works seamlessly with JavaScript, React, Vue, Svelte, and HTML files.

  • Template Literal Detection: Scans both regular strings and template literals for unwanted placeholder text.

  • Customizable: Easily add or override the list of strings to check according to your project's needs.

  • Flexible Rule Disabling: Disable the rule on specific lines, blocks, or entire files as needed.

Quick Start

Add to your .eslintrc.json:

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

In a future version we will support flat configuration (eslint.config.js).

Example Configuration

Add the following to your ESLint configuration file:

{
  "plugins": ["lorem"],
  "rules": {
    "lorem/no-lorem": ["error", {
      "strings": ["custom text"], // Add any additional strings you wish to check
      "override": true // Set to true to completely replace default strings
    }]
  }
}

This configuration tells ESLint to flag any occurrences of the specified strings, ensuring that your code remains professional and free from unwanted placeholder text.

Get Started

Install the plugin via npm:

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

Then integrate it into your ESLint configuration as shown above. Now you can rest easy knowing that any stray Lorem Ipsum or other placeholder text will be caught early in your development process.

Keep your codebase clean and professional with eslint-plugin-lorem—because placeholder text doesn't belong in production!


Disabling the Rule

Sometimes you may need to disable the rule:

  • For a Single Line:

    Copy
    // 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:

    Place at the top of the file:

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

Default Strings Checked

By default, the plugin checks for common placeholder strings such as:

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

License

This project is licensed under the MIT-0 License.

1.1.2

5 months ago

1.1.1

8 months ago

1.1.0

8 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago