@storis/eslint-config

5.0.0 • Public • Published

@storis/eslint-config

This package contains the standard eslint configurations for TypeScript packages used by STORIS. It extends and relies on a number of other rulesets and packages including eslint-config-airbnb, @typescript/eslint, and others. It then refines those rulesets to match the STORIS TypeScript style guide.

Usage

Peer dependencies

The package relies on the following peer dependencies which differ depending on if you are using the @storis/eslint-config/nodejs config, the @storis/eslint-config/react config, or the @storis/eslint-config/graphql config. You must ensure that compatible versions of the necessary peer dependencies have been installed.

Required for all configs

  • @typescript-eslint/eslint-plugin
  • @typescript-eslint/parser
  • eslint
  • eslint-config-airbnb-typescript
  • eslint-config-prettier
  • eslint-plugin-import
  • eslint-plugin-jest

Required for NodeJs config

  • eslint-config-airbnb-base

Required for React config

  • eslint-config-airbnb
  • eslint-plugin-jsx-a11y
  • eslint-plugin-react
  • eslint-plugin-react-hooks
  • eslint-plugin-testing-library

Required for GraphQL config

  • @graphql-eslint/eslint-plugin

Configuration

The configuration for @typescript-eslint requires a tsconfig.json file to lint using type information. The tsconfig.json file closest to the source file will be used.

Node

Add the following to your eslint configuration file (e.g. .eslintrc.js):

{
  extends: ['@storis/eslint-config/nodejs'],
}

React

Add the following to your eslint configuration file (e.g. .eslintrc.js):

{
  extends: ['@storis/eslint-config/react'],
}

GraphQL

Add the following to your eslint configuration file (e.g. .eslintrc.js):

const makeGraphqlOverrides = require('@storis/eslint-config/graphql');
const schemaPath = require.resolve(<path_to_graphql_schema>);
const graphqlOverrides = makeGraphqlOverrides(schemaPath);

{
  overrides: graphqlOverrides,
}

License

This project is licensed under the terms of the MIT license.

Readme

Keywords

none

Package Sidebar

Install

npm i @storis/eslint-config

Weekly Downloads

9

Version

5.0.0

License

MIT

Unpacked Size

19.9 kB

Total Files

9

Last publish

Collaborators

  • shawnmcknight
  • kgregory
  • sross65
  • kthompson23