@nx/detox 23.2.0-beta.6 → 23.2.0-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,26 +1,28 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.addLinting = addLinting;
4
- const eslint_1 = require("@nx/eslint");
5
4
  const devkit_1 = require("@nx/devkit");
6
5
  const react_1 = require("@nx/react");
7
6
  const internal_1 = require("@nx/eslint/internal");
7
+ const internal_2 = require("@nx/js/internal");
8
8
  async function addLinting(host, options) {
9
- if (options.linter === 'none') {
10
- return () => { };
11
- }
12
9
  const tasks = [];
13
- const lintTask = await (0, eslint_1.lintProjectGenerator)(host, {
10
+ tasks.push(await (0, internal_2.addLintingToProject)(host, {
14
11
  linter: options.linter,
15
12
  project: options.e2eProjectName,
16
13
  tsConfigPaths: [
17
14
  (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, 'tsconfig.app.json'),
18
15
  ],
19
- skipFormat: true,
20
16
  enableTypedLinting: (0, internal_1.isTypedLintingEnabled)(options),
21
17
  addPlugin: options.addPlugin,
22
- });
23
- tasks.push(lintTask);
18
+ // Detox e2e specs are Jest; this is what enables the linter's Jest rules.
19
+ unitTestRunner: 'jest',
20
+ }));
21
+ // Everything below configures ESLint — predefined configs, `extends`, ignore
22
+ // entries — which have no equivalent in other linters.
23
+ if (options.linter && options.linter !== 'eslint') {
24
+ return (0, devkit_1.runTasksInSerial)(...tasks);
25
+ }
24
26
  if ((0, internal_1.isEslintConfigSupported)(host)) {
25
27
  if ((0, internal_1.useFlatConfig)(host)) {
26
28
  (0, internal_1.addPredefinedConfigToFlatLintConfig)(host, options.e2eProjectRoot, 'flat/react', { checkBaseConfig: true });
@@ -22,6 +22,9 @@ async function normalizeOptions(host, options) {
22
22
  const useProjectJson = options.useProjectJson ?? !isUsingTsSolutionConfig;
23
23
  return {
24
24
  ...options,
25
+ // The two guards downstream spell the check differently and disagree on
26
+ // `undefined`, so resolve it to a concrete linter here.
27
+ linter: await (0, internal_2.normalizeLinterOption)(host, options.linter),
25
28
  appFileName,
26
29
  appClassName,
27
30
  appDisplayName: options.appDisplayName || appClassName,
@@ -1,4 +1,4 @@
1
- import type { Linter, LinterType } from '@nx/eslint';
1
+ import type { LinterType } from '@nx/js';
2
2
 
3
3
  export interface Schema {
4
4
  appProject: string; // name of the project app to be tested (directory + app name), case insensitive
@@ -6,7 +6,7 @@ export interface Schema {
6
6
  appName?: string; // name of app to be tested if different form appProject, case insensitive
7
7
  e2eDirectory: string; // the directory where e2e app going to be located
8
8
  e2eName?: string; // name of the e2e app
9
- linter?: Linter | LinterType;
9
+ linter?: LinterType;
10
10
  js?: boolean;
11
11
  skipFormat?: boolean;
12
12
  enableTypedLinting?: boolean;
@@ -40,10 +40,9 @@
40
40
  "x-prompt": "What app framework should detox test?"
41
41
  },
42
42
  "linter": {
43
- "description": "The tool to use for running lint checks.",
43
+ "description": "The tool to use for running lint checks. Defaults to the linter the workspace already uses.",
44
44
  "type": "string",
45
- "enum": ["eslint", "none"],
46
- "default": "eslint"
45
+ "enum": ["eslint", "oxlint", "none"]
47
46
  },
48
47
  "js": {
49
48
  "description": "Generate JavaScript files rather than TypeScript files.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/detox",
3
- "version": "23.2.0-beta.6",
3
+ "version": "23.2.0-beta.7",
4
4
  "private": false,
5
5
  "description": "The Nx Plugin for Detox contains executors and generators for allowing your workspace to use the powerful Detox integration testing capabilities.",
6
6
  "keywords": [
@@ -37,14 +37,14 @@
37
37
  "dependencies": {
38
38
  "semver": "^7.6.3",
39
39
  "tslib": "^2.3.0",
40
- "@nx/devkit": "23.2.0-beta.6",
41
- "@nx/jest": "23.2.0-beta.6",
42
- "@nx/js": "23.2.0-beta.6",
43
- "@nx/eslint": "23.2.0-beta.6",
44
- "@nx/react": "23.2.0-beta.6"
40
+ "@nx/devkit": "23.2.0-beta.7",
41
+ "@nx/jest": "23.2.0-beta.7",
42
+ "@nx/js": "23.2.0-beta.7",
43
+ "@nx/eslint": "23.2.0-beta.7",
44
+ "@nx/react": "23.2.0-beta.7"
45
45
  },
46
46
  "devDependencies": {
47
- "nx": "23.2.0-beta.6"
47
+ "nx": "23.2.0-beta.7"
48
48
  },
49
49
  "peerDependencies": {
50
50
  "detox": "^20.0.0"