@nx/cypress 23.2.0-beta.5 → 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,5 +1,5 @@
1
1
  import { GeneratorCallback, Tree } from '@nx/devkit';
2
- import { Linter, LinterType } from '@nx/eslint';
2
+ import { LinterType } from '@nx/js';
3
3
  export interface CypressE2EConfigSchema {
4
4
  project: string;
5
5
  baseUrl?: string;
@@ -14,7 +14,7 @@ export interface CypressE2EConfigSchema {
14
14
  skipPackageJson?: boolean;
15
15
  bundler?: 'webpack' | 'vite' | 'none';
16
16
  devServerTarget?: string;
17
- linter?: Linter | LinterType;
17
+ linter?: LinterType;
18
18
  port?: number | 'cypress-auto';
19
19
  jsx?: boolean;
20
20
  rootProject?: boolean;
@@ -44,9 +44,9 @@
44
44
  "default": "cypress"
45
45
  },
46
46
  "linter": {
47
- "description": "The tool to use for running lint checks.",
47
+ "description": "The tool to use for running lint checks. Defaults to the linter the workspace already uses.",
48
48
  "type": "string",
49
- "enum": ["none", "eslint"],
49
+ "enum": ["none", "eslint", "oxlint"],
50
50
  "x-priority": "important"
51
51
  },
52
52
  "js": {
@@ -1,8 +1,8 @@
1
1
  import { GeneratorCallback, Tree } from '@nx/devkit';
2
- import { Linter, LinterType } from '@nx/eslint';
2
+ import { type LinterType } from '@nx/js';
3
3
  export interface CyLinterOptions {
4
4
  project: string;
5
- linter: Linter | LinterType;
5
+ linter: LinterType;
6
6
  enableTypedLinting?: boolean;
7
7
  /**
8
8
  * @deprecated Use `enableTypedLinting` instead. This option will be removed in Nx v24.
@@ -2,9 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.addLinterToCyProject = addLinterToCyProject;
4
4
  const devkit_1 = require("@nx/devkit");
5
- const eslint_1 = require("@nx/eslint");
6
5
  const internal_1 = require("@nx/eslint/internal");
7
6
  const versions_1 = require("./versions");
7
+ const internal_2 = require("@nx/js/internal");
8
8
  async function addLinterToCyProject(tree, options) {
9
9
  if (options.linter === 'none') {
10
10
  return () => { };
@@ -13,11 +13,13 @@ async function addLinterToCyProject(tree, options) {
13
13
  const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, options.project);
14
14
  const eslintFile = (0, internal_1.findEslintFile)(tree, projectConfig.root);
15
15
  const enableTypedLinting = (0, internal_1.isTypedLintingEnabled)(options);
16
- if (!eslintFile) {
17
- tasks.push(await (0, eslint_1.lintProjectGenerator)(tree, {
16
+ // Register whichever linter was asked for. An existing ESLint config means
17
+ // the project is already registered, so skip straight to the Cypress-specific
18
+ // shaping below.
19
+ if (options.linter !== 'eslint' || !eslintFile) {
20
+ tasks.push(await (0, internal_2.addLintingToProject)(tree, {
18
21
  project: options.project,
19
22
  linter: options.linter,
20
- skipFormat: true,
21
23
  tsConfigPaths: [(0, devkit_1.joinPathFragments)(projectConfig.root, 'tsconfig.json')],
22
24
  enableTypedLinting,
23
25
  skipPackageJson: options.skipPackageJson,
@@ -25,7 +27,9 @@ async function addLinterToCyProject(tree, options) {
25
27
  addPlugin: options.addPlugin,
26
28
  }));
27
29
  }
28
- if (!options.linter || options.linter !== 'eslint') {
30
+ // Everything below configures ESLint — predefined configs, `extends`, ignore
31
+ // entries — which have no equivalent in other linters.
32
+ if (options.linter !== 'eslint') {
29
33
  return (0, devkit_1.runTasksInSerial)(...tasks);
30
34
  }
31
35
  options.overwriteExisting = options.overwriteExisting || !eslintFile;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/cypress",
3
- "version": "23.2.0-beta.5",
3
+ "version": "23.2.0-beta.7",
4
4
  "private": false,
5
5
  "type": "commonjs",
6
6
  "files": [
@@ -89,12 +89,12 @@
89
89
  "semver": "^7.6.3",
90
90
  "tree-kill": "^1.2.2",
91
91
  "tslib": "^2.3.0",
92
- "@nx/devkit": "23.2.0-beta.5",
93
- "@nx/eslint": "23.2.0-beta.5",
94
- "@nx/js": "23.2.0-beta.5"
92
+ "@nx/devkit": "23.2.0-beta.7",
93
+ "@nx/eslint": "23.2.0-beta.7",
94
+ "@nx/js": "23.2.0-beta.7"
95
95
  },
96
96
  "devDependencies": {
97
- "nx": "23.2.0-beta.5"
97
+ "nx": "23.2.0-beta.7"
98
98
  },
99
99
  "peerDependencies": {
100
100
  "cypress": ">= 13 < 16"