@admc.com/eslintplugin-sn-test 3.6.2 → 3.8.1
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/.eslintrc.json +1 -1
- package/bad1Scripts/all/sp_widget.client_script/gs.js +13 -1
- package/bad1Scripts/all/sp_widget.client_script/namedFn.js +13 -0
- package/bad1Scripts/all/sp_widget.client_script/spaceBeforeFn.js +13 -0
- package/bad1Scripts/all/sp_widget.client_script/statementBeforeFn.js +14 -0
- package/bad1Scripts/all/sp_widget.link/backticks.js +5 -0
- package/bad1Scripts/all/sys_ui_context_menu/backticks.js +2 -0
- package/bad1Scripts/scoped-es12/sp_widget.script/interpolateStr.js +7 -0
- package/bad2Scripts/all/sp_widget.client_script/fnAssignment.js +16 -0
- package/bad2Scripts/all/sp_widget.client_script/ootbBoilerplate.js +8 -0
- package/goodScripts/all/sp_widget.client_script/cleanedBoilerplate.js +9 -0
- package/goodScripts/all/sp_widget.client_script/good.js +12 -10
- package/goodScripts/all/sp_widget.link/cleanedBoilerplate.js +4 -0
- package/goodScripts/all/sp_widget.link/good.js +9 -0
- package/goodScripts/all/sys_ui_context_menu/good.js +2 -0
- package/goodScripts/scoped-es12/sp_widget.script/arrow.js +7 -0
- package/goodScripts/scoped-es12/sp_widget.script/good.js +7 -0
- package/goodScripts/scoped-es5/sp_widget.script/good.js +1 -1
- package/package.json +1 -1
- package/sneslintrc.json +10 -4
package/.eslintrc.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"env": { "es2022": true, "node": true },
|
|
5
5
|
"extends": "eslint:recommended",
|
|
6
6
|
"parserOptions": { "ecmaVersion": "latest" },
|
|
7
|
-
"ignorePatterns": ["
|
|
7
|
+
"ignorePatterns": ["*Scripts/**", "test/**"],
|
|
8
8
|
"rules": {
|
|
9
9
|
"camelcase": ["warn", { "properties": "never" }],
|
|
10
10
|
"eqeqeq": "error",
|
|
@@ -1 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
function($scope) {
|
|
2
|
+
"use strict";
|
|
3
|
+
const fName = "spclient/" + $scope.widget.id + ":" + $scope.$id;
|
|
4
|
+
console.warn("UPDATE02");
|
|
5
|
+
console.warn("$scope", $scope);
|
|
6
|
+
console.info("Executing " + fName + " with this", this);
|
|
7
|
+
this.thisVar = "I am here"; // To facilitate checking for this exact instance
|
|
8
|
+
console.info(fName + " inputs", this.inputs);
|
|
9
|
+
gs.info(fName + " data", this.data);
|
|
10
|
+
console.info(fName + " options", this.options);
|
|
11
|
+
$scope.pneu = "new string";
|
|
12
|
+
console.info("this", this);
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
function _unused($scope) {
|
|
2
|
+
"use strict";
|
|
3
|
+
const fName = "spclient/" + $scope.widget.id + ":" + $scope.$id;
|
|
4
|
+
console.warn("UPDATE02");
|
|
5
|
+
console.warn("$scope", $scope);
|
|
6
|
+
console.info("Executing " + fName + " with this", this);
|
|
7
|
+
this.thisVar = "I am here"; // To facilitate checking for this exact instance
|
|
8
|
+
console.info(fName + " inputs", this.inputs);
|
|
9
|
+
console.info(fName + " data", this.data);
|
|
10
|
+
console.info(fName + " options", this.options);
|
|
11
|
+
$scope.pneu = "new string";
|
|
12
|
+
console.info("this", this);
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
function($scope) {
|
|
2
|
+
"use strict";
|
|
3
|
+
const fName = "spclient/" + $scope.widget.id + ":" + $scope.$id;
|
|
4
|
+
console.warn("UPDATE02");
|
|
5
|
+
console.warn("$scope", $scope);
|
|
6
|
+
console.info("Executing " + fName + " with this", this);
|
|
7
|
+
this.thisVar = "I am here"; // To facilitate checking for this exact instance
|
|
8
|
+
console.info(fName + " inputs", this.inputs);
|
|
9
|
+
console.info(fName + " data", this.data);
|
|
10
|
+
console.info(fName + " options", this.options);
|
|
11
|
+
$scope.pneu = "new string";
|
|
12
|
+
console.info("this", this);
|
|
13
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
console.info("helo");
|
|
2
|
+
function($scope) {
|
|
3
|
+
"use strict";
|
|
4
|
+
const fName = "spclient/" + $scope.widget.id + ":" + $scope.$id;
|
|
5
|
+
console.warn("UPDATE02");
|
|
6
|
+
console.warn("$scope", $scope);
|
|
7
|
+
console.info("Executing " + fName + " with this", this);
|
|
8
|
+
this.thisVar = "I am here"; // To facilitate checking for this exact instance
|
|
9
|
+
console.info(fName + " inputs", this.inputs);
|
|
10
|
+
console.info(fName + " data", this.data);
|
|
11
|
+
console.info(fName + " options", this.options);
|
|
12
|
+
$scope.pneu = "new string";
|
|
13
|
+
console.info("this", this);
|
|
14
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
_unused = function($scope) {
|
|
2
|
+
/* I had to put this script under bad2Scripts instead of bad1Scripts to accommodate an
|
|
3
|
+
* ESLint bug where varsIgnorePatterns are sometimes not honored, including for "_unused". */
|
|
4
|
+
"use strict";
|
|
5
|
+
/* global _unused:writable */
|
|
6
|
+
const fName = "spclient/" + $scope.widget.id + ":" + $scope.$id;
|
|
7
|
+
console.warn("UPDATE02");
|
|
8
|
+
console.warn("$scope", $scope);
|
|
9
|
+
console.info("Executing " + fName + " with this", this);
|
|
10
|
+
this.thisVar = "I am here"; // To facilitate checking for this exact instance
|
|
11
|
+
console.info(fName + " inputs", this.inputs);
|
|
12
|
+
console.info(fName + " data", this.data);
|
|
13
|
+
console.info(fName + " options", this.options);
|
|
14
|
+
$scope.pneu = "new string";
|
|
15
|
+
console.info("this", this);
|
|
16
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
api.controller=function() {
|
|
2
|
+
// Have to satisfy "use strict" or would have to complicate eslintplugin-sn-test design to
|
|
3
|
+
// allow arbitrarily-specified number of failures, or at least add support for 3 failures.
|
|
4
|
+
// Doing this instead of eslint-disable notation since that notation would conflict with wrapping:
|
|
5
|
+
"use strict";
|
|
6
|
+
/* widget controller */
|
|
7
|
+
var c = this;
|
|
8
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
api.controller=function() {
|
|
2
|
+
// Doing this instead of eslint-disable notation since that notation would conflict with wrapping:
|
|
3
|
+
"use strict";
|
|
4
|
+
// This is as close as can get to OOTB while not failing more basic rules that we don't
|
|
5
|
+
// want to test for here.
|
|
6
|
+
/* eslint-disable no-var,no-unused-vars */
|
|
7
|
+
/* widget controller */
|
|
8
|
+
var c = this;
|
|
9
|
+
};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
const dblr = v=>{'use strict'; return v+v;};
|
|
3
|
-
|
|
4
|
-
api.onLoad = function($scope) {
|
|
1
|
+
function($scope) {
|
|
5
2
|
"use strict";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
console.info(
|
|
3
|
+
const fName = "spclient/" + $scope.widget.id + ":" + $scope.$id;
|
|
4
|
+
console.warn("UPDATE02");
|
|
5
|
+
console.warn("$scope", $scope);
|
|
6
|
+
console.info("Executing " + fName + " with this", this);
|
|
7
|
+
this.thisVar = "I am here"; // To facilitate checking for this exact instance
|
|
8
|
+
console.info(fName + " inputs", this.inputs);
|
|
9
|
+
console.info(fName + " data", this.data);
|
|
10
|
+
console.info(fName + " options", this.options);
|
|
11
|
+
$scope.pneu = "new string";
|
|
12
|
+
console.info("this", this);
|
|
13
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
(scope) => {
|
|
2
|
+
"use strict";
|
|
3
|
+
const fName = "splink/" + scope.widget.id + ":" + scope.$id;
|
|
4
|
+
console.warn("UPDATE02");
|
|
5
|
+
console.warn("scope", scope);
|
|
6
|
+
console.info("Executing " + fName + " with this", this);
|
|
7
|
+
this.thisVar = "I am here"; // To facilitate checking for this exact instance
|
|
8
|
+
scope.pneu = "new string";
|
|
9
|
+
}
|
package/package.json
CHANGED
package/sneslintrc.json
CHANGED
|
@@ -27,10 +27,7 @@
|
|
|
27
27
|
"@admc.com/sn/no-init-emptystring": "error"
|
|
28
28
|
},
|
|
29
29
|
"overrides": [
|
|
30
|
-
{
|
|
31
|
-
"files": ["**/sys_ui_script/*/*.js"],
|
|
32
|
-
"rules": { "@admc.com/sn/no-uiscript-curlyref": "error" }
|
|
33
|
-
}, { // ES6 overrides
|
|
30
|
+
{ // ES6 overrides
|
|
34
31
|
"files": [ "**/@(noniso|iso)/*.js",
|
|
35
32
|
"**/@(sys_ui_script|sys_script_validator|sp_widget.client_script|sys_ux_data_broker_scriptlet)/all/*.js"], // eslint-disable-line max-len
|
|
36
33
|
"rules": {
|
|
@@ -56,6 +53,15 @@
|
|
|
56
53
|
"prefer-spread": "error",
|
|
57
54
|
"prefer-template": "error"
|
|
58
55
|
}
|
|
56
|
+
}, {
|
|
57
|
+
// Reverting eslint-plugin-sn exceptions back, because we overrode them generally above
|
|
58
|
+
// when raising warnings to errors.
|
|
59
|
+
"files":
|
|
60
|
+
["**/@(sys_ui_script|sp_widget.script|sp_widget.client_script|sp_widget.link)/*/*.js"],
|
|
61
|
+
"rules": {
|
|
62
|
+
"prefer-template": "off",
|
|
63
|
+
"no-template-curly-in-string": "off"
|
|
64
|
+
}
|
|
59
65
|
}, { // Overriding for ES12 IIFE scriptlets}
|
|
60
66
|
"files": [
|
|
61
67
|
"**/@(sys_script|sys_ws_operation|sys_web_service|sys_processor|sys_script_email|sys_transform_map|sys_transform_script|sp_widget.script|sys_ui_page.processing_script)/scoped-es12/*.js", // eslint-disable-line max-len
|