mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-02-17 23:45:29 -05:00
chore: apply react eslint rules
This commit is contained in:
parent
f4e9d3208a
commit
523446f9f4
3 changed files with 102 additions and 6 deletions
65
.eslintrc
65
.eslintrc
|
@ -1,10 +1,11 @@
|
|||
{
|
||||
"plugins": [
|
||||
"react",
|
||||
"babel",
|
||||
"react",
|
||||
"flowtype",
|
||||
"jest",
|
||||
"verdaccio"
|
||||
"verdaccio",
|
||||
"jsx-a11y"
|
||||
],
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
|
@ -13,7 +14,8 @@
|
|||
"plugin:flowtype/recommended",
|
||||
"plugin:jest/recommended",
|
||||
"plugin:prettier/recommended",
|
||||
"plugin:verdaccio/recommended"
|
||||
"plugin:verdaccio/recommended",
|
||||
"plugin:jsx-a11y/recommended"
|
||||
],
|
||||
"settings": {
|
||||
"react": {
|
||||
|
@ -43,10 +45,63 @@
|
|||
"rules": {
|
||||
"babel/no-invalid-this": 1,
|
||||
"prettier/prettier": ["error", null, "@prettier"],
|
||||
"no-useless-escape": 2,
|
||||
"no-invalid-this": 0,
|
||||
"react/no-deprecated": 1,
|
||||
"react/jsx-no-target-blank": 1,
|
||||
"react/destructuring-assignment": ["error", "always"],
|
||||
"react/forbid-component-props": ["error", { "forbid": ["style"] }],
|
||||
"react/no-this-in-sfc": ["error"],
|
||||
"react/no-unsafe": ["error"],
|
||||
"react/sort-comp": ["error", {
|
||||
"order": [
|
||||
"static-methods",
|
||||
"lifecycle",
|
||||
"render",
|
||||
"everything-else",
|
||||
"/^on.+$/",
|
||||
"/^render.+$/"
|
||||
]
|
||||
}],
|
||||
"react/void-dom-elements-no-children": ["error"],
|
||||
"react/no-did-mount-set-state": ["error", "disallow-in-func"],
|
||||
"react/jsx-wrap-multilines": ["error",{
|
||||
"declaration": "parens",
|
||||
"assignment": "parens",
|
||||
"return": "parens",
|
||||
"arrow": "parens",
|
||||
"condition": "parens",
|
||||
"logical": "parens",
|
||||
"prop": "parens"
|
||||
}],
|
||||
"react/jsx-boolean-value": ["error", "always"],
|
||||
"react/jsx-closing-tag-location": ["error"],
|
||||
"react/jsx-curly-spacing": ["error", "always"],
|
||||
"react/jsx-equals-spacing": ["error", "never"],
|
||||
"react/jsx-first-prop-new-line": ["error", "multiline-multiprop"],
|
||||
"react/jsx-handler-names": ["error"],
|
||||
"react/jsx-indent": ["error", 2],
|
||||
"react/jsx-indent-props": ["error", 2],
|
||||
"react/jsx-key": ["error"],
|
||||
"react/jsx-max-depth": ["error", { "max": 2}],
|
||||
"react/jsx-max-props-per-line": ["error", {"maximum": 3, "when": "multiline" }],
|
||||
"react/jsx-no-bind": ["error"],
|
||||
"react/jsx-no-comment-textnodes": ["error"],
|
||||
"react/jsx-no-duplicate-props": ["error"],
|
||||
"react/jsx-no-literals": ["error"],
|
||||
"react/jsx-no-undef": ["error"],
|
||||
"react/jsx-one-expression-per-line": ["error", {"allow": "literal"}],
|
||||
"react/jsx-curly-brace-presence": ["error", { "props": "always", "children": "ignore" }],
|
||||
"react/jsx-pascal-case": ["error"],
|
||||
"react/jsx-props-no-multi-spaces": ["error"],
|
||||
"react/jsx-sort-default-props": ["error"],
|
||||
"react/jsx-sort-props": ["error"],
|
||||
"react/jsx-tag-spacing": ["error", {
|
||||
"closingSlash": "never",
|
||||
"beforeSelfClosing": "always",
|
||||
"afterOpening": "allow-multiline",
|
||||
"beforeClosing": "allow"
|
||||
}],
|
||||
"no-useless-escape": 2,
|
||||
"no-invalid-this": 0,
|
||||
"handle-callback-err": 2,
|
||||
"no-fallthrough": 2,
|
||||
"no-new-require": 2,
|
||||
|
|
|
@ -99,6 +99,7 @@
|
|||
"eslint-plugin-flowtype": "2.50.1",
|
||||
"eslint-plugin-import": "2.14.0",
|
||||
"eslint-plugin-jest": "21.22.1",
|
||||
"eslint-plugin-jsx-a11y": "6.1.2",
|
||||
"eslint-plugin-prettier": "2.6.2",
|
||||
"eslint-plugin-react": "7.11.1",
|
||||
"eslint-plugin-verdaccio": "0.0.5",
|
||||
|
@ -212,7 +213,9 @@
|
|||
"git add"
|
||||
]
|
||||
},
|
||||
"ignore": ["*.json"]
|
||||
"ignore": [
|
||||
"*.json"
|
||||
]
|
||||
},
|
||||
"bundlesize": [
|
||||
{
|
||||
|
|
38
yarn.lock
38
yarn.lock
|
@ -727,6 +727,13 @@ argv@^0.0.2:
|
|||
version "0.0.2"
|
||||
resolved "https://registry.npmjs.org/argv/-/argv-0.0.2.tgz#ecbd16f8949b157183711b1bda334f37840185ab"
|
||||
|
||||
aria-query@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.npmjs.org/aria-query/-/aria-query-3.0.0.tgz#65b3fcc1ca1155a8c9ae64d6eee297f15d5133cc"
|
||||
dependencies:
|
||||
ast-types-flow "0.0.7"
|
||||
commander "^2.11.0"
|
||||
|
||||
arr-diff@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf"
|
||||
|
@ -834,6 +841,10 @@ assign-symbols@^1.0.0:
|
|||
version "1.0.0"
|
||||
resolved "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367"
|
||||
|
||||
ast-types-flow@0.0.7, ast-types-flow@^0.0.7:
|
||||
version "0.0.7"
|
||||
resolved "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.7.tgz#f70b735c6bca1a5c9c22d982c3e39e7feba3bdad"
|
||||
|
||||
astral-regex@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9"
|
||||
|
@ -917,6 +928,12 @@ axios@^0.17.0:
|
|||
follow-redirects "^1.2.5"
|
||||
is-buffer "^1.1.5"
|
||||
|
||||
axobject-query@^2.0.1:
|
||||
version "2.0.2"
|
||||
resolved "https://registry.npmjs.org/axobject-query/-/axobject-query-2.0.2.tgz#ea187abe5b9002b377f925d8bf7d1c561adf38f9"
|
||||
dependencies:
|
||||
ast-types-flow "0.0.7"
|
||||
|
||||
babel-cli@6.26.0:
|
||||
version "6.26.0"
|
||||
resolved "https://registry.npmjs.org/babel-cli/-/babel-cli-6.26.0.tgz#502ab54874d7db88ad00b887a06383ce03d002f1"
|
||||
|
@ -3155,6 +3172,10 @@ cyclist@~0.2.2:
|
|||
version "0.2.2"
|
||||
resolved "https://registry.npmjs.org/cyclist/-/cyclist-0.2.2.tgz#1b33792e11e914a2fd6d6ed6447464444e5fa640"
|
||||
|
||||
damerau-levenshtein@^1.0.4:
|
||||
version "1.0.4"
|
||||
resolved "https://registry.npmjs.org/damerau-levenshtein/-/damerau-levenshtein-1.0.4.tgz#03191c432cb6eea168bb77f3a55ffdccb8978514"
|
||||
|
||||
dargs@^4.0.1:
|
||||
version "4.1.0"
|
||||
resolved "https://registry.npmjs.org/dargs/-/dargs-4.1.0.tgz#03a9dbb4b5c2f139bf14ae53f0b8a2a6a86f4e17"
|
||||
|
@ -3583,6 +3604,10 @@ elliptic@^6.0.0:
|
|||
minimalistic-assert "^1.0.0"
|
||||
minimalistic-crypto-utils "^1.0.0"
|
||||
|
||||
emoji-regex@^6.5.1:
|
||||
version "6.5.1"
|
||||
resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-6.5.1.tgz#9baea929b155565c11ea41c6626eaa65cef992c2"
|
||||
|
||||
emojis-list@^2.0.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389"
|
||||
|
@ -3796,6 +3821,19 @@ eslint-plugin-jest@21.22.1:
|
|||
version "21.22.1"
|
||||
resolved "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-21.22.1.tgz#bc805e9b1c75c3bc92e47c44dd41370c1af7ebcc"
|
||||
|
||||
eslint-plugin-jsx-a11y@6.1.2:
|
||||
version "6.1.2"
|
||||
resolved "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.1.2.tgz#69bca4890b36dcf0fe16dd2129d2d88b98f33f88"
|
||||
dependencies:
|
||||
aria-query "^3.0.0"
|
||||
array-includes "^3.0.3"
|
||||
ast-types-flow "^0.0.7"
|
||||
axobject-query "^2.0.1"
|
||||
damerau-levenshtein "^1.0.4"
|
||||
emoji-regex "^6.5.1"
|
||||
has "^1.0.3"
|
||||
jsx-ast-utils "^2.0.1"
|
||||
|
||||
eslint-plugin-prettier@2.6.2:
|
||||
version "2.6.2"
|
||||
resolved "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-2.6.2.tgz#71998c60aedfa2141f7bfcbf9d1c459bf98b4fad"
|
||||
|
|
Loading…
Add table
Reference in a new issue