@admc.com/eslintplugin-sn-test 1.0.2 → 1.0.3

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,2 +1,4 @@
1
+ (function() {
1
2
  var unusedVar = undefined;
2
3
  if (!unusedVar) gs.log("notset", "2nd");
4
+ })(previous, current);
@@ -0,0 +1,3 @@
1
+ (function() {
2
+ console.log("This will fail", "blaine");
3
+ }(); // Invocation params here is what is constrained
@@ -0,0 +1 @@
1
+ console.log("here without IIFE", "blaine");
@@ -1 +1,3 @@
1
+ (function() {
1
2
  var unusedVar = 3;
3
+ })(previous, current);
@@ -0,0 +1,3 @@
1
+ (function() {
2
+ console.log("This will fail", "blaine");
3
+ }(alpha, beta); // Invocation params here is what is constrained
@@ -0,0 +1,2 @@
1
+ function fn() { gs.log("I do nothing", "src"); }
2
+ fn();
@@ -0,0 +1,4 @@
1
+ const gr = new GlideRecord("sys_script_fix");
2
+ gr.setLimit(1);
3
+ gr.next();
4
+ gs.log("Got sys_script_fix " + gr.sys_id, "src");
@@ -0,0 +1,3 @@
1
+ const ar = ["alpha", "beta", "gamma"];
2
+ var i = 0;
3
+ for (i = 0; i < ar.length; i++) gs.log("#" + (i+1) + " = " + ar[i], "src");
@@ -1,2 +1,4 @@
1
+ (function() {
1
2
  let x = 3;
2
3
  gs.log(3, 'src');
4
+ })(previous, current);
@@ -1,4 +1,4 @@
1
- var TstCls = Class.create();
1
+ const TstCls = Class.create();
2
2
  TstCls.prototype.initialize = function(o) {
3
3
  this.o = o;
4
4
  this.p = String(Packages.java.lang.System.getProperty(o));
@@ -1,3 +1,4 @@
1
+ (function() {
1
2
  // Test availability of global vars from the different component lists:
2
3
  gs.log("a message", "a source"); // coreServerObjects.txt
3
4
  gs.log(SNC.CMDBUtil.getTables0("sys_db_object"), "src"); // directly in exports.js
@@ -9,3 +10,4 @@ gs.log(varsAreAllowed, "2nd");
9
10
  const con = "a val";
10
11
  con += "addition"; // Can't test for const changes
11
12
  gs.log(con, "2nd");
13
+ })(previous, current);
@@ -1,7 +1,7 @@
1
1
  // This passes test because we assign to the new class.
2
2
  // This is how SI classes are generally instantiated on SN, because this
3
3
  // is how the auto-generated code templates do it.
4
- var OtherAjaxProcessor = Class.create();
4
+ const OtherAjaxProcessor = Class.create();
5
5
 
6
6
  OtherAjaxProcessor.prototype = Object.extendsObject(AbstractAjaxProcessor, {
7
7
  type: "OtherAjaxProcessor",
@@ -1,3 +1,4 @@
1
+ (function() {
1
2
  // Test availability of scoped vars from the different component lists:
2
3
  gs.info(new sn_ws_err.NotAcceptableError("fake err")); // coreServerObjects.txt
3
4
  gs.info(Object.keys(new sn_codesearch.CodeSearch()).length); // SIScopes
@@ -8,3 +9,4 @@ gs.info(varsAreAllowed);
8
9
  const con = "a val";
9
10
  con += "addition"; // Can't test for const changes
10
11
  gs.info(con);
12
+ })(previous, current);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@admc.com/eslintplugin-sn-test",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "External tests for ESLint plugin @admc.com/eslint-plugin-sn",
5
5
  "scripts": {
6
6
  "test": "mocha --recursive",
package/sneslintrc.json CHANGED
@@ -21,7 +21,8 @@
21
21
  "no-template-curly-in-string": "error",
22
22
  "eqeqeq": "error",
23
23
  "semi": "error",
24
- "no-extra-parens": "error"
24
+ "no-extra-parens": "error",
25
+ "@admc.com/sn/prefer-array-iterator": "error"
25
26
  },
26
27
  "overrides": [
27
28
  {