.eslintrc.json 15 KB

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