2
0

.eslintrc 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. {
  2. "parser": "@typescript-eslint/parser",
  3. "plugins": [
  4. "@typescript-eslint"
  5. ],
  6. "extends": [
  7. "wagtail",
  8. "plugin:@typescript-eslint/recommended"
  9. ],
  10. "env": {
  11. "jest": true
  12. },
  13. "settings": {
  14. "import/resolver": {
  15. "webpack": {
  16. "config": "client/webpack.config.js"
  17. }
  18. }
  19. },
  20. "rules": {
  21. "no-underscore-dangle": ["error", { "allow": ["__REDUX_DEVTOOLS_EXTENSION__"] }],
  22. // note you must disable the base rule as it can report incorrect errors
  23. "no-use-before-define": "off",
  24. "@typescript-eslint/no-use-before-define": ["error"],
  25. "@typescript-eslint/explicit-module-boundary-types": "off",
  26. "@typescript-eslint/explicit-member-accessibility": "off",
  27. "@typescript-eslint/explicit-function-return-type": "off",
  28. "@typescript-eslint/no-explicit-any": "off"
  29. },
  30. "overrides": [
  31. {
  32. // Rules we don’t want to enforce for test and tooling code.
  33. "files": ["*.test.ts", "*.test.tsx", "*.test.js", "webpack.config.js"],
  34. "rules": {
  35. "@typescript-eslint/no-empty-function": "off",
  36. "@typescript-eslint/no-var-requires": "off"
  37. }
  38. },
  39. {
  40. "files": ["docs/_static/**"],
  41. "globals": { "$": "readonly" }
  42. },
  43. {
  44. "globals": {
  45. "$": "readonly",
  46. "addMessage": "readonly",
  47. "buildExpandingFormset": "readonly",
  48. "cancelSpinner": "readonly",
  49. "escapeHtml": "readonly",
  50. "insertRichTextDeleteControl": "readonly",
  51. "jQuery": "readonly",
  52. "jsonData": "readonly",
  53. "ModalWorkflow": "readonly",
  54. "DOCUMENT_CHOOSER_MODAL_ONLOAD_HANDLERS": "writable",
  55. "EMBED_CHOOSER_MODAL_ONLOAD_HANDLERS": "writable",
  56. "IMAGE_CHOOSER_MODAL_ONLOAD_HANDLERS": "writable",
  57. "QUERY_CHOOSER_MODAL_ONLOAD_HANDLERS": "writable",
  58. "SNIPPET_CHOOSER_MODAL_ONLOAD_HANDLERS": "writable"
  59. },
  60. "files": ["wagtail/**/**"],
  61. "rules": {
  62. "@typescript-eslint/no-unused-vars": "off",
  63. "@typescript-eslint/no-use-before-define": "off",
  64. "camelcase": [
  65. "error",
  66. {
  67. "allow": [
  68. "__unused_webpack_module",
  69. "__webpack_modules__",
  70. "__webpack_require__"
  71. ],
  72. "properties": "never"
  73. }
  74. ],
  75. "consistent-return": "off",
  76. "func-names": "off",
  77. "id-length": "off",
  78. "indent": "off",
  79. "key-spacing": "off",
  80. "new-cap": "off",
  81. "newline-per-chained-call": "off",
  82. "no-param-reassign": "off",
  83. "no-underscore-dangle": "off",
  84. "object-shorthand": "off",
  85. "prefer-arrow-callback": "off",
  86. "quote-props": "off",
  87. "space-before-function-paren": "off",
  88. "vars-on-top": "off"
  89. }
  90. }
  91. ]
  92. }