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

eslint-config-valorsoft

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-config-valorsoft

Valor Software's ESLint config, following our styleguide

  • 0.0.13
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
decreased by-28.57%
Maintainers
1
Weekly downloads
 
Created
Source

Welcome to the most strict eslint config ever

npm version npm downloads Build Status Dependency Status devDependency Status

Philosophy

  • contains all rules
  • almost all rules enabled
  • this config is highly opinionated

Where to use

  • anywhere
  • for tests better to add env:"node" and disable newline-per-chained-call rule

How to use

  • install latest npm
    $(sudo) npm install -g npm@latest
    
  • add task eslint to package.json script section
    "eslint": "./node_modules/.bin/eslint --ignore-path .gitignore  --ext js --fix . .config",
    
  • add linting to tests step scripts package.json section
    "test": "npm run eslint && ..."
    
  • create .eslintrc.json near to you package.json with the following content
    {
      "extends": "./node_modules/eslint-config-valorsoft/.eslintrc.json",
      "env": {
        "node": true
      }
    }
    
  • run npm t to check that all is working correctly

What is disabled

  • no-eq-null - duplicates eqeqeq:smart
  • no-restricted-imports, no-restricted-modules, no-restricted-globals - dependant on project requirements
  • id-match - not found any particular use of this rule, camelCase is enough
  • jsx-quotes - I don't use jsx so I don't care
  • no-plusplus - why not ++? It's nice to use when you know what you are doing
  • no-restricted-syntax - duplicates no-with and disabled functional expressions
  • no-ternary - why not? but not nested ternary please
  • require-jsdoc- nice thing, but hard to follow
  • spaced-comment - nice for meaningful comments, bad for quick code commenting
  • wrap-regex - no need
  • prefer-reflect - compatibility is to low to use
  • newline-before-return - TBD

What is tweaked

  • indent - 2 spaces rulezzz!
  • max-len - extended to 120 chars
  • newline-per-chained-call - extended ignoreChainWithDepth to 3
  • eqeqeq - smart mode enabled
  • dot-location - property mode enabled
  • no-implicit-coercion - boolean implicit coercion enabled
  • func-style - declaration only please
  • no-use-before-define - usage of function before declarations are allowed
  • no-mixed-requires- grouping and allowCall checks enabled
  • linebreak-style - unix only
  • one-var - never use one var|let|const per block
  • padded-blocks - never add useless padding
  • quote-props - quote properties only as-needed and keywords
  • no-magic-numbers - ignore -1,0,1 as most often used numbers and ignoreArrayIndexes, enforceConst are enabled

Contribution

  • what I really appreciate is configs for IDEs
  • to change any rule you should have strong arguments and not only opinion

Keywords

FAQs

Package last updated on 17 May 2016

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