@voxpelli/eslint-config

My personal ESLint config. Based on semistandard

Usage no npm install needed!

<script type="module">
  import voxpelliEslintConfig from 'https://cdn.skypack.dev/@voxpelli/eslint-config';
</script>

README

@voxpelli/eslint-config

js-semistandard-style

My personal ESLint config which extends standard / semistandard with a couple of extra checks that I find helpful in my projects.

Includes the semistandard rules directly rather than relying on eslint-config-semistandard, as that package isn't always trailing the main eslint-config-standard package.

This package follows semantic versioning. Tightening of any checks is a breaking change, therefore that will only happen in major releases. Minor and patch releases will only include relaxation of rules or fixing of minor obvious oversights.

Can I use this in my own project?

Absolutely, go ahead! I maintain this project as if multiple people are using it. Be sure to give me feedback and if you like it, give me a ping and say so, would make my day 😄

Installation

Be sure to install versions of peer dependencies that are valid according to the peer dependency specification of this module.

As ESLint configs and dependencies can and will change their rules with major releases you will likely get an incorrect ruleset otherwise.

To easily install all correct peer dependencies, you can use install-peerdeps:

install-peerdeps --dev @voxpelli/eslint-config

Then add a .eslintrc with the following:

{
  "extends": "@voxpelli",
  "root": true
}

How does this differ from pure standard?

  • :stop_sign: = changed to error level
  • :warning: = changed to warn level
  • :mute: = deactivated
  • :wrench: = changed config
  • :grimacing: = will not pass vanilla standard linting

:wrench: Changed standard rules

  • :wrench::warning::grimacing: comma-dangle – changed – ignore it in everything but functions + is it set to warn rather than error. Reason: I'm moving towards preferring dangling commas and thus want my shared config to not prohibit them while a project-by-project override can actually require them (Incompatible with standard)
  • :mute: dot-notation – deactivated – clashes with the noPropertyAccessFromIndexSignature check in TypeScript, which I use
  • :wrench::grimacing: no-multi-spaces – changed – sets ignoreEOLComments to true, can be useful for more readable comments across multiple lines and I see no real downsides to it (Incompatible with standard)
  • :wrench: no-unused-vars – changed – sets "args": "all", "argsIgnorePattern": "^_", because I personally don't feel limited by Express error handlers + wants to stay in sync with TypeScript noUnusedParameters
  • :wrench::grimacing: semi and no-extra-semi – changed – adopts the semicolons setup from semistandard (Incompatible with plain standard, compatible with semistandard)
  • :wrench::warning: n/no-deprecated-api – changed – changed to warn instead of error as often it's not an urgent thing to fix

:heavy_plus_sign: Added ESLint core rules

  • :warning: func-style – disallows function declarations, good to be consistent with how functions are declared
  • :warning: no-console – warns on existence of console.log and similar, as they are mostly used for debugging and should not be committed
  • :stop_sign: no-nonoctal-decimal-escape – there's no reason not to ban it
  • :stop_sign: no-unsafe-optional-chaining – enforces one to be careful with .? and not use it in ways that can inadvertently cause errors or NaN results
  • :warning: no-warning-comments – warns of the existence of FIXME comments, as they should always be fixed before pushing
  • :stop_sign: object-shorthand – requires the use of object shorthands for properties, more tidy
  • :stop_sign: quote-props – requires properties to be quoted when needed but otherwise disallows it

:package: Added ESLint rule package

:wrench: Overrides of added ESLint rule packages

:heavy_plus_sign: Additional standalone ESLint rules

Alternatives

See also