@nx/playwright 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,4 +1,4 @@
1
- import type { Linter, LinterType } from '@nx/eslint';
1
+ import type { LinterType } from '@nx/js';
2
2
 
3
3
  export interface ConfigurationGeneratorSchema {
4
4
  project: string;
@@ -10,7 +10,7 @@ export interface ConfigurationGeneratorSchema {
10
10
  skipFormat?: boolean;
11
11
  skipPackageJson?: boolean;
12
12
  skipInstall?: boolean;
13
- linter?: Linter | LinterType;
13
+ linter?: LinterType;
14
14
  enableTypedLinting?: boolean; // default is false
15
15
  /**
16
16
  * @deprecated Use `enableTypedLinting` instead. This option will be removed in Nx v24.
@@ -34,5 +34,5 @@ export interface NormalizedGeneratorOptions
34
34
  extends ConfigurationGeneratorSchema {
35
35
  addPlugin: boolean;
36
36
  directory: string;
37
- linter: Linter | LinterType;
37
+ linter: LinterType;
38
38
  }
@@ -21,9 +21,9 @@
21
21
  "default": "e2e"
22
22
  },
23
23
  "linter": {
24
- "description": "The tool to use for running lint checks.",
24
+ "description": "The tool to use for running lint checks. Defaults to the linter the workspace already uses.",
25
25
  "type": "string",
26
- "enum": ["none", "eslint"],
26
+ "enum": ["none", "eslint", "oxlint"],
27
27
  "x-priority": "important"
28
28
  },
29
29
  "js": {
@@ -1,8 +1,8 @@
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 PlaywrightLinterOptions {
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.addLinterToPlaywrightProject = addLinterToPlaywrightProject;
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 addLinterToPlaywrightProject(tree, options) {
9
9
  if (options.linter === 'none') {
10
10
  return () => { };
@@ -13,11 +13,12 @@ async function addLinterToPlaywrightProject(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
+ // An existing ESLint config means the project is already registered, so skip
17
+ // straight to the Playwright-specific shaping below.
18
+ if (options.linter !== 'eslint' || !eslintFile) {
19
+ tasks.push(await (0, internal_2.addLintingToProject)(tree, {
18
20
  project: options.project,
19
21
  linter: options.linter,
20
- skipFormat: true,
21
22
  tsConfigPaths: [(0, devkit_1.joinPathFragments)(projectConfig.root, 'tsconfig.json')],
22
23
  enableTypedLinting,
23
24
  skipPackageJson: options.skipPackageJson,
@@ -25,7 +26,9 @@ async function addLinterToPlaywrightProject(tree, options) {
25
26
  addPlugin: options.addPlugin,
26
27
  }));
27
28
  }
28
- if (!options.linter || options.linter !== 'eslint') {
29
+ // Everything below configures ESLint predefined configs, `extends`, ignore
30
+ // entries — which have no equivalent in other linters.
31
+ if (options.linter !== 'eslint') {
29
32
  return (0, devkit_1.runTasksInSerial)(...tasks);
30
33
  }
31
34
  tasks.push(!options.skipPackageJson
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/playwright",
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": [
@@ -78,12 +78,12 @@
78
78
  "tslib": "^2.3.0",
79
79
  "minimatch": "10.2.5",
80
80
  "semver": "^7.6.3",
81
- "@nx/devkit": "23.2.0-beta.5",
82
- "@nx/eslint": "23.2.0-beta.5",
83
- "@nx/js": "23.2.0-beta.5"
81
+ "@nx/devkit": "23.2.0-beta.7",
82
+ "@nx/eslint": "23.2.0-beta.7",
83
+ "@nx/js": "23.2.0-beta.7"
84
84
  },
85
85
  "devDependencies": {
86
- "nx": "23.2.0-beta.5"
86
+ "nx": "23.2.0-beta.7"
87
87
  },
88
88
  "peerDependencies": {
89
89
  "@playwright/test": "^1.36.0"