@monkvision/eslint-config-typescript-react

4.5.5 • Public • Published

@monkvision/eslint-config-typescript-react

This package provides the base ESlint configuration used in MonkJs TypeScript React projects.

Installation

To install this eslint configuration, simply run the following command :

yarn add -D @monkvision/eslint-config-typescript-react

Until ESlint flat config is implemented (see the note below), you will also need to install the required peer dependencies.

How to Use

To extend this config, simply place the following snipplet in your .eslintrc.js to include the config :

module.exports = {
  extends: ["@monkvision/eslint-config-typescript-react"],
  parserOptions: {
    project: ["./tsconfig.json"],
  },
};

Note that you need to manually specify the path to your tsconfig.json or the parser won't be able to locate your Typescript config.

A note reguarding ESlint Flat Configs

Due to the limitations of how ESlint works right now, shared ESlint configurations need to specify their dependencies (such as other configs, plugins etc...) as peer dependencies. This forces developers that want to use our config to manually download each one of our dependencies. This is obviously very cumbersome and kind of misses the whole point of a shared config. This is even more true when it comes to monorepos. There are ways of bypassing this limitation (@rushstack/eslint-patch etc...) but they come with their own limitations and are considered as "patches" rather than actual features.

However, in August 2022, the ESlint team came up with a new config system called ESlint Flat Config. This new config system allows (among other things) for a shared config to declare its dependencies as dev (or regular) dependencies, and include them in the config file (by importing them as a node package). This is obviously great news for us, since it basically means that all the issues listed in the previous paragraph will be solved. However, we need to give time to ESlint configs and plugins packages to adapt to this new config system. For instance, the typescript-eslint package created an issue on the 08/11 to update their config system.

This means that for now, we need to stick with the old config and its peer dependencies, and keep an eye on the package updates until the new ESlint config system is mature enough for us to migrate to it.

Some references to read more about this subject :

Package Sidebar

Install

npm i @monkvision/eslint-config-typescript-react

Weekly Downloads

177

Version

4.5.5

License

BSD-3-Clause-Clear

Unpacked Size

6.53 kB

Total Files

4

Last publish

Collaborators

  • raphaelmonk
  • souyahia-monk
  • leaks