Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@fp51/eslint-config

Package Overview
Dependencies
Maintainers
4
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fp51/eslint-config

fp51 javascript eslint rules, based on airbnb

  • 1.0.1-canary-5a8ca8e-1614542817931
  • Source
  • npm
  • Socket score

Version published
Maintainers
4
Created
Source

@fp51/eslint-config

Opiniated eslint config based on airbnb config and prettier.

Install

Add this dependency to your repository with its peer-dependency:

npm add --save-dev @fp51/eslint-config eslint

Usage

Create a .eslintrc file in your project root with this content

{
  "extends": [
    "@fp51/eslint-config",
    // or
    "@fp51/eslint-config/<special-config>"
  ]
}

Which config ?

The package provide multiple configs whether you need simple javascript linting of full typescript + javascript + react linting with type-aware rules.

The details are here:

configjavascriptreacttypescriptwith types
@fp51/eslint-config/javascript✔️
@fp51/eslint-config/javascript-react✔️✔️
@fp51/eslint-config/light-typescript✔️✔️
@fp51/eslint-config/light-typescript-react✔️✔️✔️
@fp51/eslint-config/typescript✔️✔️✔️
@fp51/eslint-config/typescript-react✔️✔️✔️✔️

The @fp51/eslint-config links to @fp51/eslint-config/typescript-react.

Note that all configs can be used on JSON files too.

Typescript

You will need to install a peer-dependency @typescript-eslint/parser as it is required by eslint-plugin-import internally.

We lint typescript files with @typescript-eslint/eslint-plugin that provide rules that replace default eslint ones.

Some of these rules are type-aware and use tsc under the hood to compile each file before lint.

As this can drastically affect performance for big code base, we provide light-typescript configs that do not use type-aware rules.

If you decide to give @fp51/eslint-config/typescript or @fp51/eslint-config/typescript-react a try, you will need a tsconfig.json file at the root of your project for type-aware rules to work.

Because we also lint JSON files, you need to include them like so:

  "include": [
    "**/*",
    "**/*.json"
  ],
  "exclude": ["node_modules"]

It's probably better for you to define one special .eslint.tsconfig.json like so:

{
  "extends": "./tsconfig.json",
  "compilerOptions": {
    "noEmit": true
  },
  "include": [
    "**/*",
    "**/*.json"
  ]
}

Then, in you .eslintrc

  "parserOptions": {
    "project": "./.eslint.tsconfig.json"
  }

Special eslint patch

The lib also provide a workaround for https://github.com/eslint/eslint/issues/3458

When needed, start by requiring the patch in your config entry point.

require('@fp51/eslint-config/patch');

module.exports = {
  extends: [
    'eslint-config-airbnb-base',
    ...

Keywords

FAQs

Package last updated on 28 Feb 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc