Skip to content

Raynos/eslint-config-perf-standard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eslint-config-perf-standard

A set of eslint rules for performant JS

Example

Works with eslint@1.8.0

Use like so:

// .eslintrc
{
    "extends": "perf-standard",
    "rules": {
        "max-len": [0]
    }
}

Also configure your package.json like so:

{
    "scripts": {
        "lint": "eslint $(git ls-files | grep '.js$')"
    }
}

Rules explanation

There are a lot of rules in this project; I will explain a few of them here for the ones that are non-trivial

no-restricted-modules

There are a few modules that are banned and there are alternatives available.

  • lodash, underscore. These modules come with a few downsides. Namely that they are not performant and that they add many stacks to your stacktrace and flamegraphs. Favor plain loops, do not use map() and friends.
  • async. Async is a kitchen sink and not performant. Favor a library that discourages allocation of closures like https://github.com/Raynos/fanout-task

Installation

npm install eslint-config-perf-standard

Tests

npm test

Contributors

  • Raynos

MIT Licensed

About

A set of eslint rules for performant JS

Resources

License

Stars

Watchers

Forks

Packages

No packages published