@admc.com/eslintplugin-sn-test 3.4.0 → 3.6.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.
Files changed (22) hide show
  1. package/bad1Scripts/all/sys_ux_client_script/extraParam.js +5 -0
  2. package/bad1Scripts/all/sys_ux_client_script/spuriousRootExpr.js +5 -0
  3. package/bad1Scripts/all/sys_ux_data_broker_scriptlet/backticks.js +5 -0
  4. package/bad1Scripts/scoped-es5/sys_ux_data_broker_transform/let.js +5 -0
  5. package/bad2Scripts/all/sys_ux_client_script/tradWSemi.js +5 -0
  6. package/goodScripts/all/sys_ux_client_script/arrowFn.js +5 -0
  7. package/goodScripts/all/sys_ux_client_script/arrowFnBodyShortcut1L.js +4 -0
  8. package/goodScripts/all/sys_ux_client_script/arrowFnBodyShortcutML.js +5 -0
  9. package/goodScripts/all/sys_ux_client_script/arrowFnEmptyParam1L.js +4 -0
  10. package/goodScripts/all/sys_ux_client_script/arrowFnEmptyParamML.js +7 -0
  11. package/goodScripts/all/sys_ux_client_script/arrowFnNoParams1L.js +1 -0
  12. package/goodScripts/all/sys_ux_client_script/arrowFnNoParamsML.js +9 -0
  13. package/goodScripts/all/sys_ux_client_script/tradCompleteAnonyFn.js +1 -1
  14. package/goodScripts/all/sys_ux_client_script_include/arrowExtraParam.js +4 -0
  15. package/goodScripts/all/sys_ux_client_script_include/tradExtraParam.js +5 -0
  16. package/goodScripts/all/sys_ux_data_broker_scriptlet/good.js +4 -0
  17. package/goodScripts/scoped-es12/sys_ux_data_broker_transform/good.js +5 -0
  18. package/goodScripts/scoped-es5/sys_ux_data_broker_transform/good.js +4 -0
  19. package/package.json +1 -1
  20. package/sneslintrc.json +5 -2
  21. package/goodScripts/all/sys_ux_client_script/ArrowFnNoParams.js +0 -2
  22. /package/{goodScripts/all/sys_ux_client_script/ArrowFn.js → bad1Scripts/all/sys_ux_client_script/arrowFnWSemi.js} +0 -0
@@ -0,0 +1,5 @@
1
+ /* eslint no-unused-vars: ["error", { "varsIgnorePattern": "fx" }] */
2
+ function fx({a, b}, c) {
3
+ console.info(`Something about ${a} and ${b} and ${c}`);
4
+ }
5
+ /* Tail comment */
@@ -0,0 +1,5 @@
1
+ /* eslint no-unused-vars: ["error", { "varsIgnorePattern": "fx" }] */
2
+ const c = "bonus";
3
+ function fx({a, b}) {
4
+ console.info(`Something about ${a} and ${b} and ${c}`);
5
+ }
@@ -0,0 +1,5 @@
1
+ function(iput) {
2
+ if (!iput.propertyName) return {"error" : "missing property name"};
3
+ gs.info(`getCappedProp:brokerscr input (${iput.propertyName})`);
4
+ return "Z" + (iput.propertyName + iput.propertyName).toUpperCase();
5
+
@@ -0,0 +1,5 @@
1
+ function(iput) {
2
+ if (!iput.pattern) return {"error" : "missing property pattern"};
3
+ let x = 3;
4
+ return 45;
5
+ }
@@ -0,0 +1,5 @@
1
+ /* eslint no-unused-vars: ["error", { "varsIgnorePattern": "fx" }] */
2
+ function fx({a, b}) {
3
+ console.info(`Something about ${a} and ${b}`);
4
+ };
5
+ /* Tail comment */
@@ -0,0 +1,5 @@
1
+ // Header comment
2
+ ({a, b}) => {
3
+ console.info(`Something about ${a} and ${b}`);
4
+ }
5
+ /* Tail comment */
@@ -0,0 +1,4 @@
1
+ // a comment
2
+ ({a, b}) => console.info(`About ${a}`) || console.info(`About ${b}`)
3
+ /* multi
4
+ * line */
@@ -0,0 +1,5 @@
1
+ // comment
2
+ ({a, b}) =>
3
+ console.info(`About ${a}`) ||
4
+ console.info(`About ${b}`)
5
+ /* multi line*/
@@ -0,0 +1,4 @@
1
+ // eslint-disable-next-line no-empty-pattern
2
+ ({}) => { console.info("No params"); }
3
+
4
+ /* post comment */
@@ -0,0 +1,7 @@
1
+ // eslint-disable-next-line no-empty-pattern
2
+ ({}) => {
3
+ console.info("No params");
4
+ }
5
+
6
+ /* post
7
+ * comment */
@@ -0,0 +1 @@
1
+ () => { console.info("No params"); }
@@ -0,0 +1,9 @@
1
+ /* pre
2
+ * comment
3
+ */
4
+ () => {
5
+ console.info("No params");
6
+ }
7
+ /* post
8
+ * comment
9
+ */
@@ -1,5 +1,5 @@
1
1
  // Header comment
2
2
  (function({a, b}) {
3
3
  console.info(`Something about ${a} and ${b}`);
4
- });
4
+ })
5
5
  /* Tail comment */
@@ -0,0 +1,4 @@
1
+ ({a, b}, c, d) => {
2
+ console.info(`Something about ${a} and ${b} and ${c} and ${d}`);
3
+ }
4
+ /* Tail comment */
@@ -0,0 +1,5 @@
1
+ /* eslint no-unused-vars: ["error", { "varsIgnorePattern": "fx" }] */
2
+ function fx({a, b}, c) {
3
+ console.info(`Something about ${a} and ${b} and ${c}`);
4
+ }
5
+ /* Tail comment */
@@ -0,0 +1,4 @@
1
+ function(iput) {
2
+ if (!iput.propertyName) return {"error" : "missing property name"};
3
+ return (iput.propertyName + iput.propertyName).toUpperCase();
4
+ }
@@ -0,0 +1,5 @@
1
+ function(iput) {
2
+ if (!iput.propertyName) return {"error" : "missing property name"};
3
+ gs.info(`transformTst:brokertran requested prop '${iput.propertyName}'`);
4
+ return `${gs.getProperty(iput.propertyName)}>`;
5
+ }
@@ -0,0 +1,4 @@
1
+ function(iput) {
2
+ if (!iput.pattern) return {"error" : "missing property pattern"};
3
+ return 45;
4
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@admc.com/eslintplugin-sn-test",
3
- "version": "3.4.0",
3
+ "version": "3.6.0",
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
@@ -9,7 +9,7 @@
9
9
  "extends": ["plugin:@admc.com/sn/servicenow"],
10
10
 
11
11
  // Following are overrides which escalate warns to errors.
12
- // Tests only work if the leve is error because we check only snLint/eslint return value,
12
+ // Tests only work if the level is error because we check only snLint/eslint return value,
13
13
  // not the stdout or stderr.
14
14
  "rules": {
15
15
  "no-implied-eval": "error",
@@ -31,7 +31,7 @@
31
31
  "rules": { "@admc.com/sn/no-uiscript-curlyref": "error" }
32
32
  }, { // ES6 overrides
33
33
  "files": [ "**/@(noniso|iso)/*.js",
34
- "**/@(sys_ui_script|sys_script_validator|sp_widget.client_script)/all/*.js"],
34
+ "**/@(sys_ui_script|sys_script_validator|sp_widget.client_script|sys_ux_data_broker_scriptlet)/all/*.js"], // eslint-disable-line max-len
35
35
  "rules": {
36
36
  "strict": ["error", "function"],
37
37
  "prefer-arrow-callback": "error",
@@ -68,6 +68,9 @@
68
68
  }, { // Condition scriptlets
69
69
  "files": [ "**/*.condition/*/*.js"],
70
70
  "rules": { "strict": "off", "semi": "off" }
71
+ }, { // NE sys_ux scripts don't need and can't use "use strict"
72
+ "files": [ "**/sys_ux_*/*/*.js"],
73
+ "rules": { "strict": "off" }
71
74
  }
72
75
  ],
73
76
  "settings": {
@@ -1,2 +0,0 @@
1
- // eslint-disable-next-line no-empty-pattern
2
- ({}) => { console.info("No params"); };