# eslint-plugin-require

> ESLint rules for enforcing specified uses of RequireJS.

Latest version **0.0.1** (published 2014-12-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install eslint-plugin-require
pnpm add eslint-plugin-require
yarn add eslint-plugin-require
bun add eslint-plugin-require
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2014-12-16 |
| First published | 2014-12-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Ben Regenspan |
| Maintainers | bregenspan |
| Keywords | eslint, eslintplugin, require, requirejs, AMD, lint |

## Links

- npm: https://www.npmjs.com/package/eslint-plugin-require
- Repository: https://github.com/bregenspan/eslint-plugin-require
- Issues: https://github.com/bregenspan/eslint-plugin-require/issues/
- npm.io page: https://npm.io/package/eslint-plugin-require

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@inrupt/eslint-config-base](https://npm.io/package/@inrupt/eslint-config-base.md) — 4.5K weekly downloads

## Recent versions

- 0.0.1 (latest) — 2014-12-16

## README

[![Build Status](https://travis-ci.org/bregenspan/eslint-plugin-require.svg)](https://travis-ci.org/bregenspan/eslint-plugin-require)

# eslint-plugin-require

<a href="http://eslint.org/">ESLint</a> rules for enforcing specified patterns of use of <a href="http://requirejs.org/">RequireJS</a> and compatible AMD module loaders.

## Why Use It

RequireJS provides great ways to manage, optimize, and asynchronously load dependencies, but it can be easy to make a few different types of mistakes when using it:

 * Calling `require('dependency-name', cb)` to load a dependency, when what you meant was `require(['dependency-name'], cb)`.
   * [require-array-syntax](docs/rules/require-array-syntax.md) can be used to mitigate this issue by enforcing that the first argument to `require()` is always an array.
 * Forgetting to wrap your module in a `define()` call or accidentally wrapping it in a `require()` call instead.
   * [require-define](docs/rules/require-define.md) enforces that all files be a strict subset of AMD that always starts with a `define()` statement.
 * Using inner `require()` statements for things you had intended to optimize into one file as part of your build.
   * [require-module-prefix](docs/rules/require-module-prefix.md) mitigates this issue by enforcing that `require()` statements reference files with a common prefix, e.g.: "modules/".  This supports a project structure wherein independently-loadable modules live in a "modules/" folder and can be optimized by the r.js loader to contain all their dependencies in one file, while still being dynamically loadable by other modules.

## Getting Started

Documentation for each rule can be found in [docs/rules](docs/rules).

## Further Reading

* http://eslint.org/ 
* http://requirejs.org/

---
_Source: https://npm.io/package/eslint-plugin-require · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
