@bigbinary/neeto-playwright-commons 1.1.0 → 1.1.2

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.
package/README.md CHANGED
@@ -11,6 +11,22 @@ Install from npm:
11
11
  yarn add "@bigbinary/neeto-playwright-commons@latest"
12
12
  ```
13
13
 
14
+ ## Usage
15
+
16
+ You can import the utility functions and constants from the
17
+ `@bigbinary/neeto-playwright-commons` wherever required.
18
+
19
+ ```js
20
+ import { COMMON_SELECTORS } from "@bigbinary/neeto-playwright-common";
21
+ ```
22
+
23
+ ## Exported Functions
24
+
25
+ - [Common default configurations](./docs/default-configurations.md)
26
+ - [Custom commands](./docs/custom-commands.md)
27
+ - [Util functions](./docs/util-functions.md)
28
+ - [Selectors and texts](./docs/selectors-and-texts.md)
29
+
14
30
  ## Other references
15
31
 
16
32
  - [Development instructions](./docs/general/development-instructions.md)
@@ -0,0 +1,88 @@
1
+ const commonEslintConfig = ({
2
+ ignorePatterns = [],
3
+ extendsOverrides = [],
4
+ overrideRules = {},
5
+ tsconfigRootDir = "",
6
+ }) => {
7
+ return {
8
+ ignorePatterns,
9
+ env: { browser: true, es2021: true, node: true },
10
+ extends: [
11
+ "eslint:recommended",
12
+ "plugin:@typescript-eslint/recommended",
13
+ "plugin:playwright/recommended",
14
+ ...extendsOverrides,
15
+ ],
16
+ overrides: [
17
+ {
18
+ env: { node: true },
19
+ files: [".eslintrc.{js,cjs}"],
20
+ parserOptions: { sourceType: "script" },
21
+ },
22
+ {
23
+ env: { node: true },
24
+ files: ["*.ts", "*.spec.ts"],
25
+ parser: "@typescript-eslint/parser",
26
+ parserOptions: {
27
+ ecmaVersion: "latest",
28
+ sourceType: "module",
29
+ tsconfigRootDir,
30
+ project: ["./tsconfig.json"],
31
+ },
32
+ plugins: ["@typescript-eslint", "import"],
33
+ rules: {
34
+ "@typescript-eslint/no-floating-promises": "error",
35
+ "no-unused-vars": "off",
36
+ "@typescript-eslint/no-unused-vars": ["error"],
37
+ "@typescript-eslint/no-explicit-any": [
38
+ "error",
39
+ { ignoreRestArgs: true },
40
+ ],
41
+
42
+ "playwright/expect-expect": "off",
43
+ "playwright/no-conditional-in-test": "warn",
44
+ "playwright/no-nth-methods": "error",
45
+ "playwright/no-page-pause": "error",
46
+ "playwright/no-raw-locators": "warn",
47
+ "playwright/no-useless-await": "error",
48
+ "playwright/no-useless-not": "error",
49
+ "playwright/no-wait-for-timeout": "error",
50
+ "playwright/prefer-strict-equal": "warn",
51
+ "playwright/prefer-to-be": "warn",
52
+ "playwright/prefer-to-contain": "error",
53
+ "playwright/prefer-to-have-count": "error",
54
+ "playwright/prefer-to-have-length": "error",
55
+ "playwright/prefer-web-first-assertions": "error",
56
+ "playwright/require-top-level-describe": "error",
57
+ "playwright/require-soft-assertions": "off",
58
+ "playwright/valid-expect": "error",
59
+ "playwright/prefer-lowercase-title": [
60
+ "error",
61
+ { ignoreTopLevelDescribe: true, allowedPrefixes: ["Step"] },
62
+ ],
63
+ "import/order": [
64
+ "error",
65
+ {
66
+ "newlines-between": "always",
67
+ alphabetize: { order: "asc", caseInsensitive: true },
68
+ warnOnUnassignedImports: true,
69
+ groups: [
70
+ "builtin",
71
+ "external",
72
+ "internal",
73
+ "index",
74
+ "sibling",
75
+ "parent",
76
+ "object",
77
+ "type",
78
+ ],
79
+ },
80
+ ],
81
+ ...overrideRules,
82
+ },
83
+ },
84
+ ],
85
+ };
86
+ };
87
+
88
+ module.exports = commonEslintConfig;
@@ -0,0 +1,15 @@
1
+ const eslintConfig = require("./common");
2
+
3
+ const hostEslintConfig = ({ rules = {}, tsconfigRootDir = "" }) => {
4
+ return eslintConfig({
5
+ tsconfigRootDir,
6
+ extendsOverrides: ["../.eslintrc.js"],
7
+ overrideRules: {
8
+ "@bigbinary/neeto/use-standard-date-time-formats": "warn",
9
+ "@bigbinary/neeto/no-dangling-constants": "off",
10
+ ...rules,
11
+ },
12
+ });
13
+ };
14
+
15
+ module.exports = hostEslintConfig;