@html-validate/eslint-config-protractor 5.28.0 → 6.0.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/index.mjs +50 -14
- package/package.json +6 -5
- package/legacy.cjs +0 -17
package/index.mjs
CHANGED
|
@@ -1,20 +1,56 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import legacyConfig from "./legacy.cjs";
|
|
1
|
+
import globals from "globals";
|
|
2
|
+
import eslintPluginJasmine from "eslint-plugin-jasmine";
|
|
3
|
+
import eslintPluginProtractor from "eslint-plugin-protractor";
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
/**
|
|
6
|
+
* @typedef {import("eslint").Linter.Config} Config
|
|
7
|
+
*/
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
/**
|
|
10
|
+
* @param {Config} config
|
|
11
|
+
* @returns {Config}
|
|
12
|
+
*/
|
|
13
|
+
function defineConfig(config) {
|
|
14
|
+
return config;
|
|
15
|
+
}
|
|
13
16
|
|
|
14
|
-
const
|
|
17
|
+
const severity = {
|
|
18
|
+
0: "off",
|
|
19
|
+
1: "warn",
|
|
20
|
+
2: "error",
|
|
21
|
+
};
|
|
15
22
|
|
|
16
|
-
|
|
17
|
-
|
|
23
|
+
function migrate(config) {
|
|
24
|
+
for (const [rule, options] of Object.entries(config.rules)) {
|
|
25
|
+
if (typeof options === "number") {
|
|
26
|
+
config.rules[rule] = severity[options];
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return config;
|
|
18
30
|
}
|
|
19
31
|
|
|
20
|
-
|
|
32
|
+
const jasmineRecommended = migrate(eslintPluginJasmine.configs.recommended);
|
|
33
|
+
const protractorRecommended = eslintPluginProtractor.configs.recommended;
|
|
34
|
+
|
|
35
|
+
export default defineConfig({
|
|
36
|
+
languageOptions: {
|
|
37
|
+
globals: {
|
|
38
|
+
...eslintPluginProtractor.environments.globals.globals,
|
|
39
|
+
...globals.jasmine,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
plugins: {
|
|
44
|
+
jasmine: eslintPluginJasmine,
|
|
45
|
+
protractor: eslintPluginProtractor,
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
rules: {
|
|
49
|
+
...jasmineRecommended.rules,
|
|
50
|
+
...protractorRecommended.rules,
|
|
51
|
+
"jasmine/new-line-before-expect": "off",
|
|
52
|
+
"jasmine/no-disabled-tests": "warn",
|
|
53
|
+
"jasmine/no-focused-tests": "warn",
|
|
54
|
+
"jasmine/no-spec-dupes": ["error", "branch"],
|
|
55
|
+
},
|
|
56
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@html-validate/eslint-config-protractor",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"description": "Eslint sharable config used by the various HTML-validate packages",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"license": "MIT",
|
|
19
19
|
"author": "David Sveningsson <ext@sidvind.com>",
|
|
20
|
+
"type": "module",
|
|
20
21
|
"main": "index.mjs",
|
|
21
22
|
"files": [
|
|
22
23
|
"*.cjs",
|
|
@@ -28,12 +29,12 @@
|
|
|
28
29
|
"prepublishOnly": "release-prepublish --retain-scripts"
|
|
29
30
|
},
|
|
30
31
|
"dependencies": {
|
|
31
|
-
"@eslint/eslintrc": "3.3.0",
|
|
32
32
|
"eslint-plugin-jasmine": "4.2.2",
|
|
33
|
-
"eslint-plugin-protractor": "2.1.1"
|
|
33
|
+
"eslint-plugin-protractor": "2.1.1",
|
|
34
|
+
"globals": "16.0.0"
|
|
34
35
|
},
|
|
35
36
|
"peerDependencies": {
|
|
36
|
-
"eslint": "^
|
|
37
|
+
"eslint": "^9.0.0"
|
|
37
38
|
},
|
|
38
39
|
"engines": {
|
|
39
40
|
"node": ">= 20.9.0",
|
|
@@ -42,5 +43,5 @@
|
|
|
42
43
|
"publishConfig": {
|
|
43
44
|
"access": "public"
|
|
44
45
|
},
|
|
45
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "f54dcbae0ccae318895e34d32fbfa02b05cd38d1"
|
|
46
47
|
}
|
package/legacy.cjs
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
env: {
|
|
3
|
-
jasmine: true,
|
|
4
|
-
protractor: true,
|
|
5
|
-
},
|
|
6
|
-
|
|
7
|
-
plugins: ["jasmine", "protractor"],
|
|
8
|
-
|
|
9
|
-
extends: ["plugin:jasmine/recommended", "plugin:protractor/recommended"],
|
|
10
|
-
|
|
11
|
-
rules: {
|
|
12
|
-
"jasmine/new-line-before-expect": "off",
|
|
13
|
-
"jasmine/no-disabled-tests": "warn",
|
|
14
|
-
"jasmine/no-focused-tests": "warn",
|
|
15
|
-
"jasmine/no-spec-dupes": ["error", "branch"],
|
|
16
|
-
},
|
|
17
|
-
};
|