Socket
Socket
Sign inDemoInstall

@corva/eslint-config-node

Package Overview
Dependencies
Maintainers
14
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@corva/eslint-config-node

Defines global linting rules for Corva.AI node.js projects


Version published
Maintainers
14
Created
Source

@corva/eslint-config-node

Defines global linting rules for Corva.AI Node.js projects.

Usage

Setup

Generic

npm install husky standard-version -D
npm pkg set scripts.prepare="husky install"
npm pkg set scripts.release="git add -A && standard-version -a"
npm pkg set scripts.release-rc="git add -A && standard-version -a --prerelease rc --skip.changelog"
npm run prepare

Codestyle

# Install
npm i -D @corva/eslint-config-node
# OR
yarn add -D @corva/eslint-config-node

# Add eslint config
echo "module.exports = {'extends': '@corva/eslint-config-node'};" > .eslintrc.js

# Add prettier config
echo "\"@corva/eslint-config-node/prettier\"" > .prettierrc

or add a .eslintrc.js file in the root of your project and extended it with the default config:

module.exports = {
  extends: '@corva/eslint-config-node',
};

and .prettierrc:

"@corva/eslint-config-node/prettier"

Commitlint

Add dependencies:

npm i -D @commitlint/cli @commitlint/config-conventional

Add config:

echo "module.exports = {extends: ['@commitlint/config-conventional']};" > .commitlintrc.js

For husky <=v4 add following in your package.json:

{
  "husky": {
    "hooks": {
      "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
    }
  }
}

For husky >= v5:

npx husky add .husky/commit-msg  'npx --no -- commitlint --edit ${1}'

lint-staged

Add dependencies:

npm i -D lint-staged

Add config to package.json:

{
  "scripts": {
    "lint": "eslint .",
    "lint:fix": "eslint . --fix"
  },
  "lint-staged": {
    "*.{js,ts}": "npm run lint:fix"
  }
}

For husky <=v4 add following in your package.json:

{
  "husky": {
    "hooks": {
      "pre-commit": "npx lint-staged"
    }
  }
}

For husky >= v5:

npx husky add .husky/pre-commit  'npx lint-staged'

Keywords

FAQs

Package last updated on 07 Dec 2023

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