Nuestro grupo especializado luego de varios días de trabajo y de juntar de información, han obtenido la solución, nuestro deseo es que te resulte útil para tu plan.
Solución:
Como lo menciona @Gyandeep, no: http://eslint.org/docs/user-guide/configuring.html#configuring-rules
Escribí un guión para que te resulte un poco menos doloroso:
#!/bin/sh
list=$(curl -silent http://eslint.org/docs/rules/ | grep '(recommended)' | sed -e 's,.*([^<]*).*,1,g' | grep -v 'configuration documentation')
for rule in $list; do
echo "$rule": 1,
done;
Eso resultará en:
"comma-dangle": 1,
"no-cond-assign": 1,
"no-console": 1,
"no-constant-condition": 1,
"no-control-regex": 1,
"no-debugger": 1,
"no-dupe-args": 1,
"no-dupe-keys": 1,
"no-duplicate-case": 1,
"no-empty-character-class": 1,
"no-empty": 1,
"no-ex-assign": 1,
"no-extra-boolean-cast": 1,
"no-extra-semi": 1,
"no-func-assign": 1,
"no-inner-declarations": 1,
"no-invalid-regexp": 1,
"no-irregular-whitespace": 1,
"no-negated-in-lhs": 1,
"no-obj-calls": 1,
"no-regex-spaces": 1,
"no-sparse-arrays": 1,
"no-unreachable": 1,
"use-isnan": 1,
"valid-typeof": 1,
"no-fallthrough": 1,
"no-octal": 1,
"no-redeclare": 1,
"no-delete-var": 1,
"no-undef": 1,
"no-unused-vars": 1,
"no-mixed-spaces-and-tabs": 1,
Si miras aquí: http://eslint.org/docs/rules/ notarás las reglas incluidas por eslint:recommended
son seguidos por (recommended)
. El script tira del sitio web, geps las líneas con (recommended)
luego usa sed
para hacer algo de magia de expresiones regulares que extraiga la regla de las etiquetas de anclaje.
No olvides sacar el último ,
– Tengo que dejarte algo para que hagas;) – e inserta esto en tu .eslintrc
archivo entre:
"rules":
...output of script goes here...
Si no está familiarizado con los scripts de bash, no olvide hacerlo ejecutable … ¡aún más fácil, simplemente copie el resultado que pegué arriba! 🙂
Espero que esto ayude.
Sé que llego tarde a la fiesta, pero como la respuesta aceptada expiró debido a cambios en la estructura del eslint
sitio web, he creado una nueva lista con todas las reglas configuradas para warn
//React ESLint
"react/boolean-prop-naming": "warn",
"react/button-has-type": "warn",
"react/default-props-match-prop-types": "warn",
"react/destructuring-assignment": "warn",
"react/display-name": "warn",
"react/forbid-component-props": "warn",
"react/forbid-dom-props": "warn",
"react/forbid-elements": "warn",
"react/forbid-prop-types": "warn",
"react/forbid-foreign-prop-types": "warn",
"react/no-access-state-in-setstate": "warn",
"react/no-array-index-key": "warn",
"react/no-children-prop": "warn",
"react/no-danger": "warn",
"react/no-danger-with-children": "warn",
"react/no-deprecated": "warn",
"react/no-did-mount-set-state": "warn",
"react/no-did-update-set-state": "warn",
"react/no-direct-mutation-state": "warn",
"react/no-find-dom-node": "warn",
"react/no-is-mounted": "warn",
"react/no-multi-comp": "warn",
"react/no-redundant-should-component-update": "warn",
"react/no-render-return-value": "warn",
"react/no-set-state": "warn",
"react/no-typos": "warn",
"react/no-string-refs": "warn",
"react/no-this-in-sfc": "warn",
"react/no-unescaped-entities": "warn",
"react/no-unknown-property": "warn",
"react/no-unused-prop-types": "warn",
"react/no-unused-state": "warn",
"react/no-will-update-set-state": "warn",
"react/prefer-es6-class": "warn",
"react/prop-types": "warn",
"react/react-in-jsx-scope": "warn",
"react/require-default-props": "warn",
"react/require-optimization": "warn",
"react/require-render-return": "warn",
"react/self-closing-comp": "warn",
"react/sort-comp": "warn",
"react/sort-prop-types": "warn",
"react/style-prop-object": "warn",
"react/void-dom-elements-no-children": "warn",
"react/jsx-boolean-value": "warn",
"react/jsx-child-element-spacing": "warn",
"react/jsx-closing-bracket-location": "warn",
"react/jsx-closing-tag-location": "warn",
"react/jsx-curly-spacing": "warn",
"react/jsx-equals-spacing": "warn",
"react/jsx-first-prop-new-line": "warn",
"react/jsx-handler-names": "warn",
"react/jsx-indent": "warn",
"react/jsx-indent-props": "warn",
"react/jsx-key": "warn",
"react/jsx-max-depth": "warn",
"react/jsx-max-props-per-line": "warn",
"react/jsx-no-bind": "warn",
"react/jsx-no-comment-textnodes": "warn",
"react/jsx-no-duplicate-props": "warn",
"react/jsx-no-literals": "warn",
"react/jsx-no-target-blank": "warn",
"react/jsx-no-undef": "warn",
"react/jsx-one-expression-per-line": "warn",
"react/jsx-curly-brace-presence": "warn",
"react/jsx-pascal-case": "warn",
"react/jsx-props-no-multi-spaces": "warn",
"react/jsx-sort-default-props": "warn",
"react/jsx-sort-props": "warn",
"react/jsx-space-before-closing": "warn",
"react/jsx-tag-spacing": "warn",
"react/jsx-uses-react": "warn",
"react/jsx-uses-vars": "warn",
"react/jsx-wrap-multilines": "warn",
// Default ESLint
"for-direction": "warn",
"getter-return": "warn",
"no-await-in-loop": "warn",
"no-compare-neg-zero": "warn",
"no-cond-assign": "warn",
"no-console": "warn",
"no-constant-condition": "warn",
"no-control-regex": "warn",
"no-debugger": "warn",
"no-dupe-args": "warn",
"no-dupe-keys": "warn",
"no-duplicate-case": "warn",
"no-empty": "warn",
"no-empty-character-class": "warn",
"no-ex-assign": "warn",
"no-extra-boolean-cast": "warn",
"no-extra-parens": "warn",
"no-extra-semi": "warn",
"no-func-assign": "warn",
"no-inner-declarations": "warn",
"no-invalid-regexp": "warn",
"no-irregular-whitespace": "warn",
"no-obj-calls": "warn",
"no-prototype-builtins": "warn",
"no-regex-spaces": "warn",
"no-sparse-arrays": "warn",
"no-template-curly-in-string": "warn",
"no-unexpected-multiline": "warn",
"no-unreachable": "warn",
"no-unsafe-finally": "warn",
"no-unsafe-negation": "warn",
"use-isnan": "warn",
"valid-jsdoc": "warn",
"valid-typeof": "warn",
"accessor-pairs": "warn",
"array-callback-return": "warn",
"block-scoped-var": "warn",
"class-methods-use-this": "warn",
"complexity": "warn",
"consistent-return": "warn",
"curly": "warn",
"default-case": "warn",
"dot-location": "warn",
"dot-notation": "warn",
"eqeqeq": "warn",
"guard-for-in": "warn",
"max-classes-per-file": "warn",
"no-alert": "warn",
"no-caller": "warn",
"no-case-declarations": "warn",
"no-div-regex": "warn",
"no-else-return": "warn",
"no-empty-function": "warn",
"no-empty-pattern": "warn",
"no-eq-null": "warn",
"no-eval": "warn",
"no-extend-native": "warn",
"no-extra-bind": "warn",
"no-extra-label": "warn",
"no-fallthrough": "warn",
"no-floating-decimal": "warn",
"no-global-assign": "warn",
"no-implicit-coercion": "warn",
"no-implicit-globals": "warn",
"no-implied-eval": "warn",
"no-invalid-this": "warn",
"no-iterator": "warn",
"no-labels": "warn",
"no-lone-blocks": "warn",
"no-loop-func": "warn",
"no-magic-numbers": "warn",
"no-multi-spaces": "warn",
"no-multi-str": "warn",
"no-new": "warn",
"no-new-func": "warn",
"no-new-wrappers": "warn",
"no-octal": "warn",
"no-octal-escape": "warn",
"no-param-reassign": "warn",
"no-proto": "warn",
"no-redeclare": "warn",
"no-restricted-properties": "warn",
"no-return-assign": "warn",
"no-return-await": "warn",
"no-script-url": "warn",
"no-self-assign": "warn",
"no-self-compare": "warn",
"no-sequences": "warn",
"no-throw-literal": "warn",
"no-unmodified-loop-condition": "warn",
"no-unused-expressions": "warn",
"no-unused-labels": "warn",
"no-useless-call": "warn",
"no-useless-concat": "warn",
"no-useless-escape": "warn",
"no-useless-return": "warn",
"no-void": "warn",
"no-warning-comments": "warn",
"no-with": "warn",
"prefer-promise-reject-errors": "warn",
"radix": "warn",
"require-await": "warn",
"vars-on-top": "warn",
"wrap-iife": "warn",
"yoda": "warn",
"strict": "warn",
"init-declarations": "warn",
"no-catch-shadow": "warn",
"no-delete-var": "warn",
"no-label-var": "warn",
"no-restricted-globals": "warn",
"no-shadow": "warn",
"no-shadow-restricted-names": "warn",
"no-undef": "warn",
"no-undef-init": "warn",
"no-undefined": "warn",
"no-unused-vars": "warn",
"no-use-before-define": "warn",
"callback-return": "warn",
"global-require": "warn",
"handle-callback-err": "warn",
"no-buffer-constructor": "warn",
"no-mixed-requires": "warn",
"no-new-require": "warn",
"no-path-concat": "warn",
"no-process-env": "warn",
"no-process-exit": "warn",
"no-restricted-modules": "warn",
"no-sync": "warn",
"array-bracket-newline": "warn",
"array-bracket-spacing": "warn",
"array-element-newline": "warn",
"block-spacing": "warn",
"brace-style": "warn",
"camelcase": "warn",
"capitalized-comments": "warn",
"comma-dangle": "warn",
"comma-spacing": "warn",
"comma-style": "warn",
"computed-property-spacing": "warn",
"consistent-this": "warn",
"eol-last": "warn",
"func-call-spacing": "warn",
"func-name-matching": "warn",
"func-names": "warn",
"func-style": "warn",
"function-paren-newline": "warn",
"id-blacklist": "warn",
"id-length": "warn",
"id-match": "warn",
"implicit-arrow-linebreak": "warn",
"indent": "warn",
"jsx-quotes": "warn",
"key-spacing": "warn",
"keyword-spacing": "warn",
"line-comment-position": "warn",
"linebreak-style": "warn",
"lines-around-comment": "warn",
"lines-between-class-members": "warn",
"max-depth": "warn",
"max-len": "warn",
"max-lines": "warn",
"max-nested-callbacks": "warn",
"max-params": "warn",
"max-statements": "warn",
"max-statements-per-line": "warn",
"multiline-comment-style": "warn",
"multiline-ternary": "warn",
"new-cap": "warn",
"new-parens": "warn",
"newline-per-chained-call": "warn",
"no-array-constructor": "warn",
"no-bitwise": "warn",
"no-continue": "warn",
"no-inline-comments": "off",
"no-lonely-if": "warn",
"no-mixed-operators": "warn",
"no-mixed-spaces-and-tabs": "warn",
"no-multi-assign": "warn",
"no-multiple-empty-lines": "warn",
"no-negated-condition": "warn",
"no-nested-ternary": "warn",
"no-new-object": "warn",
"no-plusplus": "warn",
"no-restricted-syntax": "warn",
"no-tabs": "warn",
"no-ternary": "warn",
"no-trailing-spaces": "warn",
"no-underscore-dangle": "warn",
"no-unneeded-ternary": "warn",
"no-whitespace-before-property": "warn",
"nonblock-statement-body-position": "warn",
"object-curly-newline": "warn",
"object-curly-spacing": "warn",
"object-property-newline": "warn",
"one-var": "warn",
"one-var-declaration-per-line": "warn",
"operator-assignment": "warn",
"operator-linebreak": "warn",
"padded-blocks": "warn",
"padding-line-between-statements": "warn",
"prefer-object-spread": "warn",
"quote-props": "warn",
"quotes": "warn",
"require-jsdoc": "warn",
"semi": "warn",
"semi-spacing": "warn",
"semi-style": "warn",
"sort-keys": "warn",
"sort-vars": "warn",
"space-before-blocks": "warn",
"space-before-function-paren": "warn",
"space-in-parens": "warn",
"space-infix-ops": "warn",
"space-unary-ops": "warn",
"spaced-comment": "warn",
"switch-colon-spacing": "warn",
"template-tag-spacing": "warn",
"unicode-bom": "warn",
"wrap-regex": "warn",
"arrow-body-style": "warn",
"arrow-parens": "warn",
"arrow-spacing": "warn",
"constructor-super": "warn",
"generator-star-spacing": "warn",
"no-class-assign": "warn",
"no-confusing-arrow": "warn",
"no-const-assign": "warn",
"no-dupe-class-members": "warn",
"no-duplicate-imports": "warn",
"no-new-symbol": "warn",
"no-restricted-imports": "warn",
"no-this-before-super": "warn",
"no-useless-computed-key": "warn",
"no-useless-constructor": "warn",
"no-useless-rename": "warn",
"no-var": "warn",
"object-shorthand": "warn",
"prefer-arrow-callback": "warn",
"prefer-const": "warn",
"prefer-destructuring": "warn",
"prefer-numeric-literals": "warn",
"prefer-rest-params": "warn",
"prefer-spread": "warn",
"prefer-template": "warn",
"require-yield": "warn",
"rest-spread-spacing": "warn",
"sort-imports": "warn",
"symbol-description": "warn",
"template-curly-spacing": "warn",
"yield-star-spacing": "warn"
Puede usar el complemento eslint eslint-plugin-only-warn si necesita cambiar todos los errores de ESLint por advertencias.
Si aún necesita algunas reglas para activar un error completo, puede probar esta bifurcación de only-warn, eslint-plugin-switch-error-warn (descargo de responsabilidad: soy el autor de la bifurcación). Cambia los errores a advertencias y viceversa, por lo que puede establecer reglas específicas para “advertir” para que provoquen errores nuevamente. Esto le dará la funcionalidad adicional para especificar excepciones, ¡aunque puede resultar bastante confuso!
También deberá establecer las reglas que de forma predeterminada advierten (como ‘sin consola’) en modo ‘error’ explícitamente, para que solo den advertencias con el complemento del conmutador.