summaryrefslogtreecommitdiffstats
path: root/streaming/.eslintrc.cjs
blob: e25cff7df07c2717b54d27097b61443550b38836 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* eslint-disable import/no-commonjs */

// @ts-check

// @ts-ignore - This needs to be a CJS file (eslint does not yet support ESM configs), and TS is complaining we use require
const { defineConfig } = require('eslint-define-config');

module.exports = defineConfig({
  extends: ['../.eslintrc.js'],
  env: {
    browser: false,
  },
  parserOptions: {
    project: true,
    tsconfigRootDir: __dirname,
    ecmaFeatures: {
      jsx: false,
    },
    ecmaVersion: 2021,
  },
  rules: {
    // In the streaming server we need to delete some variables to ensure
    // garbage collection takes place on the values referenced by those objects;
    // The alternative is to declare the variable as nullable, but then we need
    // to assert it's in existence before every use, which becomes much harder
    // to maintain.
    'no-delete-var': 'off',

    // This overrides the base configuration for this rule to pick up
    // dependencies for the streaming server from the correct package.json file.
    'import/no-extraneous-dependencies': [
      'error',
      {
        devDependencies: ['streaming/.eslintrc.cjs'],
        optionalDependencies: false,
        peerDependencies: false,
        includeTypes: true,
        packageDir: __dirname,
      },
    ],
    'import/extensions': ['error', 'always'],
  },
});