.eslintrc.cjs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /**
  2. * Copyright (c) Meta Platforms, Inc. and affiliates.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. module.exports = {
  17. root: true,
  18. env: {browser: true, es2020: true},
  19. extends: [
  20. 'eslint:recommended',
  21. 'plugin:@typescript-eslint/recommended',
  22. 'plugin:react/recommended',
  23. 'plugin:react-hooks/recommended',
  24. 'plugin:import/recommended',
  25. 'plugin:prettier/recommended',
  26. ],
  27. ignorePatterns: ['dist', '.eslintrc.cjs'],
  28. parser: '@typescript-eslint/parser',
  29. parserOptions: {
  30. ecmaVersion: 'latest',
  31. sourceType: 'module',
  32. project: ['./tsconfig.json', './tsconfig.node.json'],
  33. tsconfigRootDir: __dirname,
  34. },
  35. plugins: ['react-refresh'],
  36. settings: {
  37. react: {
  38. version: 'detect',
  39. },
  40. 'import/resolver': {
  41. typescript: {},
  42. node: {},
  43. },
  44. },
  45. rules: {
  46. 'no-console': 'warn',
  47. curly: 'warn',
  48. 'react/jsx-no-useless-fragment': 'warn',
  49. '@typescript-eslint/no-unused-vars': [
  50. 'warn',
  51. {
  52. argsIgnorePattern: '^_',
  53. },
  54. ],
  55. 'react-refresh/only-export-components': [
  56. 'warn',
  57. {
  58. allowConstantExport: true,
  59. },
  60. ],
  61. 'react/react-in-jsx-scope': 'off',
  62. },
  63. };