Socket
Book a DemoInstallSign in
Socket

eslint-config-fp

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-config-fp

ESLint configuration combining Standard JavaScript, Prettier and functional programming

latest
Source
npmnpm
Version
1.3.1
Version published
Maintainers
1
Created
Source

downloads last commit license npm node JavaScript Style Guide eslint-config-fp

ESLint is a code linter for JavaScript.

This configuration combines:

Install

npm install -D eslint-config-fp eslint@^5.6.0 eslint-config-prettier@^3.0.1 eslint-config-standard@^12.0.0 eslint-import-resolver-node@^0.3.2 eslint-plugin-eslint-comments@^3.0.1 eslint-plugin-filenames@^1.3.2 eslint-plugin-fp@^2.3.0 eslint-plugin-html@^5.0.0-alpha.0 eslint-plugin-import@^2.14.0 eslint-plugin-markdown@^1.0.0-beta.8 eslint-plugin-node@^7.0.1 eslint-plugin-promise@^4.0.1 eslint-plugin-standard@^4.0.0 eslint-plugin-unicorn@^6.0.1 eslint-plugin-you-dont-need-lodash-underscore@^6.4.0 prettier@^1.14.3

Then in your .eslintrc.json:

{
  "extends": "eslint-config-fp"
}

The configuration is very opinionated but you can override specific rules in your .eslintrc.json to fit your needs and coding style.

Then create a symlink to the Prettier configuration and .editorconfig in your project:

ln -sf node_modules/eslint-config-fp/.prettierrc.yml node_modules/eslint-config-fp/.editorconfig .

Badge

The following badge can be added to your project: eslint-config-fp

[![eslint-config-fp](https://img.shields.io/badge/eslint-config--fp-green.svg?logo=eslint)](https://github.com/autoquality/eslint-config-fp)

Prettier

prettier must be run before eslint to avoid conflicts.

We recommend using first prettier --write then eslint --fix --cache.

Do not forget to add .eslintcache to your .gitignore file.

Functional programming

This enforces that state is never directly mutated and global state is not referenced:

However throwing exceptions are allowed as this can simplify code.

Modularity

The following rules are enforced to encourage splitting your code into small modules and functions:

Modern JavaScript

Strictness

The configuration is very explicit and enforces strict linting. This should help you find bugs and maintain a consistent coding style.

This includes:

Other styling rules

HTML and Markdown

eslint-plugin-html and eslint-plugin-markdown are included so you can lint JavaScript inside HTML or Markdown files.

Projects using this configuration

  • autoserver: create a full-featured REST/GraphQL API from a configuration file

Feel free to submit an issue or PR to add your project to the list above!

Keywords

eslint

FAQs

Package last updated on 30 Sep 2018

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