.eslintrc.js 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. /**
  2. * Licensed to the Apache Software Foundation (ASF) under one
  3. * or more contributor license agreements. See the NOTICE file
  4. * distributed with this work for additional information
  5. * regarding copyright ownership. The ASF licenses this file
  6. * to you under the Apache License, Version 2.0 (the
  7. * "License"); you may not use this file except in compliance
  8. * with the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing,
  13. * software distributed under the License is distributed on an
  14. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  15. * KIND, either express or implied. See the License for the
  16. * specific language governing permissions and limitations
  17. * under the License.
  18. */
  19. module.exports = {
  20. extends: ['airbnb', 'prettier'],
  21. parser: 'babel-eslint',
  22. parserOptions: {
  23. ecmaFeatures: {
  24. experimentalObjectRestSpread: true,
  25. },
  26. },
  27. env: {
  28. browser: true,
  29. },
  30. plugins: ['prettier', 'react'],
  31. overrides: [
  32. {
  33. files: ['*.ts', '*.tsx'],
  34. parser: '@typescript-eslint/parser',
  35. extends: [
  36. 'airbnb',
  37. 'plugin:@typescript-eslint/recommended',
  38. 'prettier',
  39. 'prettier/@typescript-eslint',
  40. ],
  41. plugins: ['@typescript-eslint', 'prettier', 'react'],
  42. rules: {
  43. '@typescript-eslint/ban-ts-ignore': 0,
  44. '@typescript-eslint/camelcase': [
  45. 'error',
  46. {
  47. allow: ['^UNSAFE_'],
  48. properties: 'never',
  49. },
  50. ],
  51. '@typescript-eslint/no-explicit-any': 0,
  52. '@typescript-eslint/explicit-function-return-type': 0,
  53. camelcase: 0,
  54. 'class-methods-use-this': 0,
  55. 'func-names': 0,
  56. 'guard-for-in': 0,
  57. 'import/extensions': [
  58. 'error',
  59. {
  60. '.ts': 'always',
  61. '.tsx': 'always',
  62. '.json': 'always',
  63. },
  64. ],
  65. 'import/no-named-as-default': 0,
  66. 'import/no-named-as-default-member': 0,
  67. 'import/prefer-default-export': 0,
  68. indent: 0,
  69. 'jsx-a11y/anchor-has-content': 0,
  70. 'jsx-a11y/href-no-hash': 0,
  71. 'jsx-a11y/no-static-element-interactions': 0,
  72. 'new-cap': 0,
  73. 'no-bitwise': 0,
  74. 'no-confusing-arrow': 0,
  75. 'no-continue': 0,
  76. 'no-mixed-operators': 0,
  77. 'no-multi-assign': 0,
  78. 'no-multi-spaces': 0,
  79. 'no-plusplus': 0,
  80. 'no-prototype-builtins': 0,
  81. 'no-restricted-properties': 0,
  82. 'no-restricted-syntax': 0,
  83. 'no-unused-vars': 0,
  84. 'padded-blocks': 0,
  85. 'prefer-arrow-callback': 0,
  86. 'prefer-template': 0,
  87. 'react/forbid-prop-types': 0,
  88. 'react/jsx-filename-extension': [1, { extensions: ['.jsx', '.tsx'] }],
  89. 'react/jsx-no-bind': 0,
  90. 'react/no-array-index-key': 0,
  91. 'react/no-string-refs': 0,
  92. 'react/no-unescaped-entities': 0,
  93. 'react/no-unused-prop-types': 0,
  94. 'react/require-default-props': 0,
  95. 'react/jsx-fragments': 1,
  96. 'react/prop-types': 0,
  97. 'prettier/prettier': 'error',
  98. },
  99. settings: {
  100. 'import/resolver': 'webpack',
  101. react: {
  102. version: 'detect',
  103. },
  104. },
  105. },
  106. ],
  107. rules: {
  108. camelcase: [
  109. 'error',
  110. {
  111. allow: ['^UNSAFE_'],
  112. properties: 'never',
  113. },
  114. ],
  115. 'class-methods-use-this': 0,
  116. 'func-names': 0,
  117. 'guard-for-in': 0,
  118. 'import/extensions': [
  119. 'error',
  120. {
  121. '.js': 'always',
  122. '.jsx': 'always',
  123. '.ts': 'always',
  124. '.tsx': 'always',
  125. '.json': 'always',
  126. },
  127. ],
  128. 'import/no-named-as-default': 0,
  129. 'import/prefer-default-export': 0,
  130. indent: 0,
  131. 'jsx-a11y/anchor-has-content': 0,
  132. 'jsx-a11y/href-no-hash': 0,
  133. 'jsx-a11y/no-static-element-interactions': 0,
  134. 'new-cap': 0,
  135. 'no-bitwise': 0,
  136. 'no-confusing-arrow': 0,
  137. 'no-continue': 0,
  138. 'no-mixed-operators': 0,
  139. 'no-multi-assign': 0,
  140. 'no-multi-spaces': 0,
  141. 'no-plusplus': 0,
  142. 'no-prototype-builtins': 0,
  143. 'no-restricted-properties': 0,
  144. 'no-restricted-syntax': 0,
  145. 'no-unused-vars': 0,
  146. 'padded-blocks': 0,
  147. 'prefer-arrow-callback': 0,
  148. 'prefer-template': 0,
  149. 'react/forbid-prop-types': 0,
  150. 'react/jsx-filename-extension': [1, { extensions: ['.jsx', '.tsx'] }],
  151. 'react/jsx-no-bind': 0,
  152. 'react/no-array-index-key': 0,
  153. 'react/no-string-refs': 0,
  154. 'react/no-unescaped-entities': 0,
  155. 'react/no-unused-prop-types': 0,
  156. 'react/require-default-props': 0,
  157. 'react/jsx-fragments': 1,
  158. 'react/prop-types': 0,
  159. 'prettier/prettier': 'error',
  160. },
  161. settings: {
  162. 'import/resolver': 'webpack',
  163. react: {
  164. version: 'detect',
  165. },
  166. },
  167. };