@bigbinary/neeto-playwright-commons 1.21.3 → 1.22.0
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/configs/eslint/common.js +112 -79
- package/configs/eslint/host.js +30 -5
- package/index.cjs.js +1018 -941
- package/index.cjs.js.map +1 -1
- package/index.d.ts +11 -1
- package/index.js +1018 -941
- package/index.js.map +1 -1
- package/package.json +10 -5
package/configs/eslint/common.js
CHANGED
|
@@ -1,95 +1,128 @@
|
|
|
1
|
+
import neeto from "@bigbinary/eslint-plugin-neeto";
|
|
2
|
+
import js from "@eslint/js";
|
|
3
|
+
import tsEslint from "@typescript-eslint/eslint-plugin";
|
|
4
|
+
import tsParser from "@typescript-eslint/parser";
|
|
5
|
+
import playwrightPlugin from "eslint-plugin-playwright";
|
|
6
|
+
import importPlugin from "eslint-plugin-import";
|
|
7
|
+
import globals from "globals";
|
|
8
|
+
import path from "path";
|
|
9
|
+
|
|
1
10
|
const commonEslintConfig = ({
|
|
2
|
-
|
|
11
|
+
ignores = [],
|
|
3
12
|
extendsOverrides = [],
|
|
4
13
|
overrideRules = {},
|
|
5
14
|
tsconfigRootDir = "",
|
|
6
15
|
}) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
env: { node: true },
|
|
19
|
-
files: [".eslintrc.{js,cjs}"],
|
|
20
|
-
parserOptions: { sourceType: "script", requireConfigFile: false },
|
|
21
|
-
rules: { "@typescript-eslint/no-var-requires": "off" },
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
env: { node: true },
|
|
25
|
-
files: ["*.ts", "*.spec.ts"],
|
|
26
|
-
parser: "@typescript-eslint/parser",
|
|
16
|
+
const configs = [
|
|
17
|
+
js.configs.recommended,
|
|
18
|
+
{
|
|
19
|
+
ignores: [...ignores],
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
{
|
|
23
|
+
files: ["**/*.ts", "**/*.spec.ts"],
|
|
24
|
+
ignores: ["**/*.d.ts"],
|
|
25
|
+
languageOptions: {
|
|
26
|
+
parser: tsParser,
|
|
27
27
|
parserOptions: {
|
|
28
28
|
ecmaVersion: "latest",
|
|
29
29
|
sourceType: "module",
|
|
30
30
|
tsconfigRootDir,
|
|
31
31
|
project: ["./tsconfig.json"],
|
|
32
32
|
},
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
33
|
+
globals: {
|
|
34
|
+
...globals.browser,
|
|
35
|
+
...globals.es2021,
|
|
36
|
+
...globals.node,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
plugins: {
|
|
40
|
+
"@typescript-eslint": tsEslint,
|
|
41
|
+
playwright: playwrightPlugin,
|
|
42
|
+
import: importPlugin,
|
|
43
|
+
"@bigbinary/neeto": neeto,
|
|
44
|
+
},
|
|
45
|
+
rules: {
|
|
46
|
+
...tsEslint.configs.recommended.rules,
|
|
47
|
+
...playwrightPlugin.configs.recommended.rules,
|
|
48
|
+
|
|
49
|
+
"@bigbinary/neeto/use-dayjs-from-neeto-commons-fronted": "off",
|
|
50
|
+
"@bigbinary/neeto/use-array-methods": "off",
|
|
51
|
+
"@typescript-eslint/no-floating-promises": "error",
|
|
52
|
+
"no-unused-vars": "off",
|
|
53
|
+
"@typescript-eslint/no-unused-vars": [
|
|
54
|
+
"error",
|
|
55
|
+
{ destructuredArrayIgnorePattern: "^_" },
|
|
56
|
+
],
|
|
57
|
+
"@typescript-eslint/no-explicit-any": [
|
|
58
|
+
"error",
|
|
59
|
+
{ ignoreRestArgs: true },
|
|
60
|
+
],
|
|
61
|
+
"@typescript-eslint/no-unused-expressions": [
|
|
62
|
+
"error",
|
|
63
|
+
{ allowShortCircuit: true, allowTernary: true },
|
|
64
|
+
],
|
|
47
65
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
66
|
+
"playwright/expect-expect": "off",
|
|
67
|
+
"playwright/no-conditional-in-test": "warn",
|
|
68
|
+
"playwright/no-nth-methods": "error",
|
|
69
|
+
"playwright/no-page-pause": "error",
|
|
70
|
+
"playwright/no-raw-locators": "warn",
|
|
71
|
+
"playwright/no-useless-await": "error",
|
|
72
|
+
"playwright/no-useless-not": "error",
|
|
73
|
+
"playwright/no-wait-for-timeout": "error",
|
|
74
|
+
"playwright/prefer-strict-equal": "warn",
|
|
75
|
+
"playwright/prefer-to-be": "warn",
|
|
76
|
+
"playwright/prefer-to-contain": "error",
|
|
77
|
+
"playwright/prefer-to-have-count": "error",
|
|
78
|
+
"playwright/prefer-to-have-length": "error",
|
|
79
|
+
"playwright/prefer-web-first-assertions": "error",
|
|
80
|
+
"playwright/require-top-level-describe": "error",
|
|
81
|
+
"playwright/require-soft-assertions": "off",
|
|
82
|
+
"playwright/valid-expect": "error",
|
|
83
|
+
"playwright/no-standalone-expect": "warn",
|
|
84
|
+
"playwright/valid-title": [
|
|
85
|
+
"warn",
|
|
86
|
+
{ mustMatch: { test: "^(must|should)" }, ignoreTypeOfStepName: true },
|
|
87
|
+
],
|
|
88
|
+
"playwright/prefer-lowercase-title": [
|
|
89
|
+
"error",
|
|
90
|
+
{ ignoreTopLevelDescribe: true, allowedPrefixes: ["Step"] },
|
|
91
|
+
],
|
|
92
|
+
"import/order": [
|
|
93
|
+
"error",
|
|
94
|
+
{
|
|
95
|
+
"newlines-between": "always",
|
|
96
|
+
alphabetize: { order: "asc", caseInsensitive: true },
|
|
97
|
+
warnOnUnassignedImports: true,
|
|
98
|
+
groups: [
|
|
99
|
+
"builtin",
|
|
100
|
+
"external",
|
|
101
|
+
"internal",
|
|
102
|
+
"index",
|
|
103
|
+
"sibling",
|
|
104
|
+
"parent",
|
|
105
|
+
"object",
|
|
106
|
+
"type",
|
|
107
|
+
],
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
...overrideRules,
|
|
111
|
+
},
|
|
112
|
+
settings: {
|
|
113
|
+
"import/resolver": {
|
|
114
|
+
typescript: {
|
|
115
|
+
alwaysTryTypes: true,
|
|
116
|
+
project: path.join(tsconfigRootDir, "tsconfig.json"),
|
|
117
|
+
},
|
|
89
118
|
},
|
|
90
119
|
},
|
|
91
|
-
|
|
92
|
-
|
|
120
|
+
},
|
|
121
|
+
|
|
122
|
+
...extendsOverrides,
|
|
123
|
+
];
|
|
124
|
+
|
|
125
|
+
return configs;
|
|
93
126
|
};
|
|
94
127
|
|
|
95
|
-
|
|
128
|
+
export default commonEslintConfig;
|
package/configs/eslint/host.js
CHANGED
|
@@ -1,17 +1,42 @@
|
|
|
1
|
-
|
|
1
|
+
import path from "path";
|
|
2
|
+
import eslintConfig from "./common.js";
|
|
3
|
+
import { fileURLToPath } from "url";
|
|
4
|
+
import { dirname } from "path";
|
|
2
5
|
|
|
3
|
-
const
|
|
6
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = dirname(__filename);
|
|
8
|
+
|
|
9
|
+
const hostEslintConfig = ({ rules = {}, tsconfigRootDir = "", ignores }) => {
|
|
4
10
|
return eslintConfig({
|
|
5
11
|
tsconfigRootDir,
|
|
6
|
-
extendsOverrides: ["../.eslintrc.js"],
|
|
7
12
|
overrideRules: {
|
|
8
|
-
"
|
|
13
|
+
"import/named": "off",
|
|
14
|
+
"react-hooks/rules-of-hooks": "off",
|
|
15
|
+
"@bigbinary/neeto/no-missing-localization": [
|
|
16
|
+
"warn",
|
|
17
|
+
{
|
|
18
|
+
translationsDir: path.resolve(
|
|
19
|
+
__dirname,
|
|
20
|
+
"../../../../../..",
|
|
21
|
+
"app/javascript/src/translations"
|
|
22
|
+
),
|
|
23
|
+
languages: ["en"],
|
|
24
|
+
nanosTranslationDir: [
|
|
25
|
+
path.resolve(
|
|
26
|
+
__dirname,
|
|
27
|
+
"../../../../../..",
|
|
28
|
+
"node_modules/@bigbinary/neeto-commons-frontend/translations"
|
|
29
|
+
),
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
],
|
|
9
33
|
"@bigbinary/neeto/use-standard-date-time-formats": "warn",
|
|
10
34
|
"@bigbinary/neeto/no-dangling-constants": "off",
|
|
11
35
|
"@bigbinary/neeto/use-webpack-alias": "off",
|
|
12
36
|
...rules,
|
|
13
37
|
},
|
|
38
|
+
ignores,
|
|
14
39
|
});
|
|
15
40
|
};
|
|
16
41
|
|
|
17
|
-
|
|
42
|
+
export default hostEslintConfig;
|