@lcooper/eslint-plugin

1.4.0 • Public • Published

@lcooper/eslint-plugin

npm ci license

Awesome extra ESLint rules.

Installation

install with npm:

npm install -D eslint @lcooper/eslint-plugin

install with yarn:

yarn add -D eslint @lcooper/eslint-plugin

Usage

Configuration (legacy .eslintrc):

Add @lcooper/eslint-plugin or just @lcooper to the plugins section of your eslintrc configuration file.

Next, configure the rules you want to use under the rules section, or use the plugin:@lcooper/all bundled config that enables all plugin rules and disables any conflicting base ESLint rules. This can be configured using the extends property in your .eslintrc config file:

{
  "plugins": [
    "@lcooper"
  ],
  "extends": [
    "plugin:@lcooper/all"
  ]
}

Configuration (new eslint.config.js):

If you are using the new flat config system, you can add the bundled all/flat config to the exported config array in your eslint.config.js file:

const plugin = require('@lcooper/eslint-plugin');

module.exports = [
    // ... other configs
    plugin.configs['all/flat'],
];

Rules

🔧 = Fixable

Name Description
consecutive-declarations Enforce a consistent style for consecutive const, let, and var declarations 🔧
global-require Ensure require() calls are in the top-level module scope
prefer-template Suggest using template literals instead of string concatenation 🔧
top-level-padding-lines Require or disallow empty lines between top level statements 🔧

Related

ESLint configs that utilize this plugin:

License

MIT

Package Sidebar

Install

npm i @lcooper/eslint-plugin

Weekly Downloads

3

Version

1.4.0

License

MIT

Unpacked Size

79.9 kB

Total Files

16

Last publish

Collaborators

  • lcooper