🎩

eslint-config-* の比較表

2021/05/07に公開

以下の4つの config の比較表です。

フレームワークを依らないルールについて比較したいので eslint-config-airbnb から React 関係の plugin を除外した eslint-config-airbnb-base を使用します。

バージョン情報

使用する各パッケージのバージョンは下記の通りです。

  • eslint: 7.25.0
  • eslint-config-standard: 16.0.2
  • eslint-config-airbnb-base: 14.2.1
  • eslint-config-google: 0.14.0
  • eslint-plugin-import: 2.22.1
  • eslint-plugin-node: 11.1.0
  • eslint-plugin-promise: 4.3.1

Possible Errors

Rule eslint:recommended standard airbnb-base google
for-direction error error
getter-return error error
no-async-promise-executor error error error
no-await-in-loop error
no-compare-neg-zero error error error
no-cond-assign error error error off
no-console warn
no-constant-condition error error warn
no-control-regex error error error
no-debugger error error error
no-dupe-args error error error
no-dupe-else-if error off
no-dupe-keys error error error
no-duplicate-case error error error
no-empty error error error
no-empty-character-class error error error
no-ex-assign error error error
no-extra-boolean-cast error error error
no-extra-parens error off
no-extra-semi error error
no-func-assign error error error
no-import-assign error error off
no-inner-declarations error error
no-invalid-regexp error error error
no-irregular-whitespace error error error error
no-loss-of-precision error off
no-misleading-character-class error error error
no-obj-calls error error error
no-promise-executor-return off
no-prototype-builtins error error error
no-regex-spaces error error error
no-setter-return error off
no-sparse-arrays error error error
no-template-curly-in-string error error
no-unexpected-multiline error error error error
no-unreachable error error error
no-unreachable-loop error off
no-unsafe-finally error error error
no-unsafe-negation error error error
no-unsafe-optional-chaining
no-useless-backreference error off
require-atomic-updates off
use-isnan error error error
valid-typeof error error error

Best Practices

Rule eslint:recommended standard airbnb-base google
accessor-pairs error off
array-callback-return error error
block-scoped-var error
class-methods-use-this error
complexity off
consistent-return error
curly error error error
default-case error
default-case-last error off
default-param-last off
dot-location error error
dot-notation error error
eqeqeq error error
grouped-accessor-pairs off
guard-for-in error error
max-classes-per-file error
no-alert warn
no-caller error error error
no-case-declarations error error error
no-constructor-return off
no-div-regex off
no-else-return error
no-empty-function error
no-empty-pattern error error error
no-eq-null off
no-eval error error
no-extend-native error error error
no-extra-bind error error error
no-extra-label error
no-fallthrough error error error
no-floating-decimal error error
no-global-assign error error error
no-implicit-coercion off
no-implicit-globals off
no-implied-eval error error
no-invalid-this off error
no-iterator error error
no-labels error error
no-lone-blocks error error
no-loop-func error
no-magic-numbers off
no-multi-spaces error error error
no-multi-str error error error
no-new error error
no-new-func error error
no-new-wrappers error error error
no-nonoctal-decimal-escape
no-octal error error error
no-octal-escape error error
no-param-reassign error
no-proto error error
no-redeclare error error error
no-restricted-properties error
no-return-assign error error
no-return-await error
no-script-url error
no-self-assign error error error
no-self-compare error error
no-sequences error error
no-throw-literal error error error
no-unmodified-loop-condition error off
no-unused-expressions error error
no-unused-labels error error
no-useless-call error off
no-useless-catch error error error
no-useless-concat error
no-useless-escape error error error
no-useless-return error error
no-void error error
no-warning-comments off
no-with error error error error
prefer-named-capture-group off
prefer-promise-reject-errors error error error
prefer-regex-literals error off
radix error
require-await off
require-unicode-regexp off
vars-on-top error
wrap-iife error error
yoda error error

Strict Mode

Rule eslint:recommended standard airbnb-base google
strict error

Variables

Rule eslint:recommended standard airbnb-base google
init-declarations off
no-delete-var error error error
no-label-var error
no-restricted-globals error
no-shadow error
no-shadow-restricted-names error error error
no-undef error error error
no-undef-init error error
no-undefined off
no-unused-vars error error error error
no-use-before-define error error

Stylistic Issues

Rule eslint:recommended standard airbnb-base google
array-bracket-newline off off
array-bracket-spacing error error error
array-element-newline off off
block-spacing error error error
brace-style error error error
camelcase error error error
capitalized-comments off
comma-dangle error error error
comma-spacing error error error
comma-style error error error
computed-property-spacing error error error
consistent-this off
eol-last error error error
func-call-spacing error error error
func-name-matching off
func-names warn
func-style off
function-call-argument-newline off
function-paren-newline error
id-denylist off
id-length off
id-match off
implicit-arrow-linebreak error
indent error error error
jsx-quotes off
key-spacing error error error
keyword-spacing error error error
line-comment-position off
linebreak-style error error
lines-around-comment off
lines-between-class-members error error
max-depth off
max-len error error
max-lines off
max-lines-per-function off
max-nested-callbacks off
max-params off
max-statements off
max-statements-per-line off
multiline-comment-style off
multiline-ternary error off
new-cap error error error
new-parens error error
newline-per-chained-call error
no-array-constructor error error error
no-bitwise error
no-continue error
no-inline-comments off
no-lonely-if error
no-mixed-operators error error
no-mixed-spaces-and-tabs error error error error
no-multi-assign error
no-multiple-empty-lines error error error
no-negated-condition off
no-nested-ternary error
no-new-object error error error
no-plusplus error
no-restricted-syntax error
no-tabs error error error
no-ternary off
no-trailing-spaces error error error
no-underscore-dangle error
no-unneeded-ternary error error
no-whitespace-before-property error error
nonblock-statement-body-position error
object-curly-newline error error
object-curly-spacing error error error
object-property-newline error error
one-var error error error
one-var-declaration-per-line error
operator-assignment error
operator-linebreak error error error
padded-blocks error error error
padding-line-between-statements off
prefer-exponentiation-operator off
prefer-object-spread error
quote-props error error error
quotes error error error
semi error error error
semi-spacing error error error
semi-style error
sort-keys off
sort-vars off
space-before-blocks error error error
space-before-function-paren error error error
space-in-parens error error
space-infix-ops error error
space-unary-ops error error
spaced-comment error error error
switch-colon-spacing error error
template-tag-spacing error error
unicode-bom error error
wrap-regex off

ECMAScript 6

Rule eslint:recommended standard airbnb-base google
arrow-body-style error
arrow-parens error error
arrow-spacing error error
constructor-super error error error error
generator-star-spacing error error error
no-class-assign error error error
no-confusing-arrow error
no-const-assign error error error
no-dupe-class-members error error error
no-duplicate-imports off
no-new-symbol error error error error
no-restricted-exports off
no-restricted-imports off
no-this-before-super error error error error
no-useless-computed-key error error
no-useless-constructor error error
no-useless-rename error error
no-var warn error error
object-shorthand error
prefer-arrow-callback error
prefer-const error error error
prefer-destructuring error
prefer-numeric-literals error
prefer-rest-params error error
prefer-spread error error
prefer-template error
require-yield error error
rest-spread-spacing error error error
sort-imports off
symbol-description error error
template-curly-spacing error error
yield-star-spacing error error error

Discussion