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

eslint-config-neo

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-config-neo

Official Neo Financial ESLint configuration

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.8K
decreased by-11.89%
Maintainers
1
Weekly downloads
 
Created
Source

eslint-config-neo

Official Neo Financial ESLint configuration

Installation

Install Package

yarn add --dev eslint-config-neo

You can also install a specific version of the package by appending the version tag. For example, to install version 1.0.0

yarn add --dev eslint-config-neo@1.0.0

Install Peer Dependencies

yarn add --dev eslint lint-staged husky typescript
yarn add --dev --exact prettier@1.16.4

It is recommended that you install an exact version of Prettier as they may introduce formatting changes in minor versions.

Make ESLint Config File

Add .eslintrc to project root

{
  "extends": "eslint-config-neo/config-backend"
}

Use eslint-config-neo/config-frontend for frontend projects

Make Prettier Config File

Add .prettierrc to project root

{
  "printWidth": 100,
  "singleQuote": true
}

Optional: If there are any files you want to exclude from Prettier add .prettierignore to project root

Make Editorconfig File

Add .editorconfig to project root

# http://editorconfig.org
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
max_line_length = 120

[*.md]
max_line_length = 0
trim_trailing_whitespace = false

[COMMIT_EDITMSG]
max_line_length = 0

Add Engines

Add the engines field to package.json

"engines": {
  "node": ">=10.0.0"
}

Add Scripts

Add scripts for linting and formatting to package.json

"scripts": {
  "precommit": "lint-staged",
  "lint": "eslint .",
  "format": "prettier --write \"**/*.{ts,tsx,js,json,graphql,md}\"",
  "format:check": "prettier --debug-check \"**/*.{ts,tsx,js,json,graphql,md}\""
}

Add Precommit Hook

Add a precommit hook to package.json to automatically lint and format any files staged for commit

"lint-staged": {
  "concurrent": false,
  "linters": {
    "*.{ts,tsx,js}": [
      "eslint --quiet",
      "git add"
    ],
    "*.{ts,tsx,js,json,graphql,md}": [
      "prettier --write",
      "git add"
    ]
  }
}

Format Code

If you've added Prettier to an existing project you will want to format all the code. The precommit hook only updates files that have been changed and staged for commit. To format the entire codebase run

yarn format

FAQ

Should I override the rule X? I don't like it.

No. If you want to do this, you have to ask the team. If a rule really doesn't make sense then we should remove or disable it.

Can I disable the rule on one line in my code, I have a good reason.

Yes. That's ok. Use a single-line disable.

FAQs

Package last updated on 22 Apr 2019

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