.eslintrc.json 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670
  1. {
  2. "extends": [
  3. "eslint:recommended",
  4. "plugin:react-hooks/recommended"
  5. ],
  6. "parserOptions": {
  7. "ecmaVersion": 8,
  8. "sourceType": "module",
  9. "ecmaFeatures": {
  10. "jsx": true,
  11. "impliedStrict": true,
  12. "modules": true,
  13. "experimentalObjectRestSpread": true
  14. }
  15. },
  16. "parser": "babel-eslint",
  17. "plugins": [
  18. "react",
  19. "import"
  20. ],
  21. "env": {
  22. "browser": true,
  23. "node": true,
  24. "jquery": true,
  25. "es6": true,
  26. "jest": true
  27. },
  28. "globals": {
  29. "jest": true,
  30. "describe": true,
  31. "it": true,
  32. "expect": true,
  33. "before": true,
  34. "after": true,
  35. "beforeEach": true
  36. },
  37. "settings": {
  38. "import/resolver": "webpack"
  39. },
  40. "rules": {
  41. "array-bracket-spacing": [
  42. 2,
  43. "never"
  44. ],
  45. "array-callback-return": 2,
  46. "arrow-body-style": 0,
  47. "arrow-parens": [
  48. 2,
  49. "always"
  50. ],
  51. "arrow-spacing": [
  52. 2,
  53. {
  54. "before": true,
  55. "after": true
  56. }
  57. ],
  58. "block-scoped-var": 2,
  59. "brace-style": [
  60. 2,
  61. "1tbs",
  62. {
  63. "allowSingleLine": false
  64. }
  65. ],
  66. "capitalized-comments": 0,
  67. "class-methods-use-this": 0,
  68. "comma-dangle": [
  69. 2,
  70. "always-multiline"
  71. ],
  72. "comma-spacing": [
  73. 2,
  74. {
  75. "before": false,
  76. "after": true
  77. }
  78. ],
  79. "comma-style": [
  80. 2,
  81. "last"
  82. ],
  83. "complexity": [
  84. 0,
  85. 10
  86. ],
  87. "computed-property-spacing": [
  88. 2,
  89. "never"
  90. ],
  91. "consistent-return": 2,
  92. "consistent-this": [
  93. 2,
  94. "self"
  95. ],
  96. "constructor-super": 2,
  97. "curly": [
  98. 2,
  99. "all"
  100. ],
  101. "dot-location": [
  102. 2,
  103. "object"
  104. ],
  105. "dot-notation": 2,
  106. "eqeqeq": [
  107. 2,
  108. "smart"
  109. ],
  110. "func-call-spacing": [
  111. 2,
  112. "never"
  113. ],
  114. "func-name-matching": 0,
  115. "func-names": 2,
  116. "func-style": [
  117. 2,
  118. "declaration",
  119. {
  120. "allowArrowFunctions": true
  121. }
  122. ],
  123. "generator-star-spacing": [
  124. 2,
  125. {
  126. "before": false,
  127. "after": true
  128. }
  129. ],
  130. "global-require": 2,
  131. "guard-for-in": 2,
  132. "id-blacklist": 0,
  133. "import/no-unresolved": 2,
  134. "import/order": [
  135. "error",
  136. {
  137. "newlines-between": "always-and-inside-groups",
  138. "groups": [
  139. "builtin",
  140. "external",
  141. [
  142. "internal",
  143. "parent"
  144. ],
  145. "sibling",
  146. "index"
  147. ]
  148. }
  149. ],
  150. "indent": [
  151. 2,
  152. 4,
  153. {
  154. "SwitchCase": 0
  155. }
  156. ],
  157. "jsx-quotes": [
  158. 2,
  159. "prefer-single"
  160. ],
  161. "key-spacing": [
  162. 2,
  163. {
  164. "beforeColon": false,
  165. "afterColon": true,
  166. "mode": "strict"
  167. }
  168. ],
  169. "keyword-spacing": [
  170. 2,
  171. {
  172. "before": true,
  173. "after": true,
  174. "overrides": {}
  175. }
  176. ],
  177. "line-comment-position": 0,
  178. "linebreak-style": 2,
  179. "lines-around-comment": [
  180. 2,
  181. {
  182. "beforeBlockComment": true,
  183. "beforeLineComment": true,
  184. "allowBlockStart": true,
  185. "allowBlockEnd": true
  186. }
  187. ],
  188. "max-lines": [
  189. 1,
  190. {
  191. "max": 450,
  192. "skipBlankLines": true,
  193. "skipComments": false
  194. }
  195. ],
  196. "max-nested-callbacks": [
  197. 2,
  198. {
  199. "max": 2
  200. }
  201. ],
  202. "max-statements-per-line": [
  203. 2,
  204. {
  205. "max": 1
  206. }
  207. ],
  208. "multiline-ternary": [
  209. 1,
  210. "never"
  211. ],
  212. "new-cap": 2,
  213. "new-parens": 2,
  214. "newline-before-return": 0,
  215. "newline-per-chained-call": 0,
  216. "no-alert": 2,
  217. "no-array-constructor": 2,
  218. "no-await-in-loop": 2,
  219. "no-caller": 2,
  220. "no-case-declarations": 2,
  221. "no-class-assign": 2,
  222. "no-compare-neg-zero": 2,
  223. "no-cond-assign": [
  224. 2,
  225. "except-parens"
  226. ],
  227. "no-confusing-arrow": 2,
  228. "no-console": 2,
  229. "no-const-assign": 2,
  230. "no-constant-condition": 2,
  231. "no-debugger": 2,
  232. "no-div-regex": 2,
  233. "no-dupe-args": 2,
  234. "no-dupe-class-members": 2,
  235. "no-dupe-keys": 2,
  236. "no-duplicate-case": 2,
  237. "no-duplicate-imports": [
  238. 2,
  239. {
  240. "includeExports": true
  241. }
  242. ],
  243. "no-else-return": 2,
  244. "no-empty": 2,
  245. "no-empty-function": 2,
  246. "no-empty-pattern": 2,
  247. "no-eval": 2,
  248. "no-ex-assign": 2,
  249. "no-extend-native": 2,
  250. "no-extra-bind": 2,
  251. "no-extra-label": 2,
  252. "no-extra-parens": 0,
  253. "no-extra-semi": 2,
  254. "no-fallthrough": 2,
  255. "no-floating-decimal": 2,
  256. "no-func-assign": 2,
  257. "no-global-assign": 2,
  258. "no-implicit-coercion": 2,
  259. "no-implicit-globals": 0,
  260. "no-implied-eval": 2,
  261. "no-inner-declarations": 0,
  262. "no-invalid-regexp": 2,
  263. "no-irregular-whitespace": 2,
  264. "no-iterator": 2,
  265. "no-labels": 2,
  266. "no-lone-blocks": 2,
  267. "no-lonely-if": 2,
  268. "no-loop-func": 2,
  269. "no-magic-numbers": [
  270. 0,
  271. {
  272. "ignore": [
  273. -1,
  274. 0,
  275. 1,
  276. 2
  277. ],
  278. "enforceConst": true,
  279. "detectObjects": true
  280. }
  281. ],
  282. "no-mixed-operators": [
  283. 2,
  284. {
  285. "allowSamePrecedence": false
  286. }
  287. ],
  288. "no-mixed-spaces-and-tabs": 2,
  289. "no-multi-assign": 2,
  290. "no-multi-spaces": [
  291. 2,
  292. {
  293. "exceptions": {
  294. "Property": false
  295. }
  296. }
  297. ],
  298. "no-multi-str": 0,
  299. "no-multiple-empty-lines": [
  300. 2,
  301. {
  302. "max": 1
  303. }
  304. ],
  305. "no-native-reassign": 2,
  306. "no-negated-condition": 2,
  307. "no-nested-ternary": 2,
  308. "no-new": 2,
  309. "no-new-func": 2,
  310. "no-new-object": 2,
  311. "no-new-symbol": 2,
  312. "no-new-wrappers": 2,
  313. "no-octal-escape": 2,
  314. "no-param-reassign": 2,
  315. "no-process-env": 2,
  316. "no-process-exit": 2,
  317. "no-proto": 2,
  318. "no-redeclare": 2,
  319. "no-return-assign": [
  320. 2,
  321. "always"
  322. ],
  323. "no-return-await": 2,
  324. "no-script-url": 2,
  325. "no-self-assign": [
  326. 2,
  327. {
  328. "props": true
  329. }
  330. ],
  331. "no-self-compare": 2,
  332. "no-sequences": 2,
  333. "no-shadow": [
  334. 2,
  335. {
  336. "hoist": "functions"
  337. }
  338. ],
  339. "no-shadow-restricted-names": 2,
  340. "no-spaced-func": 2,
  341. "no-tabs": 0,
  342. "no-template-curly-in-string": 2,
  343. "no-ternary": 0,
  344. "no-this-before-super": 2,
  345. "no-throw-literal": 2,
  346. "no-trailing-spaces": [
  347. 2,
  348. {
  349. "skipBlankLines": false
  350. }
  351. ],
  352. "no-undef-init": 2,
  353. "no-undefined": 2,
  354. "no-underscore-dangle": 2,
  355. "no-unexpected-multiline": 2,
  356. "no-unmodified-loop-condition": 2,
  357. "no-unneeded-ternary": [
  358. 2,
  359. {
  360. "defaultAssignment": false
  361. }
  362. ],
  363. "no-unreachable": 2,
  364. "no-unsafe-finally": 2,
  365. "no-unsafe-negation": 2,
  366. "no-unused-expressions": 2,
  367. "no-unused-vars": [
  368. 2,
  369. {
  370. "vars": "all",
  371. "args": "after-used"
  372. }
  373. ],
  374. "no-use-before-define": [
  375. 2,
  376. {
  377. "classes": false,
  378. "functions": false,
  379. "variables": false
  380. }
  381. ],
  382. "no-useless-computed-key": 2,
  383. "no-useless-concat": 2,
  384. "no-useless-constructor": 2,
  385. "no-useless-escape": 2,
  386. "no-useless-rename": 2,
  387. "no-useless-return": 2,
  388. "no-var": 0,
  389. "no-void": 2,
  390. "no-warning-comments": 1,
  391. "no-whitespace-before-property": 2,
  392. "no-with": 2,
  393. "object-curly-newline": 0,
  394. "object-curly-spacing": [
  395. 2,
  396. "never"
  397. ],
  398. "object-property-newline": [
  399. 2,
  400. {
  401. "allowMultiplePropertiesPerLine": true
  402. }
  403. ],
  404. "object-shorthand": [
  405. 2,
  406. "always"
  407. ],
  408. "one-var": [
  409. 2,
  410. "never"
  411. ],
  412. "one-var-declaration-per-line": 0,
  413. "operator-assignment": [
  414. 2,
  415. "always"
  416. ],
  417. "operator-linebreak": [
  418. 2,
  419. "after"
  420. ],
  421. "padded-blocks": [
  422. 2,
  423. "never"
  424. ],
  425. "prefer-arrow-callback": 2,
  426. "prefer-const": 2,
  427. "prefer-destructuring": 0,
  428. "prefer-numeric-literals": 2,
  429. "prefer-promise-reject-errors": 2,
  430. "prefer-rest-params": 2,
  431. "prefer-spread": 2,
  432. "prefer-template": 0,
  433. "quote-props": [
  434. 2,
  435. "as-needed"
  436. ],
  437. "quotes": [
  438. 2,
  439. "single",
  440. "avoid-escape"
  441. ],
  442. "radix": 2,
  443. "react/display-name": [
  444. 0,
  445. {
  446. "ignoreTranspilerName": false
  447. }
  448. ],
  449. "react/forbid-component-props": 0,
  450. "react/forbid-elements": [
  451. 2,
  452. {
  453. "forbid": [
  454. "embed"
  455. ]
  456. }
  457. ],
  458. "react/jsx-boolean-value": [
  459. 2,
  460. "always"
  461. ],
  462. "react/jsx-closing-bracket-location": [
  463. 2,
  464. {
  465. "location": "tag-aligned"
  466. }
  467. ],
  468. "react/jsx-curly-spacing": [
  469. 2,
  470. "never"
  471. ],
  472. "react/jsx-equals-spacing": [
  473. 2,
  474. "never"
  475. ],
  476. "react/jsx-filename-extension": 2,
  477. "react/jsx-first-prop-new-line": [
  478. 2,
  479. "multiline"
  480. ],
  481. "react/jsx-handler-names": 0,
  482. "react/jsx-indent": [
  483. 2,
  484. 4
  485. ],
  486. "react/jsx-indent-props": [
  487. 2,
  488. 4
  489. ],
  490. "react/jsx-key": 2,
  491. "react/jsx-max-props-per-line": [
  492. 2,
  493. {
  494. "maximum": 1
  495. }
  496. ],
  497. "react/jsx-no-bind": 0,
  498. "react/jsx-no-comment-textnodes": 2,
  499. "react/jsx-no-duplicate-props": [
  500. 2,
  501. {
  502. "ignoreCase": false
  503. }
  504. ],
  505. "react/jsx-no-literals": 2,
  506. "react/jsx-no-target-blank": 2,
  507. "react/jsx-no-undef": 2,
  508. "react/jsx-pascal-case": 2,
  509. "react/jsx-tag-spacing": [
  510. 2,
  511. {
  512. "closingSlash": "never",
  513. "beforeSelfClosing": "never",
  514. "afterOpening": "never"
  515. }
  516. ],
  517. "react/jsx-uses-react": 2,
  518. "react/jsx-uses-vars": 2,
  519. "react/jsx-wrap-multilines": 2,
  520. "react/no-array-index-key": 1,
  521. "react/no-children-prop": 2,
  522. "react/no-danger": 0,
  523. "react/no-danger-with-children": 2,
  524. "react/no-deprecated": 1,
  525. "react/no-did-mount-set-state": 2,
  526. "react/no-did-update-set-state": 2,
  527. "react/no-direct-mutation-state": 2,
  528. "react/no-find-dom-node": 1,
  529. "react/no-is-mounted": 2,
  530. "react/no-multi-comp": [
  531. 2,
  532. {
  533. "ignoreStateless": true
  534. }
  535. ],
  536. "react/no-render-return-value": 2,
  537. "react/no-set-state": 0,
  538. "react/no-string-refs": 0,
  539. "react/no-unescaped-entities": 2,
  540. "react/no-unknown-property": 2,
  541. "react/no-unused-prop-types": [
  542. 1,
  543. {
  544. "skipShapeProps": true
  545. }
  546. ],
  547. "react/prefer-es6-class": 2,
  548. "react/prefer-stateless-function": 2,
  549. "react/prop-types": [
  550. 2,
  551. {
  552. "ignore": [
  553. "location",
  554. "history",
  555. "component"
  556. ]
  557. }
  558. ],
  559. "react/require-default-props": 0,
  560. "react/require-optimization": 1,
  561. "react/require-render-return": 2,
  562. "react/self-closing-comp": 2,
  563. "react/sort-comp": 0,
  564. "react/style-prop-object": 2,
  565. "require-yield": 2,
  566. "rest-spread-spacing": [
  567. 2,
  568. "never"
  569. ],
  570. "semi": [
  571. 2,
  572. "always"
  573. ],
  574. "semi-spacing": [
  575. 2,
  576. {
  577. "before": false,
  578. "after": true
  579. }
  580. ],
  581. "sort-imports": 0,
  582. "sort-keys": 0,
  583. "space-before-blocks": [
  584. 2,
  585. "always"
  586. ],
  587. "space-before-function-paren": [
  588. 2,
  589. {
  590. "anonymous": "never",
  591. "named": "never",
  592. "asyncArrow": "always"
  593. }
  594. ],
  595. "space-in-parens": [
  596. 2,
  597. "never"
  598. ],
  599. "space-infix-ops": 2,
  600. "space-unary-ops": [
  601. 2,
  602. {
  603. "words": true,
  604. "nonwords": false
  605. }
  606. ],
  607. "symbol-description": 2,
  608. "template-curly-spacing": [
  609. 2,
  610. "never"
  611. ],
  612. "valid-typeof": [
  613. 2,
  614. {
  615. "requireStringLiterals": false
  616. }
  617. ],
  618. "vars-on-top": 0,
  619. "wrap-iife": [
  620. 2,
  621. "outside"
  622. ],
  623. "wrap-regex": 2,
  624. "yoda": [
  625. 2,
  626. "never",
  627. {
  628. "exceptRange": false,
  629. "onlyEquality": false
  630. }
  631. ]
  632. },
  633. "overrides": [
  634. {
  635. "files": ["**/*.tsx", "**/*.ts"],
  636. "extends": "plugin:@typescript-eslint/recommended",
  637. "rules": {
  638. "@typescript-eslint/ban-ts-ignore": 0,
  639. "@typescript-eslint/ban-types": 1,
  640. "@typescript-eslint/ban-ts-comment": 0,
  641. "@typescript-eslint/no-var-requires": 0,
  642. "@typescript-eslint/prefer-interface": 0,
  643. "@typescript-eslint/explicit-function-return-type": 0,
  644. "@typescript-eslint/explicit-module-boundary-types": 0,
  645. "@typescript-eslint/indent": [
  646. 2,
  647. 4,
  648. {
  649. "SwitchCase": 0
  650. }
  651. ],
  652. "@typescript-eslint/no-use-before-define": [
  653. 2,
  654. {
  655. "classes": false,
  656. "functions": false,
  657. "variables": false
  658. }
  659. ],
  660. "react/jsx-filename-extension": [
  661. 1,
  662. {
  663. "extensions": [".jsx", ".tsx"]
  664. }
  665. ]
  666. }
  667. }
  668. ]
  669. }