@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:
module.exports = {
root: true,
extends: ["@gathermade/eslint-config/recommended"],
overrides: [
{
files: ["src/**/*.ts"],
parserOptions: {
tsconfigRootDir: __dirname,
project: "./tsconfig.json",
},
extends: ["@gathermade/eslint-config/recommended-typescript"],
},
{
files: ["src/**/*.test.{j,t}s"],
extends: ["@gathermade/eslint-config/jest"],
},
],
};