react-native-navigation的迁移库

.eslintrc 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487
  1. {
  2. "env": {
  3. "es6": true,
  4. "node": true
  5. },
  6. "parserOptions": {
  7. "ecmaVersion": 8,
  8. "sourceType": "module",
  9. "ecmaFeatures": {
  10. "impliedStrict": true,
  11. "jsx": true,
  12. "experimentalObjectRestSpread": true
  13. }
  14. },
  15. "plugins": [
  16. "react",
  17. "react-native",
  18. "babel"
  19. ],
  20. "rules": {
  21. /*
  22. * possible errors
  23. */
  24. "comma-dangle": "error",
  25. "no-cond-assign": [
  26. "error",
  27. "except-parens"
  28. ],
  29. "no-console": "warn",
  30. "no-constant-condition": "error",
  31. "no-control-regex": "error",
  32. "no-debugger": "warn",
  33. "no-dupe-args": "error",
  34. "no-dupe-keys": "error",
  35. "no-duplicate-case": "error",
  36. "no-empty": "error",
  37. "no-empty-character-class": "error",
  38. "no-ex-assign": "error",
  39. "no-extra-boolean-cast": "error",
  40. "no-extra-parens": 0,
  41. "no-extra-semi": "error",
  42. "no-func-assign": "error",
  43. "no-inner-declarations": "error",
  44. "no-invalid-regexp": "error",
  45. "no-irregular-whitespace": "error",
  46. "no-negated-in-lhs": "error",
  47. "no-obj-calls": "error",
  48. "no-regex-spaces": "error",
  49. "no-sparse-arrays": "error",
  50. "no-unexpected-multiline": "error",
  51. "no-unreachable": "error",
  52. "use-isnan": "error",
  53. "valid-jsdoc": 0,
  54. "valid-typeof": "error",
  55. /*
  56. * best practices
  57. */
  58. "accessor-pairs": "warn",
  59. "array-callback-return": 0,
  60. "block-scoped-var": "error",
  61. "complexity": 0,
  62. "consistent-return": "error",
  63. "curly": [
  64. "error",
  65. "all"
  66. ],
  67. "default-case": "error",
  68. "dot-location": [
  69. "error",
  70. "property"
  71. ],
  72. "dot-notation": "error",
  73. "eqeqeq": "error",
  74. "guard-for-in": "error",
  75. "no-alert": "error",
  76. "no-caller": "error",
  77. "no-case-declarations": "error",
  78. "no-div-regex": 0,
  79. "no-else-return": 0,
  80. "no-empty-function": "error",
  81. "no-empty-pattern": "error",
  82. "no-eq-null": "error",
  83. "no-eval": "error",
  84. "no-extend-native": "error",
  85. "no-extra-bind": "error",
  86. "no-extra-label": "error",
  87. "no-fallthrough": "error",
  88. "no-floating-decimal": "error",
  89. "no-implicit-coercion": "error",
  90. "no-implicit-globals": 0,
  91. "no-implied-eval": "error",
  92. "no-invalid-this": 0,
  93. "no-iterator": "error",
  94. "no-labels": "error",
  95. "no-lone-blocks": "error",
  96. "no-loop-func": "error",
  97. "no-magic-numbers": 0,
  98. "no-multi-spaces": "error",
  99. "no-multi-str": 0,
  100. "no-native-reassign": "error",
  101. "no-new": "error",
  102. "no-new-func": "error",
  103. "no-new-wrappers": "error",
  104. "no-octal": "error",
  105. "no-octal-escape": "error",
  106. "no-param-reassign": "error",
  107. "no-proto": "error",
  108. "no-redeclare": 0,
  109. "no-return-assign": 0,
  110. "no-script-url": "error",
  111. "no-self-assign": "error",
  112. "no-self-compare": "error",
  113. "no-sequences": "error",
  114. "no-throw-literal": "error",
  115. "no-unmodified-loop-condition": 0,
  116. "no-unused-expressions": "error",
  117. "no-unused-labels": 0,
  118. "no-useless-call": "error",
  119. "no-useless-concat": "error",
  120. "no-void": "error",
  121. "no-warning-comments": 0,
  122. "no-with": "error",
  123. "radix": 0,
  124. "vars-on-top": 0,
  125. "wrap-iife": "error",
  126. "yoda": 0,
  127. "strict": [
  128. "error",
  129. "never"
  130. ],
  131. /*
  132. * variables
  133. */
  134. "init-declarations": 0,
  135. "no-catch-shadow": "error",
  136. "no-delete-var": "error",
  137. "no-label-var": "error",
  138. "no-restricted-globals": "error",
  139. "no-shadow": "error",
  140. "no-shadow-restricted-names": "error",
  141. "no-undef": 0,
  142. "no-undef-init": "error",
  143. "no-undefined": 0,
  144. "no-unused-vars": 0,
  145. "no-use-before-define": 0,
  146. /*
  147. * Node.js
  148. */
  149. "callback-return": 0,
  150. "global-require": 0,
  151. "handle-callback-err": 0,
  152. "no-mixed-requires": "error",
  153. "no-new-require": "error",
  154. "no-path-concat": "error",
  155. "no-process-env": 0,
  156. "no-process-exit": "error",
  157. "no-restricted-modules": 0,
  158. "no-sync": 0,
  159. /*
  160. * style
  161. */
  162. "array-bracket-spacing": [
  163. "error",
  164. "never"
  165. ],
  166. "block-spacing": "error",
  167. "brace-style": [
  168. "error",
  169. "1tbs"
  170. ],
  171. "camelcase": [
  172. "error",
  173. {
  174. "properties": "never"
  175. }
  176. ],
  177. "comma-spacing": [
  178. "error",
  179. {
  180. "before": false,
  181. "after": true
  182. }
  183. ],
  184. "comma-style": [
  185. "error",
  186. "last"
  187. ],
  188. "computed-property-spacing": [
  189. "error",
  190. "never"
  191. ],
  192. "consistent-this": [
  193. "error",
  194. "self"
  195. ],
  196. "eol-last": [
  197. "error",
  198. "unix"
  199. ],
  200. "func-names": 0,
  201. "func-style": 0,
  202. "id-blacklist": 0,
  203. "id-length": 0,
  204. "id-match": 0,
  205. "indent": [
  206. "error",
  207. 2,
  208. {
  209. "SwitchCase": 1
  210. }
  211. ],
  212. "jsx-quotes": "error",
  213. "key-spacing": [
  214. "error",
  215. {
  216. "singleLine": {
  217. "beforeColon": false,
  218. "afterColon": true,
  219. "mode": "strict"
  220. },
  221. "multiLine": {
  222. "beforeColon": false,
  223. "afterColon": true,
  224. "mode": "strict"
  225. }
  226. }
  227. ],
  228. "keyword-spacing": [
  229. "error",
  230. {
  231. "before": true,
  232. "after": true
  233. }
  234. ],
  235. "linebreak-style": [
  236. "error",
  237. "unix"
  238. ],
  239. "lines-around-comment": 0,
  240. "max-depth": [
  241. "error",
  242. 4
  243. ],
  244. "max-len": [
  245. "warn",
  246. 150
  247. ],
  248. "max-nested-callbacks": [
  249. "error",
  250. 4
  251. ],
  252. "max-params": [
  253. "error",
  254. 6
  255. ],
  256. "max-statements": [
  257. "error",
  258. 15,
  259. {
  260. "ignoreTopLevelFunctions": true
  261. }
  262. ],
  263. "new-cap": [
  264. "error",
  265. {
  266. "capIsNewExceptions": [
  267. "Immutable"
  268. ]
  269. }
  270. ],
  271. "new-parens": "error",
  272. "newline-after-var": 0,
  273. "newline-before-return": 0,
  274. "newline-per-chained-call": 0,
  275. "no-array-constructor": "error",
  276. "no-bitwise": 0,
  277. "no-continue": 0,
  278. "no-inline-comments": 0,
  279. "no-lonely-if": "error",
  280. "no-mixed-spaces-and-tabs": 0,
  281. "no-multiple-empty-lines": [
  282. "error",
  283. {
  284. "max": 1
  285. }
  286. ],
  287. "no-negated-condition": 0,
  288. "no-nested-ternary": "error",
  289. "no-new-object": "error",
  290. "no-plusplus": 0,
  291. "no-restricted-syntax": 0,
  292. "no-spaced-func": "error",
  293. "no-ternary": 0,
  294. "no-trailing-spaces": [
  295. "error",
  296. {
  297. "skipBlankLines": true
  298. }
  299. ],
  300. "no-underscore-dangle": 0,
  301. "no-unneeded-ternary": "error",
  302. "no-whitespace-before-property": "error",
  303. "object-curly-spacing": [
  304. "error",
  305. "always"
  306. ],
  307. "one-var": 0,
  308. "one-var-declaration-per-line": 0,
  309. "operator-assignment": 0,
  310. "operator-linebreak": [
  311. "error",
  312. "before"
  313. ],
  314. "padded-blocks": [
  315. "error",
  316. "never"
  317. ],
  318. "quote-props": [
  319. "error",
  320. "consistent-as-needed"
  321. ],
  322. "quotes": 0,
  323. "require-jsdoc": 0,
  324. "semi": [
  325. "error",
  326. "always"
  327. ],
  328. "semi-spacing": [
  329. "error",
  330. {
  331. "before": false,
  332. "after": true
  333. }
  334. ],
  335. "sort-imports": 0,
  336. "sort-vars": 0,
  337. "space-before-blocks": [
  338. "error",
  339. "always"
  340. ],
  341. "space-before-function-paren": [
  342. "error",
  343. "never"
  344. ],
  345. "space-in-parens": [
  346. "error",
  347. "never"
  348. ],
  349. "space-infix-ops": "error",
  350. "space-unary-ops": "error",
  351. "spaced-comment": 0,
  352. "wrap-regex": "error",
  353. /*
  354. * ECMAScript 6
  355. */
  356. "arrow-body-style": 0,
  357. "arrow-parens": [
  358. "error",
  359. "always"
  360. ],
  361. "arrow-spacing": [
  362. "error",
  363. {
  364. "before": true,
  365. "after": true
  366. }
  367. ],
  368. "constructor-super": "error",
  369. "generator-star-spacing": [
  370. "error",
  371. "after"
  372. ],
  373. "no-class-assign": "error",
  374. "no-confusing-arrow": "error",
  375. "no-const-assign": "error",
  376. "no-dupe-class-members": "error",
  377. "no-new-symbol": "error",
  378. "no-restricted-imports": 0,
  379. "no-this-before-super": "error",
  380. "no-useless-constructor": 0,
  381. "no-var": "error",
  382. "object-shorthand": 0,
  383. "prefer-arrow-callback": 0,
  384. "prefer-const": "error",
  385. "prefer-reflect": 0,
  386. "prefer-rest-params": "error",
  387. "prefer-spread": "error",
  388. "prefer-template": 0,
  389. "require-yield": 0,
  390. "template-curly-spacing": [
  391. "error",
  392. "never"
  393. ],
  394. "yield-star-spacing": [
  395. "error",
  396. "after"
  397. ],
  398. /*
  399. * react plugin
  400. */
  401. "react/display-name": 0,
  402. "react/forbid-prop-types": [
  403. "error",
  404. {
  405. "forbid": [
  406. "any"
  407. ]
  408. }
  409. ],
  410. "react/no-danger": "error",
  411. "react/no-deprecated": "error",
  412. "react/no-did-mount-set-state": "error",
  413. "react/no-did-update-set-state": "error",
  414. "react/no-direct-mutation-state": "error",
  415. "react/no-is-mounted": "error",
  416. "react/no-multi-comp": "error",
  417. "react/no-set-state": 0,
  418. "react/no-string-refs": 0,
  419. "react/no-unknown-property": 0,
  420. "react/prefer-es6-class": [
  421. "error",
  422. "always"
  423. ],
  424. "react/prefer-stateless-function": 0,
  425. "react/prop-types": 0,
  426. "react/react-in-jsx-scope": "error",
  427. "react/require-extension": 0,
  428. "react/self-closing-comp": "error",
  429. "react/sort-comp": 0,
  430. "react/sort-prop-types": 0,
  431. "react/jsx-wrap-multilines": "error",
  432. "react/jsx-boolean-value": [
  433. "error",
  434. "always"
  435. ],
  436. "react/jsx-closing-bracket-location": "error",
  437. "react/jsx-curly-spacing": [
  438. "error",
  439. "never"
  440. ],
  441. "react/jsx-equals-spacing": [
  442. "error",
  443. "never"
  444. ],
  445. "react/jsx-handler-names": [
  446. "error",
  447. {
  448. "eventHandlerPropPrefix": "handle"
  449. }
  450. ],
  451. "react/jsx-indent-props": [
  452. 0,
  453. 2
  454. ],
  455. "react/jsx-indent": [
  456. "error",
  457. 2
  458. ],
  459. "react/jsx-key": "error",
  460. "react/jsx-max-props-per-line": [
  461. "error",
  462. {
  463. "maximum": 2
  464. }
  465. ],
  466. "react/jsx-no-bind": 0,
  467. "react/jsx-no-duplicate-props": [
  468. "error",
  469. {
  470. "ignoreCase": true
  471. }
  472. ],
  473. "react/jsx-no-literals": "error",
  474. "react/jsx-no-undef": "error",
  475. "react/jsx-pascal-case": "error",
  476. "react/jsx-sort-props": 0,
  477. "react/jsx-space-before-closing": 0,
  478. "react/jsx-uses-react": "error",
  479. "react/jsx-uses-vars": "error",
  480. /*
  481. * react-native plugin
  482. */
  483. "react-native/no-unused-styles": "error",
  484. "react-native/split-platform-components": "error"
  485. }
  486. }