test-setup.ts is conflicted with eslint config

46 views Asked by At

I have a problem with eslint and jest setup in my nx monorepo.

My test-setup.ts looks like in docs:

// @ts-expect-error https://thymikee.github.io/jest-preset-angular/docs/getting-started/test-environment
globalThis.ngJest = {
  testEnvironmentOptions: {
    errorOnUnknownElements: true,
    errorOnUnknownProperties: true,
  },
};
import 'jest-preset-angular/setup-jest';

The last line, causes an error: ESLint: Import in body of module; reorder to top.(import/first)

What is the best way to get rid of this error?

  1. Reorder it? Its not specified in the docs if order in this file is necessary.
  2. Add // eslint-disable-next-line import/first on top of last line?
0

There are 0 answers