@admc.com/eslintplugin-sn-test 1.1.5 → 2.0.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
@@ -24,3 +24,5 @@ link (non-global) link feature, but this has side-effects since the intermediate
24
24
  at a shared location on your computer.
25
25
  Less invasive is to just manually wipe the subdirectory node_modules/@admc.com/eslint-plugin-sn/
26
26
  and replace it with a symlink (or copy) of the development eslint-plugin-sn project directory.
27
+ Be aware that "npm update" will wipe the sym link and replace it with what is found from a
28
+ regular module resolution.
@@ -0,0 +1 @@
1
+ if (gs.getUserName() === null) throw new Error("bad");
@@ -0,0 +1 @@
1
+ console.info(`Value is ${location}`);
@@ -0,0 +1 @@
1
+ // A ${curly + 3} expression in a comment
@@ -0,0 +1,4 @@
1
+ if (input.datum) {
2
+ data.datum = input.datum;
3
+ gs.log("Set datum for client", "src");
4
+ }
@@ -0,0 +1,6 @@
1
+ (function() {
2
+ if (uther.datum) {
3
+ data.datum = 'indication';
4
+ gs.log("Set datum for client", "src");
5
+ }
6
+ })();
@@ -0,0 +1,6 @@
1
+ (function() {
2
+ if (input.datum) {
3
+ data.datum = input.datum;
4
+ gs.log("Set datum for client", "src");
5
+ }
6
+ })();
@@ -0,0 +1,11 @@
1
+ let v = "four";
2
+ const dblr = v=>{'use strict'; return v+v;};
3
+
4
+ api.onLoad = function($scope) {
5
+ "use strict";
6
+ console.info('Running api.onLoad');
7
+ $scope.thisRef = this;
8
+ };
9
+
10
+ v = dblr(v);
11
+ console.info(window.name, v, jQuery("body").length, document.URL);
@@ -0,0 +1,2 @@
1
+ console.info(location + ` now in multi-line
2
+ backtick string`);
@@ -0,0 +1,6 @@
1
+ (function() {
2
+ if (input.datum) {
3
+ data.datum = input.datum;
4
+ gs.log("Set datum for client", "src");
5
+ }
6
+ })();
@@ -0,0 +1,6 @@
1
+ (function() {
2
+ if (input.datum) {
3
+ data.datum = input.datum;
4
+ gs.info("Set datum for client");
5
+ }
6
+ })();
package/masterTest.js CHANGED
@@ -5,9 +5,23 @@ if (!__filename.startsWith(process.cwd() + "/")) // eslint-disable-line prefer-
5
5
  const relTestPath = __filename.substring(process.cwd().length + 1);
6
6
  const path = require("path");
7
7
  const fs = require("fs");
8
- const ex = /^test[/](good|bad)[/](?:(\w+)[/])?([\w.]+[/]\w+)-test[.]js$/.exec(relTestPath);
8
+ const ex =
9
+ /^test[/](good|bad|reallybad)[/](?:(\w+)[/])?([\w.]+[/]\w+)-test[.]js$/.exec(relTestPath);
9
10
  if (!ex) throw new Error(`Bad test file path: ${relTestPath}`);
10
- const shouldSucceed = ex[1] === "good";
11
+ let expectExitVal;
12
+ switch (ex[1]) {
13
+ case "good":
14
+ expectExitVal = 0;
15
+ break;
16
+ case "bad":
17
+ expectExitVal = 1;
18
+ break;
19
+ case "reallybad":
20
+ expectExitVal = 253;
21
+ break;
22
+ }
23
+ if (expectExitVal === undefined)
24
+ throw new Error(`eslintplugin-sn-test framework doesn't support test sub-type '${ex[1]}'`);
11
25
  const altscope = ex[2];
12
26
  const tableBase = ex[3];
13
27
  // eslint-disable-next-line no-extra-parens, prefer-template
@@ -24,7 +38,6 @@ const childProcess = require("child_process").
24
38
  spawnSync(process.execPath, params, { stdio: "inherit" });
25
39
 
26
40
  it(altscope ? `${tableBase} | ${altscope}` : tableBase, () => {
27
- if (shouldSucceed && childProcess.status !== 0
28
- || !shouldSucceed && childProcess.status !== 1)
41
+ if (expectExitVal !== childProcess.status)
29
42
  throw new Error(`Failed with code ${childProcess.status}`);
30
43
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@admc.com/eslintplugin-sn-test",
3
- "version": "1.1.5",
3
+ "version": "2.0.2",
4
4
  "description": "External tests for ESLint plugin @admc.com/eslint-plugin-sn",
5
5
  "scripts": {
6
6
  "test": "mocha --recursive",
@@ -28,6 +28,6 @@
28
28
  "mocha": "^10.0.0"
29
29
  },
30
30
  "peerDependencies": {
31
- "@admc.com/eslint-plugin-sn": "^1.1.10"
31
+ "@admc.com/eslint-plugin-sn": "^2.0.8"
32
32
  }
33
33
  }
package/populateTest.bash CHANGED
@@ -51,16 +51,17 @@ TMPFILE="$TMPDIR/${PROGNAME#.*}.$$"
51
51
  trap 'rm -f "$TMPFILE"' EXIT
52
52
  [ -d goodScripts ] || Abort "Directory 'goodScripts' is missing"
53
53
  [ -d badScripts ] || Abort "Directory 'badScripts' is missing"
54
- find goodScripts badScripts -name '*.js' > "$TMPFILE" ||
54
+ [ -d reallybadScripts ] || Abort "Directory 'badScripts' is missing"
55
+ find goodScripts badScripts reallybadScripts -name '*.js' > "$TMPFILE" ||
55
56
  Abort 'find command failed'
56
57
  [ -n "$REPLACE_MODE" ] && rm -rf test/good test/bad
57
58
  while read SCRIPT_PATH; do
58
59
  GB=
59
60
  case "$SCRIPT_PATH" in
60
- badScripts/*) GB=bad;;
61
- goodScripts/*) GB=good;;
61
+ badScripts/*|goodScripts/*|reallybadScripts/*) ;;
62
62
  *) Abort "Unexpected SCRIPT_PATH prefix: $SCRIPT_PATH";;
63
63
  esac
64
+ GB="${SCRIPT_PATH%%Scripts*}"
64
65
  REBASED="test/$GB/${SCRIPT_PATH#*Scripts/}"
65
66
  TEST_PATH="${REBASED%.js}-test.js"
66
67
  [ -e "$TEST_PATH" ] && {
@@ -1 +1,2 @@
1
+ "use strict";
1
2
  if ([].forEach === undefined) throw new Error("Should never get this");
@@ -1 +1,2 @@
1
+ "use strict";
1
2
  if ([].forEach === undefined) throw new Error("Should never get this");
@@ -1 +1,2 @@
1
+ "use strict";
1
2
  if ([].forEach === undefined) throw new Error("Should never get this");
package/sneslintrc.json CHANGED
@@ -27,8 +27,11 @@
27
27
  },
28
28
  "overrides": [
29
29
  {
30
+ "files": ["**/sys_ui_script/*/*.js"],
31
+ "rules": { "@admc.com/sn/no-uiscript-curlyref": "error" }
32
+ },{ // ES6 overrides
30
33
  "files": [
31
- "**//@(global|scoped)/*.js",
34
+ "**/@(global|scoped)/*.js",
32
35
  "**/sys_ui_action/@(iso|noniso)_@(global|scoped)action/*.js"
33
36
  ]
34
37
  },{ // ES6 overrides
@@ -40,7 +43,8 @@
40
43
  "no-useless-rename": "error",
41
44
  "no-var": "error",
42
45
  "prefer-template": "error"
43
- },
46
+ }
47
+ }, {
44
48
  "files": [ "**/sys_ui_script/*.js" ],
45
49
  "rules": {
46
50
  "strict": ["error", "safe"],
@@ -53,14 +57,13 @@
53
57
  "files": [ "**/custom_table/custom_alt/*.js" ],
54
58
  "env": {"@admc.com/sn/sn_server_global": true },
55
59
  "rules": {
56
- "@admc.com/sn/invalid-table-altscope": "off",
60
+ "@admc.com/sn/invalid-table-alt": "off",
57
61
  "@admc.com/sn/log-global-2-args": "error",
58
62
  "@admc.com/sn/no-log-scoped": "error"
59
63
  }
60
64
  }
61
65
  ],
62
66
  "settings": {
63
- "customTables": ["custom_table"],
64
- "customAlts": ["custom_alt"]
67
+ "customTables": {"custom_table": ["custom_alt"]}
65
68
  }
66
69
  }
@@ -1,2 +0,0 @@
1
- const msg = "a ok";
2
- console.info(msg + " now");