@storis/eslint-config
v5.0.0
Published
Eslint configurations
Downloads
817
Keywords
Readme
@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.