@economic/eslint-config

1.2.2 • Public • Published

E-conomic ESLint config

This is a configuration for ESLint, a tool for identifying and reporting on patterns found in ECMAScript/JavaScript code. It extends configurations from popular style guides like Airbnb, employs Prettier for code formatting, and has TypeScript-specific settings in place.

Features

  • Sets environment for browser, ES2021, Node.js and Jest.
  • Consists of configurations from 'airbnb', 'airbnb-typescript', 'airbnb/hooks', 'prettier', etc.
  • Sets up TypeScript's parser and parser options.
  • Includes 'react' in the list of plugins.
  • Sets certain ESLint and TypeScript rules.

Usage

First, install this config as dev dependency:

npm install @economic/eslint-config -D

and this ESLint configuration:

module.exports = {
    extends: ['@economic'],
    parserOptions: {
        project: './tsconfig.json',
    },
    // your overrides here
};

Overriding Rules

You can always override these rules or add your own in your own .eslintrc.js file. Here's an example of how that might look:

module.exports = {
    extends: ['@economic'],
    rules: {
        'no-console': 'warn',
        'react/prop-types': 'off',
    },
};

Caveats

This configuration is set up for use with TypeScript. If you don't use TypeScript, you will have to alter your configuration accordingly. Remember: these are just rules that aim to increase code quality and readability. They are not hard and fast rules. Adjust the configuration to your project's requirements and your team's preferences.

Readme

Keywords

none

Package Sidebar

Install

npm i @economic/eslint-config

Weekly Downloads

280

Version

1.2.2

License

ISC

Unpacked Size

15.8 kB

Total Files

5

Last publish

Collaborators

  • peter.kasarda.visma
  • matthew.daly
  • e-conomic-devops
  • claudiuhojdavisma