5.0.0 • Published 1 year ago

@storis/eslint-config v5.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

@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.

5.0.0

1 year ago

4.0.0

2 years ago

3.2.0

2 years ago

3.1.0

2 years ago

3.0.0

2 years ago

2.0.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago