.eslintrc.cjs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* eslint-disable import/no-commonjs */
  2. // @ts-check
  3. // @ts-ignore - This needs to be a CJS file (eslint does not yet support ESM configs), and TS is complaining we use require
  4. const { defineConfig } = require('eslint-define-config');
  5. module.exports = defineConfig({
  6. extends: ['../.eslintrc.js'],
  7. env: {
  8. browser: false,
  9. },
  10. parserOptions: {
  11. project: true,
  12. tsconfigRootDir: __dirname,
  13. ecmaFeatures: {
  14. jsx: false,
  15. },
  16. ecmaVersion: 2021,
  17. },
  18. rules: {
  19. // In the streaming server we need to delete some variables to ensure
  20. // garbage collection takes place on the values referenced by those objects;
  21. // The alternative is to declare the variable as nullable, but then we need
  22. // to assert it's in existence before every use, which becomes much harder
  23. // to maintain.
  24. 'no-delete-var': '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: ['streaming/.eslintrc.cjs'],
  31. optionalDependencies: false,
  32. peerDependencies: false,
  33. includeTypes: true,
  34. packageDir: __dirname,
  35. },
  36. ],
  37. 'import/extensions': ['error', 'always'],
  38. },
  39. });