eslint-plugin-local-rules

1.3.2 • Public • Published

eslint-plugin-local-rules

A plugin for ESLint that allows you to use project-specific rules, similar to the --rulesdir command line option (more).

Workaround for https://github.com/eslint/eslint/issues/8769 (previously https://github.com/eslint/eslint/issues/2715).

Other solutions

Dependencies

  • Requires ESLint version 0.8.0 or higher

Install

npm install eslint-plugin-local-rules

Usage

./eslint-local-rules.js (or ./eslint-local-rules/index.js)

'use strict';

module.exports = {
  'disallow-identifiers': {
    meta: {
      docs: {
        description: 'disallow identifiers',
        category: 'Possible Errors',
        recommended: false,
      },
      schema: [],
    },
    create: function (context) {
      return {
        Identifier: function (node) {
          context.report({
            node: node,
            message: 'Identifiers not allowed for Super Important reasons.',
          });
        },
      };
    },
  },
};

./.eslintrc

{
  "plugins": ["eslint-plugin-local-rules"],

  "rules": {
    "local-rules/disallow-identifiers": 2
  }
}

License

MIT

Install

npm i eslint-plugin-local-rules

DownloadsWeekly Downloads

124,340

Version

1.3.2

License

MIT

Unpacked Size

8.15 kB

Total Files

13

Last publish

Collaborators

  • cletusw