.eslintrc.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // @ts-check
  2. const { defineConfig } = require('eslint-define-config');
  3. module.exports = defineConfig({
  4. extends: ['../.eslintrc.js'],
  5. env: {
  6. browser: false,
  7. },
  8. parserOptions: {
  9. project: true,
  10. tsconfigRootDir: __dirname,
  11. ecmaFeatures: {
  12. jsx: false,
  13. },
  14. ecmaVersion: 2021,
  15. },
  16. rules: {
  17. // In the streaming server we need to delete some variables to ensure
  18. // garbage collection takes place on the values referenced by those objects;
  19. // The alternative is to declare the variable as nullable, but then we need
  20. // to assert it's in existence before every use, which becomes much harder
  21. // to maintain.
  22. 'no-delete-var': 'off',
  23. // The streaming server is written in commonjs, not ESM for now:
  24. 'import/no-commonjs': 'off',
  25. // This overrides the base configuration for this rule to pick up
  26. // dependencies for the streaming server from the correct package.json file.
  27. 'import/no-extraneous-dependencies': [
  28. 'error',
  29. {
  30. devDependencies: [
  31. 'streaming/.eslintrc.js',
  32. ],
  33. optionalDependencies: false,
  34. peerDependencies: false,
  35. includeTypes: true,
  36. packageDir: __dirname,
  37. },
  38. ],
  39. },
  40. });