Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

eslint-config-pat

Pat-specific ESLint config. Same great taste, same low price.

eslint, config, styleguide, eslint-config

readme

eslint-config-pat

Same great taste, same low price!

A very me-specific ESLint config.

npm install --save-dev eslint-config-pat

Use

This package takes advantage of ESLint's shared multiple configs — that is, there are four different configs shared via this package:

  • pat: For linting Javascript.
  • pat/node: For linting Node.js projects.
  • pat/react: For linting React.js projects.
  • pat/mocha: For linting Mocha test suites.

All configs rely on eslint, but the most specific configs rely on plugins as well.

pat: Base Config

  • Requires:
    • eslint >=8.16.0

The pat configuration is the base for this package. It only declares rules that are shipped with ESLint — therefore it relies on no plugins. It's useful for linting really any Javascript.

Example usage:

/**
 * .eslintrc.js
 */
module.exports = {
  extends: "pat",
}

pat/node: Node.js Config

  • Requires:
    • eslint >=8.16.0
    • eslint-plugin-node >=11.1.0

The pat/node configuration is used for linting Node.js projects. It extends from the pat base config, while adding rules from eslint-plugin-node.

Example usage:

/**
 * .eslintrc.js
 */
module.exports = {
  extends: "pat/node",
}

pat/react: React.js Config

  • Requires:
    • eslint >=8.16.0
    • eslint-plugin-react >=7.30.0

The pat/react configuration is used for linting React.js projects. It extends from the pat base config, while adding rules from eslint-plugin-react.

Example usage:

/**
 * .eslintrc.js
 */
module.exports = {
  extends: "pat/react",
}

pat/mocha: Mocha Config

  • Requires:
    • eslint >=8.16.0
    • eslint-plugin-mocha >=10.0.0

The pat/mocha configuration is used for linting Mocha test suites. It extends from the pat base config, while adding rules from eslint-plugin-mocha.

Example usage:

/**
 * .eslintrc.js
 */
module.exports = {
  extends: "pat/mocha",
}

changelog

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

v5.0.0 - 2022-05-25

Changes

  • pat: Add no-constant-binary-expression rule.
  • pat: Add no-unused-private-class-members rule.
  • pat: Add prefer-object-has-own rule.
  • pat/mocha: Add mocha/no-empty-description rule.
  • pat/react: Add react/prefer-exact-props rule.
  • pat/react: Add react/hook-use-state rule.
  • pat/react: Add react/no-arrow-function-lifecycle rule.
  • pat/react: Add react/no-invalid-html-attribute rule.
  • pat/react: Add react/no-namespace rule.
  • pat/react: Add react/no-unstable-nested-components rule.
  • pat/react: Add react/no-unused-class-component-methods rule.
  • pat/react: Add react/iframe-missing-sandbox rule.
  • pat/react: Add react/jsx-key rule.
  • pat/react: Add react/jsx-newline rule.
  • pat/react: Add react/jsx-no-constructed-context-values rule.
  • pat/react: Add react/jsx-no-leaked-render rule.

Dependencies

v4.6.0 - 2021-10-06

Changes

  • pat: set ecmaVersion option to latest.

Dependencies

v4.5.0 - 2020-12-27

Changes

  • pat: Add enforceForJSX option to no-unused-expressions.

Dependencies

[v4.4.1][v4.4.1] - 2020-12-27

Dependencies

v4.4.0 - 2020-12-15

Added

  • pat: Enable new ESLint rule no-nonoctal-decimal-escape.
  • pat: Enable new ESLint rule no-unsafe-optional-chaining.

Changes

  • pat/node: Don't warn on import of lodash.

Dependencies

v4.3.0 - 2020-10-20

Added

  • pat: Set new ignoreDefaultValues option on no-magic-numbers.
  • pat/react: Set new allow: as-needed option on react/jsx-filename-extension.

Changes

  • pat: ECMA version is now 2021.
  • pat: Add all RFC-standard HTTP status codes to no-magic-numbers ignore list.

Fixes

  • pat/mocha now extends pat base config.

Dependencies

v4.2.0 - 2020-08-15

Added

  • pat/mocha: expect defined as a readonly global.

Dependencies

v4.1.0 - 2020-08-10

Added

Changes

  • pat: change complexity limit to 6.
  • pat/mocha: disable ESLint rules no-unused-expressions and max-lines.

Dependencies

v4.0.0 - 2020-07-21

Changes

  • pat: Enable the allowSeparatedGroups option to the sort-imports rule.

Dependencies

  • Move all plugins to optionalDependencies. This way you're only alerted to the ones you need based on which config you're using.
  • upgrade `eslint@7.5.0`

v2.3.0 - 2020-06-24

Added

Dependencies

v2.2.0 - 2020-06-02

Added

Fixed

  • Change node engine to >=12.x.

CI/CD

  • Add CI action to run tests on pull request.
  • Use npm bin to find executable paths.

Dependencies

v2.1.1 - 2020-05-14

Fixed

  • Ignore all test files and scripts when publishing NPM package.
  • Add LICENSE file.

v2.1.0 - 2020-05-14

Features

  • pat/mocha: New config for linting Mocha test suites.
  • Added chicken tests for all configs to ensure they are always usable.

Dependencies

  • install eslint-plugin-mocha: >=7.0.0
  • upgrade eslint-plugin-react: >=7.20.0

v2.0.0 - 2020-05-12

Features

Dependencies

  • upgrade eslint: >=7.0.0

[v1.1.0][v1.1.0] - 2020-04-23

Updated

  • pat/node: parserOptions.sourceType is now module.

Dependencies

  • upgrade eslint-plugin-node: >=11.1.0.

v1.0.1 - 2020-04-23

Fixed

  • pat/node: node/no-restricted-require rules had incorrect name (node/no-restricted-modules).

v1.0.0 - 2020-04-20

Initial public release.