0.6.3 • Published 2 years ago

eslint-config-node-opinionated v0.6.3

Weekly downloads
6
License
MIT
Repository
github
Last release
2 years ago

An opinionated ESLint configuration

License Version Build Status Known Vulnerabilities

Across multiple Node.js projects, I use the same linter

  • ESLint with node reccomended defaults
  • A few plugins (node, security, sonarjs and jest)
  • A very strict and opinionated rule set

I was tired to copy-paste config and deps across projects, so I created a shareable eslint config for myself. Eventually could be interesting for somebody else as well.

Basic usage

Install all the dependencies:

yarn add -D eslint eslint-config-node-opinionated eslint-plugin-node eslint-plugin-security eslint-plugin-sonarjs

A one-liner eslint config file is all you need now:

echo "extends: ['node-opinionated']" > .eslintrc.yml

or create your own .eslintrc.js like this:

module.exports = {
  extends: [
    'node-opinionated',
  ],
}

In combo with Jest

I often use ESLint in combination with Jest, with some specific overrides for the tests folder:

module.exports = {
  extends: [
    'node-opinionated',
    'plugin:jest/recommended'
  ],
  plugins: ['jest'],
  overrides: [
    {
      files: ['**/*test*/**'],
      rules: {
        'node/no-unpublished-require': 'off',
        'node/no-unpublished-import': 'off',
        'max-nested-callbacks': ['warn', 3],
        'security/detect-child-process': 'off',
        'security/detect-non-literal-fs-filename': 'off',
      }
    },
  ]
}
0.6.3

2 years ago

0.6.2

2 years ago

0.6.1

2 years ago

0.6.0

2 years ago

0.5.1

2 years ago

0.5.0

3 years ago

0.4.0

4 years ago

0.3.0

4 years ago

0.2.6

5 years ago

0.2.5

5 years ago

0.2.4

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.0

5 years ago