1.0.0 • Published 2 years ago
@sulcata/eslint-config v1.0.0
@sulcata/eslint-config
A shareable set of ESLint configurations for TypeScript, React, and more. Intended to be opinionated in practices, not style.
If you're looking for opinionated style, I highly recommend Prettier.
Install
npm install @sulcata/eslint-config
Sadly because of the way the configuration system currently works, you'll also need to install the following peer dependencies for now.
npm install eslint-plugin-jest eslint-plugin-jsx-a11y eslint-plugin-react eslint-plugin-react-hooks
Once ESLint starts rolling out the new configuration system, this package will be changed to bundle them transparently.
Usage
Writing your ESLint .eslintrc.js
config file can be as simple as:
"use strict";
module.exports = {
root: true,
parserOptions: {
tsconfigRootDir: __dirname,
project: ["./tsconfig.json"],
},
extends: ["@sulcata/eslint-config"],
};
This package exports a number of shareable configs that can be imported into your configuration using the ESLint config "extends"
key.
@sulcata/eslint-config
The kitchen sink, most likely what you want for minimal configuration. Pre-configured using the overrides feature to match file extensions to the appropriate configs. Includesrecommended
,typescript
,react
, andjest
. RequirestsconfigRootDir
andproject
to be configured inparserOptions
for type information.@sulcata/eslint-config/recommended
for general JavaScript linting.@sulcata/eslint-config/typescript
for TypeScript linting. RequirestsconfigRootDir
andproject
to be configured inparserOptions
for type information.@sulcata/eslint-config/react
for React apps.@sulcata/eslint-config/jest
for Jest test suites.
Issues
Raise an issue (or a PR) if you notice any styling related rules bubbling up.