react-internal.js 763 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. const { resolve } = require("node:path");
  2. const project = resolve(process.cwd(), "tsconfig.json");
  3. /*
  4. * This is a custom ESLint configuration for use with
  5. * internal (bundled by their consumer) libraries
  6. * that utilize React.
  7. */
  8. /** @type {import("eslint").Linter.Config} */
  9. module.exports = {
  10. extends: ["eslint:recommended", "prettier", "turbo"],
  11. plugins: ["only-warn"],
  12. globals: {
  13. React: true,
  14. JSX: true,
  15. },
  16. env: {
  17. browser: true,
  18. },
  19. settings: {
  20. "import/resolver": {
  21. typescript: {
  22. project,
  23. },
  24. },
  25. },
  26. ignorePatterns: [
  27. // Ignore dotfiles
  28. ".*.js",
  29. "node_modules/",
  30. "dist/",
  31. ],
  32. overrides: [
  33. // Force ESLint to detect .tsx files
  34. { files: ["*.js?(x)", "*.ts?(x)"] },
  35. ],
  36. };