react-native-navigation的迁移库

.eslintrc 10KB

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