From 89334d29dfed20657cee8349f42dcc4ae055beeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CJamesHenry=E2=80=9D?= Date: Wed, 14 Aug 2024 14:45:25 +0400 Subject: [PATCH] chore(linter): try another CI run --- e2e/esbuild/src/esbuild.test.ts | 3 +-- e2e/js/src/js-packaging.test.ts | 10 ++++++++++ e2e/nx/src/import.test.ts | 10 ++++++++++ nx-dev/nx-dev-e2e/src/helpers.ts | 9 +++++---- .../__snapshots__/generator.spec.ts.snap | 20 +++++++++---------- .../converters/json-converter.spec.ts | 17 +++++++--------- .../convert-to-flat-config/generator.spec.ts | 4 ++-- .../src/generators/utils/eslint-file.spec.ts | 7 +++---- .../workspace-rules-project.spec.ts.snap | 3 +-- .../__snapshots__/configuration.spec.ts.snap | 18 ++++++----------- .../configuration/configuration.spec.ts | 12 ++++------- .../js/src/generators/library/library.spec.ts | 3 +-- .../__snapshots__/library.spec.ts.snap | 6 ++---- .../application/lib/add-linting.spec.ts | 7 +++---- .../application/application.spec.ts | 6 ++---- .../__snapshots__/library.spec.ts.snap | 3 +-- .../src/generators/library/library.spec.ts | 3 +-- .../application.impl.spec.ts.snap | 11 ++++------ .../__snapshots__/library.impl.spec.ts.snap | 6 ++---- .../__snapshots__/configuration.spec.ts.snap | 3 +-- .../application/application.spec.ts | 6 ++---- 21 files changed, 78 insertions(+), 89 deletions(-) diff --git a/e2e/esbuild/src/esbuild.test.ts b/e2e/esbuild/src/esbuild.test.ts index 50480142ce36df..8df59fcae172ab 100644 --- a/e2e/esbuild/src/esbuild.test.ts +++ b/e2e/esbuild/src/esbuild.test.ts @@ -162,8 +162,7 @@ describe('EsBuild Plugin', () => { expect( readJson(`dist/libs/${parentLib}/package.json`).dependencies ).toEqual({ - // TODO: why is this and only this getting added? - '@eslint/eslintrc': expect.any(String), + 'jsonc-eslint-parser': expect.any(String), // Don't care about the versions, just that they exist rambda: expect.any(String), lodash: expect.any(String), diff --git a/e2e/js/src/js-packaging.test.ts b/e2e/js/src/js-packaging.test.ts index a910b336fc4147..d5e373edf3216a 100644 --- a/e2e/js/src/js-packaging.test.ts +++ b/e2e/js/src/js-packaging.test.ts @@ -14,6 +14,16 @@ import { import { join } from 'path'; describe('packaging libs', () => { + let originalEslintUseFlatConfigVal: string | undefined; + beforeAll(() => { + // Opt into legacy .eslintrc config format for these tests + originalEslintUseFlatConfigVal = process.env.ESLINT_USE_FLAT_CONFIG; + process.env.ESLINT_USE_FLAT_CONFIG = 'false'; + }); + afterAll(() => { + process.env.ESLINT_USE_FLAT_CONFIG = originalEslintUseFlatConfigVal; + }); + let scope: string; beforeEach(() => { diff --git a/e2e/nx/src/import.test.ts b/e2e/nx/src/import.test.ts index 2bb5196d589d13..c80a13ed65ca23 100644 --- a/e2e/nx/src/import.test.ts +++ b/e2e/nx/src/import.test.ts @@ -13,6 +13,16 @@ import { execSync } from 'node:child_process'; import { join } from 'path'; describe('Nx Import', () => { + let originalEslintUseFlatConfigVal: string | undefined; + beforeAll(() => { + // Opt into legacy .eslintrc config format for these tests + originalEslintUseFlatConfigVal = process.env.ESLINT_USE_FLAT_CONFIG; + process.env.ESLINT_USE_FLAT_CONFIG = 'false'; + }); + afterAll(() => { + process.env.ESLINT_USE_FLAT_CONFIG = originalEslintUseFlatConfigVal; + }); + let proj: string; const tempImportE2ERoot = join(e2eCwd, 'nx-import'); beforeAll(() => { diff --git a/nx-dev/nx-dev-e2e/src/helpers.ts b/nx-dev/nx-dev-e2e/src/helpers.ts index 44584f2f74c697..eabf8794e74a92 100644 --- a/nx-dev/nx-dev-e2e/src/helpers.ts +++ b/nx-dev/nx-dev-e2e/src/helpers.ts @@ -1,4 +1,4 @@ -import { Page, test, expect } from '@playwright/test'; +import { expect, test } from '@playwright/test'; /** * Assert a text is present on the visited page. * @param page @@ -11,11 +11,12 @@ export function assertTextOnPage( title: string, selector: string = 'h1' ): void { - test.describe(path, () => + // eslint-disable-next-line playwright/valid-title + test.describe(path, () => { test(`should display "${title}"`, async ({ page }) => { await page.goto(path); const locator = page.locator(selector); await expect(locator).toContainText(title); - }) - ); + }); + }); } diff --git a/packages/eslint/src/generators/convert-to-flat-config/__snapshots__/generator.spec.ts.snap b/packages/eslint/src/generators/convert-to-flat-config/__snapshots__/generator.spec.ts.snap index 491e51e0510570..50c7771c6ae529 100644 --- a/packages/eslint/src/generators/convert-to-flat-config/__snapshots__/generator.spec.ts.snap +++ b/packages/eslint/src/generators/convert-to-flat-config/__snapshots__/generator.spec.ts.snap @@ -2,9 +2,9 @@ exports[`convert-to-flat-config generator should add env configuration 1`] = ` "const { FlatCompat } = require('@eslint/eslintrc'); +const js = require('@eslint/js'); const nxEslintPlugin = require('@nx/eslint-plugin'); const globals = require('globals'); -const js = require('@eslint/js'); const compat = new FlatCompat({ baseDirectory: __dirname, @@ -52,9 +52,9 @@ module.exports = [ exports[`convert-to-flat-config generator should add global and env configuration 1`] = ` "const { FlatCompat } = require('@eslint/eslintrc'); +const js = require('@eslint/js'); const nxEslintPlugin = require('@nx/eslint-plugin'); const globals = require('globals'); -const js = require('@eslint/js'); const compat = new FlatCompat({ baseDirectory: __dirname, @@ -106,8 +106,8 @@ module.exports = [ exports[`convert-to-flat-config generator should add global configuration 1`] = ` "const { FlatCompat } = require('@eslint/eslintrc'); -const nxEslintPlugin = require('@nx/eslint-plugin'); const js = require('@eslint/js'); +const nxEslintPlugin = require('@nx/eslint-plugin'); const compat = new FlatCompat({ baseDirectory: __dirname, @@ -155,8 +155,8 @@ module.exports = [ exports[`convert-to-flat-config generator should add global eslintignores 1`] = ` "const { FlatCompat } = require('@eslint/eslintrc'); -const nxEslintPlugin = require('@nx/eslint-plugin'); const js = require('@eslint/js'); +const nxEslintPlugin = require('@nx/eslint-plugin'); const compat = new FlatCompat({ baseDirectory: __dirname, @@ -204,9 +204,9 @@ module.exports = [ exports[`convert-to-flat-config generator should add parser 1`] = ` "const { FlatCompat } = require('@eslint/eslintrc'); +const js = require('@eslint/js'); const nxEslintPlugin = require('@nx/eslint-plugin'); const typescriptEslintParser = require('@typescript-eslint/parser'); -const js = require('@eslint/js'); const compat = new FlatCompat({ baseDirectory: __dirname, @@ -254,11 +254,11 @@ module.exports = [ exports[`convert-to-flat-config generator should add plugins 1`] = ` "const { FlatCompat } = require('@eslint/eslintrc'); +const js = require('@eslint/js'); const eslintPluginImport = require('eslint-plugin-import'); const eslintPluginSingleName = require('eslint-plugin-single-name'); const scopeEslintPluginWithName = require('@scope/eslint-plugin-with-name'); const justScopeEslintPlugin = require('@just-scope/eslint-plugin'); -const js = require('@eslint/js'); const compat = new FlatCompat({ baseDirectory: __dirname, @@ -312,8 +312,8 @@ module.exports = [ exports[`convert-to-flat-config generator should add settings 1`] = ` "const { FlatCompat } = require('@eslint/eslintrc'); -const nxEslintPlugin = require('@nx/eslint-plugin'); const js = require('@eslint/js'); +const nxEslintPlugin = require('@nx/eslint-plugin'); const compat = new FlatCompat({ baseDirectory: __dirname, @@ -361,8 +361,8 @@ module.exports = [ exports[`convert-to-flat-config generator should convert json successfully 1`] = ` "const { FlatCompat } = require('@eslint/eslintrc'); -const nxEslintPlugin = require('@nx/eslint-plugin'); const js = require('@eslint/js'); +const nxEslintPlugin = require('@nx/eslint-plugin'); const compat = new FlatCompat({ baseDirectory: __dirname, @@ -430,8 +430,8 @@ module.exports = [ exports[`convert-to-flat-config generator should convert yaml successfully 1`] = ` "const { FlatCompat } = require('@eslint/eslintrc'); -const nxEslintPlugin = require('@nx/eslint-plugin'); const js = require('@eslint/js'); +const nxEslintPlugin = require('@nx/eslint-plugin'); const compat = new FlatCompat({ baseDirectory: __dirname, @@ -499,8 +499,8 @@ module.exports = [ exports[`convert-to-flat-config generator should convert yml successfully 1`] = ` "const { FlatCompat } = require('@eslint/eslintrc'); -const nxEslintPlugin = require('@nx/eslint-plugin'); const js = require('@eslint/js'); +const nxEslintPlugin = require('@nx/eslint-plugin'); const compat = new FlatCompat({ baseDirectory: __dirname, diff --git a/packages/eslint/src/generators/convert-to-flat-config/converters/json-converter.spec.ts b/packages/eslint/src/generators/convert-to-flat-config/converters/json-converter.spec.ts index 2217bd0d0fbdcd..39e2e4afbf9bfd 100644 --- a/packages/eslint/src/generators/convert-to-flat-config/converters/json-converter.spec.ts +++ b/packages/eslint/src/generators/convert-to-flat-config/converters/json-converter.spec.ts @@ -182,13 +182,13 @@ describe('convertEslintJsonToFlatConfig', () => { expect(content).toMatchInlineSnapshot(` "const { FlatCompat } = require("@eslint/eslintrc"); + const js = require("@eslint/js"); const baseConfig = require("../../eslint.config.js"); const globals = require("globals"); - const js = require("@eslint/js"); const compat = new FlatCompat({ - baseDirectory: __dirname, - recommendedConfig: js.configs.recommended, + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, }); module.exports = [ @@ -222,14 +222,11 @@ describe('convertEslintJsonToFlatConfig', () => { ], rules: {} }, - ...compat.config({ parser: "jsonc-eslint-parser" }).map(config => ({ - ...config, + { files: ["**/*.json"], - rules: { - ...config.rules, - "@nx/dependency-checks": "error" - } - })), + rules: { "@nx/dependency-checks": "error" }, + languageOptions: { parser: require("jsonc-eslint-parser") } + }, { ignores: [".next/**/*"] }, { ignores: ["something/else"] } ]; diff --git a/packages/eslint/src/generators/convert-to-flat-config/generator.spec.ts b/packages/eslint/src/generators/convert-to-flat-config/generator.spec.ts index f11734dc7fa48a..875e33631e2e07 100644 --- a/packages/eslint/src/generators/convert-to-flat-config/generator.spec.ts +++ b/packages/eslint/src/generators/convert-to-flat-config/generator.spec.ts @@ -147,8 +147,8 @@ describe('convert-to-flat-config generator', () => { expect(tree.read('eslint.config.js', 'utf-8')).toMatchInlineSnapshot(` "const { FlatCompat } = require('@eslint/eslintrc'); - const nxEslintPlugin = require('@nx/eslint-plugin'); const js = require('@eslint/js'); + const nxEslintPlugin = require('@nx/eslint-plugin'); const compat = new FlatCompat({ baseDirectory: __dirname, @@ -392,8 +392,8 @@ describe('convert-to-flat-config generator', () => { expect(tree.read('eslint.config.js', 'utf-8')).toMatchInlineSnapshot(` "const { FlatCompat } = require('@eslint/eslintrc'); - const nxEslintPlugin = require('@nx/eslint-plugin'); const js = require('@eslint/js'); + const nxEslintPlugin = require('@nx/eslint-plugin'); const compat = new FlatCompat({ baseDirectory: __dirname, diff --git a/packages/eslint/src/generators/utils/eslint-file.spec.ts b/packages/eslint/src/generators/utils/eslint-file.spec.ts index 54f48749c28544..bdb12a250cff78 100644 --- a/packages/eslint/src/generators/utils/eslint-file.spec.ts +++ b/packages/eslint/src/generators/utils/eslint-file.spec.ts @@ -197,10 +197,9 @@ module.exports = [ const baseConfig = require("../../eslint.config.js"); const compat = new FlatCompat({ - baseDirectory: __dirname, - recommendedConfig: js.configs.recommended, - }); - + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + }); module.exports = [ ...baseConfig, diff --git a/packages/eslint/src/generators/workspace-rules-project/__snapshots__/workspace-rules-project.spec.ts.snap b/packages/eslint/src/generators/workspace-rules-project/__snapshots__/workspace-rules-project.spec.ts.snap index dbc51f509da620..fd165777b0e22d 100644 --- a/packages/eslint/src/generators/workspace-rules-project/__snapshots__/workspace-rules-project.spec.ts.snap +++ b/packages/eslint/src/generators/workspace-rules-project/__snapshots__/workspace-rules-project.spec.ts.snap @@ -78,8 +78,7 @@ exports[`@nx/eslint:workspace-rules-project should generate the required files 4 `; exports[`@nx/eslint:workspace-rules-project should generate the required files 5`] = ` -"/* eslint-disable */ -export default { +"export default { displayName: 'eslint-rules', preset: '../../jest.preset.js', transform: { diff --git a/packages/jest/src/generators/configuration/__snapshots__/configuration.spec.ts.snap b/packages/jest/src/generators/configuration/__snapshots__/configuration.spec.ts.snap index d41f58442b460c..4074629e8b7b63 100644 --- a/packages/jest/src/generators/configuration/__snapshots__/configuration.spec.ts.snap +++ b/packages/jest/src/generators/configuration/__snapshots__/configuration.spec.ts.snap @@ -1,8 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`jestProject --babelJest should generate proper jest.transform when --compiler=swc and supportTsx is true 1`] = ` -"/* eslint-disable */ -export default { +"export default { displayName: 'lib1', preset: '../../jest.preset.js', transform: { @@ -23,8 +22,7 @@ export default { `; exports[`jestProject --babelJest should generate proper jest.transform when babelJest and supportTsx is true 1`] = ` -"/* eslint-disable */ -export default { +"export default { displayName: 'lib1', preset: '../../jest.preset.js', transform: { @@ -37,8 +35,7 @@ export default { `; exports[`jestProject --babelJest should generate proper jest.transform when babelJest is true 1`] = ` -"/* eslint-disable */ -export default { +"export default { displayName: 'lib1', preset: '../../jest.preset.js', transform: { @@ -51,8 +48,7 @@ export default { `; exports[`jestProject --setup-file should have setupFilesAfterEnv and globals.ts-jest in the jest.config when generated for angular 1`] = ` -"/* eslint-disable */ -export default { +"export default { displayName: 'lib1', preset: '../../jest.preset.js', setupFilesAfterEnv: ['/src/test-setup.ts'], @@ -77,8 +73,7 @@ export default { `; exports[`jestProject should create a jest.config.ts 1`] = ` -"/* eslint-disable */ -export default { +"export default { displayName: 'lib1', preset: '../../jest.preset.js', coverageDirectory: '../../coverage/libs/lib1', @@ -87,8 +82,7 @@ export default { `; exports[`jestProject should generate files 2`] = ` -"/* eslint-disable */ -export default { +"export default { displayName: 'lib1', preset: '../../jest.preset.js', setupFilesAfterEnv: ['/src/test-setup.ts'], diff --git a/packages/jest/src/generators/configuration/configuration.spec.ts b/packages/jest/src/generators/configuration/configuration.spec.ts index 36da18e1ae821a..333a4d3c7a5872 100644 --- a/packages/jest/src/generators/configuration/configuration.spec.ts +++ b/packages/jest/src/generators/configuration/configuration.spec.ts @@ -357,8 +357,7 @@ describe('jestProject', () => { project: 'my-project', }); expect(tree.read('jest.config.ts', 'utf-8')).toMatchInlineSnapshot(` - "/* eslint-disable */ - export default { + "export default { displayName: 'my-project', preset: './jest.preset.js', coverageDirectory: './coverage/my-project', @@ -389,8 +388,7 @@ describe('jestProject', () => { js: true, }); expect(tree.read('jest.config.js', 'utf-8')).toMatchInlineSnapshot(` - "/* eslint-disable */ - module.exports = { + "module.exports = { displayName: 'my-project', preset: './jest.preset.js', coverageDirectory: './coverage/my-project', @@ -424,8 +422,7 @@ describe('jestProject', () => { // ASSERT expect(tree.read('libs/lib1/jest.config.ts', 'utf-8')) .toMatchInlineSnapshot(` - "/* eslint-disable */ - export default { + "export default { displayName: 'lib1', preset: '../../jest.preset.cjs', coverageDirectory: '../../coverage/libs/lib1', @@ -451,8 +448,7 @@ describe('jestProject', () => { expect(tree.exists('jest.preset.cjs')).toBeTruthy(); expect(tree.read('libs/lib1/jest.config.ts', 'utf-8')) .toMatchInlineSnapshot(` - "/* eslint-disable */ - export default { + "export default { displayName: 'lib1', preset: '../../jest.preset.cjs', coverageDirectory: '../../coverage/libs/lib1', diff --git a/packages/js/src/generators/library/library.spec.ts b/packages/js/src/generators/library/library.spec.ts index dc440992a71e82..c76c35f90b1b4c 100644 --- a/packages/js/src/generators/library/library.spec.ts +++ b/packages/js/src/generators/library/library.spec.ts @@ -745,8 +745,7 @@ describe('lib', () => { expect(tree.exists(`my-lib/jest.config.ts`)).toBeTruthy(); expect(tree.read(`my-lib/jest.config.ts`, 'utf-8')) .toMatchInlineSnapshot(` - "/* eslint-disable */ - export default { + "export default { displayName: 'my-lib', preset: '../jest.preset.js', transform: { diff --git a/packages/nest/src/generators/library/__snapshots__/library.spec.ts.snap b/packages/nest/src/generators/library/__snapshots__/library.spec.ts.snap index c1e313358ffc8f..491e8008a3a814 100644 --- a/packages/nest/src/generators/library/__snapshots__/library.spec.ts.snap +++ b/packages/nest/src/generators/library/__snapshots__/library.spec.ts.snap @@ -1,8 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`lib --testEnvironment should set target jest testEnvironment to jsdom 1`] = ` -"/* eslint-disable */ -export default { +"export default { displayName: 'my-lib', preset: '../jest.preset.js', transform: { @@ -15,8 +14,7 @@ export default { `; exports[`lib --testEnvironment should set target jest testEnvironment to node by default 1`] = ` -"/* eslint-disable */ -export default { +"export default { displayName: 'my-lib', preset: '../jest.preset.js', testEnvironment: 'node', diff --git a/packages/next/src/generators/application/lib/add-linting.spec.ts b/packages/next/src/generators/application/lib/add-linting.spec.ts index 1a79152d9a5d6e..97e03af1aa313b 100644 --- a/packages/next/src/generators/application/lib/add-linting.spec.ts +++ b/packages/next/src/generators/application/lib/add-linting.spec.ts @@ -121,10 +121,9 @@ describe('updateEslint', () => { const baseConfig = require("../eslint.config.js"); const compat = new FlatCompat({ - baseDirectory: __dirname, - recommendedConfig: js.configs.recommended, - }); - + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + }); module.exports = [ ...compat.extends("plugin:@nx/react-typescript", "next", "next/core-web-vitals"), diff --git a/packages/node/src/generators/application/application.spec.ts b/packages/node/src/generators/application/application.spec.ts index d41ede16d3084f..52c50f59b728b8 100644 --- a/packages/node/src/generators/application/application.spec.ts +++ b/packages/node/src/generators/application/application.spec.ts @@ -409,8 +409,7 @@ describe('app', () => { expect(tree.read(`my-node-app/jest.config.ts`, 'utf-8')) .toMatchInlineSnapshot(` - "/* eslint-disable */ - export default { + "export default { displayName: 'my-node-app', preset: '../jest.preset.js', testEnvironment: 'node', @@ -436,8 +435,7 @@ describe('app', () => { expect(tree.read(`my-node-app/jest.config.ts`, 'utf-8')) .toMatchInlineSnapshot(` - "/* eslint-disable */ - export default { + "export default { displayName: 'my-node-app', preset: '../jest.preset.js', testEnvironment: 'node', diff --git a/packages/node/src/generators/library/__snapshots__/library.spec.ts.snap b/packages/node/src/generators/library/__snapshots__/library.spec.ts.snap index 969c956e03d7cd..49b724ebc08e1f 100644 --- a/packages/node/src/generators/library/__snapshots__/library.spec.ts.snap +++ b/packages/node/src/generators/library/__snapshots__/library.spec.ts.snap @@ -1,8 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`lib not nested should update configuration 1`] = ` -"/* eslint-disable */ -export default { +"export default { displayName: 'my-lib', preset: '../jest.preset.js', testEnvironment: 'node', diff --git a/packages/node/src/generators/library/library.spec.ts b/packages/node/src/generators/library/library.spec.ts index 3139ace6d85067..1daa78196af7fc 100644 --- a/packages/node/src/generators/library/library.spec.ts +++ b/packages/node/src/generators/library/library.spec.ts @@ -440,8 +440,7 @@ describe('lib', () => { expect(tree.read(`my-lib/jest.config.ts`, 'utf-8')) .toMatchInlineSnapshot(` - "/* eslint-disable */ - export default { + "export default { displayName: 'my-lib', preset: '../jest.preset.js', testEnvironment: 'node', diff --git a/packages/remix/src/generators/application/__snapshots__/application.impl.spec.ts.snap b/packages/remix/src/generators/application/__snapshots__/application.impl.spec.ts.snap index fde183522ad238..6e86110c9292de 100644 --- a/packages/remix/src/generators/application/__snapshots__/application.impl.spec.ts.snap +++ b/packages/remix/src/generators/application/__snapshots__/application.impl.spec.ts.snap @@ -324,8 +324,7 @@ export default { `; exports[`Remix Application Integrated Repo --projectNameAndRootFormat=as-provided --unitTestRunner should generate the correct files for testing using jest 2`] = ` -"/* eslint-disable */ -export default { +"export default { displayName: 'test', preset: '../jest.preset.js', transform: { @@ -835,8 +834,7 @@ export default { `; exports[`Remix Application Integrated Repo --projectNameAndRootFormat=derived --unitTestRunner should generate the correct files for testing using jest 2`] = ` -"/* eslint-disable */ -export default { +"export default { displayName: 'test', preset: '../../jest.preset.js', transform: { @@ -1129,8 +1127,7 @@ export default { `; exports[`Remix Application Standalone Project Repo --unitTestRunner should generate the correct files for testing using jest 2`] = ` -"/* eslint-disable */ -export default { +"export default { setupFilesAfterEnv: ['/test-setup.ts'], displayName: 'test', preset: './jest.preset.cjs', @@ -1385,7 +1382,7 @@ exports[`Remix Application Standalone Project Repo should create the application exports[`Remix Application Standalone Project Repo should create the application correctly 6`] = ` "{ "root": true, - "ignorePatterns": ["!**/*"], + "ignorePatterns": ["!**/*", "build", "public/build"], "plugins": ["@nx"], "overrides": [ { diff --git a/packages/remix/src/generators/library/__snapshots__/library.impl.spec.ts.snap b/packages/remix/src/generators/library/__snapshots__/library.impl.spec.ts.snap index f126332287775d..a2e0ef1afa1d45 100644 --- a/packages/remix/src/generators/library/__snapshots__/library.impl.spec.ts.snap +++ b/packages/remix/src/generators/library/__snapshots__/library.impl.spec.ts.snap @@ -1,8 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Remix Library Generator -projectNameAndRootFormat=as-provided --unitTestRunner should create the correct config files for testing with jest 1`] = ` -"/* eslint-disable */ -export default { +"export default { setupFilesAfterEnv: ['./src/test-setup.ts'], displayName: 'test', preset: '../jest.preset.js', @@ -79,8 +78,7 @@ exports[`Remix Library Generator -projectNameAndRootFormat=as-provided should ge `; exports[`Remix Library Generator -projectNameAndRootFormat=derived --unitTestRunner should create the correct config files for testing with jest 1`] = ` -"/* eslint-disable */ -export default { +"export default { setupFilesAfterEnv: ['./src/test-setup.ts'], displayName: 'test', preset: '../../jest.preset.js', diff --git a/packages/vite/src/generators/configuration/__snapshots__/configuration.spec.ts.snap b/packages/vite/src/generators/configuration/__snapshots__/configuration.spec.ts.snap index d2d4e161b2bd8b..66c3a3e01a0b29 100644 --- a/packages/vite/src/generators/configuration/__snapshots__/configuration.spec.ts.snap +++ b/packages/vite/src/generators/configuration/__snapshots__/configuration.spec.ts.snap @@ -148,8 +148,7 @@ exports[`@nx/vite:configuration js library with --bundler=vite should respect un `; exports[`@nx/vite:configuration js library with --bundler=vite should respect unitTestRunner if passed 5`] = ` -"/* eslint-disable */ -export default { +"export default { displayName: 'my-lib', preset: '../jest.preset.js', transform: { diff --git a/packages/web/src/generators/application/application.spec.ts b/packages/web/src/generators/application/application.spec.ts index cab0c67e7d4c22..435ee479203fb9 100644 --- a/packages/web/src/generators/application/application.spec.ts +++ b/packages/web/src/generators/application/application.spec.ts @@ -620,8 +620,7 @@ describe('app', () => { expect(tree.read(`my-app/jest.config.ts`, 'utf-8')) .toMatchInlineSnapshot(` - "/* eslint-disable */ - export default { + "export default { displayName: 'my-app', preset: '../jest.preset.js', setupFilesAfterEnv: ['/src/test-setup.ts'], @@ -648,8 +647,7 @@ describe('app', () => { expect(tree.read(`my-app/jest.config.ts`, 'utf-8')) .toMatchInlineSnapshot(` - "/* eslint-disable */ - export default { + "export default { displayName: 'my-app', preset: '../jest.preset.js', setupFilesAfterEnv: ['/src/test-setup.ts'],