2.2.2 • Published 2 years ago

@gathermade/eslint-config v2.2.2

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

@gathermade/eslint-config

GatherMade's shared ESLint configurations.

Installation

Install via your package manager of choice:

npm install -D @gathermade/eslint-config
yarn add -D @gathermade/eslint-config

You'll also need to install eslint and prettier, which are peer dependencies.

You will also need to install typescript if you're using those configurations; these are also represented as peer dependencies.

Configurations

  • @gathermade/eslint-config/recommended: A base configuration. You probably want this rule set enabled at the root of your configuration.
  • @gathermade/eslint-config/recommended-typescript: A base configuration for TypeScript files.
  • @gathermade/eslint-config/jest: A configuration for Jest tests.
  • @gathermade/eslint-config/node/commonjs/typescript: A configuration for TypeScript files run via a CommonJS Node runtime.
  • @gathermade/eslint-config/node/commonjs: A configuration for files run via a CommonJS Node runtime.

Usage

The most effective way to use this configuration is in conjunction with overrides. For example:

// .eslintrc.js
module.exports = {
  root: true,
  extends: ["@gathermade/eslint-config/recommended"],
  overrides: [
    // TypeScript files
    {
      files: ["src/**/*.ts"],
      parserOptions: {
        tsconfigRootDir: __dirname,
        project: "./tsconfig.json",
      },
      extends: ["@gathermade/eslint-config/recommended-typescript"],
    },
    // Tests
    {
      files: ["src/**/*.test.{j,t}s"],
      extends: ["@gathermade/eslint-config/jest"],
    },
  ],
};