1.0.0 • Published 4 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-configSadly 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-hooksOnce 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-configThe 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. RequirestsconfigRootDirandprojectto be configured inparserOptionsfor type information.@sulcata/eslint-config/recommendedfor general JavaScript linting.@sulcata/eslint-config/typescriptfor TypeScript linting. RequirestsconfigRootDirandprojectto be configured inparserOptionsfor type information.@sulcata/eslint-config/reactfor React apps.@sulcata/eslint-config/jestfor Jest test suites.
Issues
Raise an issue (or a PR) if you notice any styling related rules bubbling up.