Socket
Book a DemoInstallSign in
Socket

@dietlabs/eslint-config

Package Overview
Dependencies
Maintainers
3
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dietlabs/eslint-config

DietLabs’s shared EsLint config

1.2.2
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
3
Weekly downloads
 
Created
Source

DietLabs’s shared EsLint config

Setup

Install package with its’ peer dependencies

You will use the same command to upgrade to latest version.

npx install-peerdeps --dev @dietlabs/eslint-config@latest

Use the configuration

echo '{"extends": "@dietlabs"}' > .eslintrc.json

Add lint-js npm script and run it

npx add-npm-scripts lint-js "eslint --fixup --ext .js,.jsx ./" --warn
npm run lint-js

Lint while WebPackin’

npm install --save-dev eslint-loader

Then in webpack.config.js:

const lintingRules = require('eslint-config-dietlabs/webpack-rules');

module.exports = {
    rules: [
        // Your rules
    ].concat(lintingRules)
};

Lint while commitin’

You want something in the shape of:

#!/bin/bash

CODE=0
for FILE in $( git diff --cached --name-only --diff-filter=ACM HEAD -- '*.js' '*.jsx' )
do
    git show ":$FILE" \
        | ./node_modules/.bin/eslint --stdin --stdin-filename "$FILE" \
        || CODE=$?
done

return $CODE

Keywords

dietlabs

FAQs

Package last updated on 11 Dec 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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.