JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 21038
  • Score
    100M100P100Q147983F
  • License MIT

Enforce code conventions for RequireJS modules with ESLint

Package Exports

  • eslint-plugin-requirejs

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (eslint-plugin-requirejs) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

eslint-plugin-requirejs

npm Maintenance Status Build Status Coverage Status

Enforce code conventions for RequireJS modules with ESLint

Installation

Install ESLint either locally or globally.

$ npm install eslint

If you installed ESLint globally, you have to install the RequireJS plugin globally too. Otherwise, install it locally.

$ npm install eslint-plugin-requirejs

Configuration

Add the plugins section to your config file if not already present and specify eslint-plugin-requirejs as a plugin. The eslint-plugin- prefix may be omitted:

{
  "plugins": [
    "requirejs"
  ]
}

Enable the rules that you would like to use, for example:

{
  "rules": {
    "requirejs/no-invalid-define": 2,
    "requirejs/no-multiple-define": 2,
    "requirejs/no-named-define": 2,
    "requirejs/no-commonjs-wrapper": 2,
    "requirejs/no-object-define": 1
  }
}

List of supported rules

Don't see the rule you're looking for?

Take a look at what's in progress for the next milestone, or suggest a new rule by filing an issue.

Contributing

Contributions are encouraged. There are a few ways you can help:

  • Filing issues - if you find a bug or would like to request a new rule or enhancement, file an issue
  • Submitting pull requests - pick one of the open issues to work on and submit a pull request

License

eslint-plugin-requirejs is licensed under the MIT License.