Package detail

eslint-config-guard

gamtiq5.3kMIT3.0.0

ESLint configuration files (shareable configs) to guard from problems in different areas of JavaScript development.

eslint, eslintconfig, shareable, config

readme

eslint-config-guard

Set of configuration files (shareable configs) for ESLint to guard/protect from problems in different areas of JavaScript development.

Includes:

  • guard - contains rules for possible errors, best practices, strict mode and variables; extends eslint:recommended;
  • guard/editor - rules corresponding to editor preferences (like editorconfig) such as eol-last, linebreak-style, no-trailing-spaces;
  • guard/esnext - configuration for ECMAScript 6/2015+ features;
  • guard/indent - configuration of indent rule;
  • guard/jsdoc - contains rules related to JSDoc;
  • guard/no-prettier - adds "prettier/prettier": "off" to rules; can be helpful to use with TSDX;
  • guard/node - configuration related to Node.js and CommonJS;
  • guard/proper-arrows - configuration for stylistic rules related to arrow functions (see @getify/eslint-plugin-proper-arrows);
  • guard/react - configuration for React and JSX; extends plugin:react/recommended;
  • guard/style - rules for stylistic issues;
  • guard/test - appropriate for use in tests (relaxes some rules from other configs);
  • guard/test-jest - appropriate for use in Jest tests; extends guard/test;
  • guard/test-mocha - appropriate for use in Mocha tests; extends guard/test;

The following files are combined configs which extend other configs:

  • guard/ext-style - extends guard/indent and guard/style;
  • guard/optimum - extends guard and guard/ext-style;
  • guard/optimum-next - extends guard/optimum and guard/esnext.

See eslint-config-ts-guard for configuration files related to TypeScript.

Installation

npm install eslint-config-guard --save-dev

If you are going to use guard/node you should install eslint-plugin-node:

npm install eslint-plugin-node --save-dev

If you are going to use guard/proper-arrows you should install @getify/eslint-plugin-proper-arrows:

npm install @getify/eslint-plugin-proper-arrows --save-dev

If you are going to use guard/react you should install eslint-plugin-react:

npm install eslint-plugin-react --save-dev

Usage

In a .eslintrc.json file:

{
    "extends": [
        "guard",
        "guard/node"
    ]
}

In a package.json:

{
    "eslintConfig": {
        "extends": [
            "guard/optimum-next",
            "guard/proper-arrows",
            "guard/react"
        ]
    }
}

License

Copyright (c) 2016-2022 Denis Sikuler
Licensed under the MIT license.

changelog

3.0.0 / 2022-11-02

  • Updated ESLint version up to 8.14.0.
  • Updated eslint-plugin-react version.
  • Added the following rules: no-constant-binary-expression, no-unused-private-class-members, react/no-arrow-function-lifecycle, react/no-invalid-html-attribute, react/no-namespace, react/jsx-no-leaked-render.
  • Added warnOnDuplicates option for react/jsx-key rule.

2.1.1 / 2021-10-09

  • Added no-multi-assign rule.

2.1.0 / 2021-03-22

  • Added the following rules: no-nonoctal-decimal-escape, no-unsafe-optional-chaining, react/jsx-key, react/jsx-no-constructed-context-values, react/jsx-no-target-blank.
  • Set ignoreDefaultValues option for no-magic-numbers rule.
  • Set enforceForJSX option for no-unused-expressions rule.

2.0.1 / 2020-08-05

  • Use full package path to extend local config files.

2.0.0 / 2020-08-05

  • Move TypeScript-related configuration files into separate package eslint-config-ts-guard (breaking change).
  • Add guard/proper-arrows config file containing stylistic rules related to arrow functions.

1.3.1 / 2020-07-25

  • Relax @typescript-eslint/naming-convention rule for properties.

1.3.0 / 2020-07-24

  • Improve and fix TypeScript related rules.

1.2.0 / 2020-06-22

  • Update ESLint version up to 7.3.0 and add new rules.

1.1.0 / 2020-02-24

  • Add config files to lint TypeScript code (guard/typescript and guard/typescript-ext).
  • Update ESLint and eslint-plugin-react versions and add new rules.
  • Add guard/no-prettier and guard/test-jest configs.

1.0.3 / 2019-09-12

  • Set as-needed option for func-names rule in guard/style.

1.0.2 / 2019-09-09

  • Relax no-magic-numbers (from guard) and no-trailing-spaces (from guard/editor) rules.