@admc.com/eslintplugin-sn-test 1.0.0 → 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.
- package/.eslintrc.json +3 -3
- package/badScripts/global/sys_script/initToUndefined.js +2 -0
- package/badScripts/global/sys_script/noIifeParams.js +3 -0
- package/badScripts/global/sys_script/noiife.js +1 -0
- package/badScripts/global/sys_script/patternId.js +1 -0
- package/badScripts/global/sys_script/request.js +1 -0
- package/badScripts/global/sys_script/unusedVar.js +2 -0
- package/badScripts/global/sys_script/wrongIifeParams.js +3 -0
- package/badScripts/global/sysauto_script/badIife.js +2 -0
- package/badScripts/global/sysauto_script/grNoValidate.js +4 -0
- package/badScripts/global/sysauto_script/traditionalFor.js +3 -0
- package/badScripts/scoped/sys_script/let.js +2 -0
- package/functions.bash +1 -1
- package/goodScripts/ecc_agent_script/good.js +1 -1
- package/goodScripts/global/sys_script/good.js +2 -1
- package/goodScripts/global/sys_script_include/createOtherClass.js +1 -1
- package/goodScripts/scoped/sa_pattern_prepost_script/good.js +1 -0
- package/goodScripts/scoped/sys_script/good.js +3 -2
- package/goodScripts/scoped/sys_ws_operation/good.js +2 -0
- package/package.json +4 -2
- package/{eslintrc.json → sneslintrc.json} +8 -2
package/.eslintrc.json
CHANGED
|
@@ -6,10 +6,8 @@
|
|
|
6
6
|
"parserOptions": { "ecmaVersion": "latest" },
|
|
7
7
|
"ignorePatterns": ["goodScripts/**", "badScripts/**", "test/**"],
|
|
8
8
|
"rules": {
|
|
9
|
-
"camelcase": "warn",
|
|
9
|
+
"camelcase": ["warn", { "properties": "never" }],
|
|
10
10
|
"eqeqeq": "error",
|
|
11
|
-
"no-var": "error",
|
|
12
|
-
"prefer-const": "error",
|
|
13
11
|
"semi": "error",
|
|
14
12
|
"no-unreachable-loop": "error",
|
|
15
13
|
"no-use-before-define": ["error", { "functions": false, "classes": false }],
|
|
@@ -52,6 +50,8 @@
|
|
|
52
50
|
"array-callback-return": ["error", { "checkForEach": true }],
|
|
53
51
|
|
|
54
52
|
// Post-ES6
|
|
53
|
+
"no-var": "error",
|
|
54
|
+
"prefer-const": "error",
|
|
55
55
|
"strict": ["error", "safe"],
|
|
56
56
|
"prefer-exponentiation-operator": "error",
|
|
57
57
|
"prefer-arrow-callback": "error",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
console.log("here without IIFE", "blaine");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
gs.log(patternId, "2nd");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
gs.log(request.queryParams, "2nd");
|
package/functions.bash
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Useful shell functions
|
|
2
2
|
|
|
3
3
|
function rchead() {
|
|
4
|
-
local TARGET_FILE=
|
|
4
|
+
local TARGET_FILE=sneslintrc.json
|
|
5
5
|
local SYNTAX_MSG='SYNTAX: rchead n # where n is a positive integer'
|
|
6
6
|
[ -f "$TARGET_FILE" ] || {
|
|
7
7
|
echo "rchead file '$TARGET_FILE' not present or not a file" 1>&2
|
|
@@ -1,7 +1,7 @@
|
|
|
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
|
|
4
|
-
// eslint-disable-next-line camelcase
|
|
5
5
|
gs.log(Object.keys(new sn_codesearch.CodeSearch()).length, "src"); // SIScopes
|
|
6
6
|
|
|
7
7
|
var varsAreAllowed = "a val";
|
|
@@ -10,3 +10,4 @@ gs.log(varsAreAllowed, "2nd");
|
|
|
10
10
|
const con = "a val";
|
|
11
11
|
con += "addition"; // Can't test for const changes
|
|
12
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
|
-
|
|
4
|
+
const OtherAjaxProcessor = Class.create();
|
|
5
5
|
|
|
6
6
|
OtherAjaxProcessor.prototype = Object.extendsObject(AbstractAjaxProcessor, {
|
|
7
7
|
type: "OtherAjaxProcessor",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
gs.info(patternId, "2nd");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
(function() {
|
|
1
2
|
// Test availability of scoped vars from the different component lists:
|
|
2
|
-
gs.info("
|
|
3
|
-
// eslint-disable-next-line camelcase
|
|
3
|
+
gs.info(new sn_ws_err.NotAcceptableError("fake err")); // coreServerObjects.txt
|
|
4
4
|
gs.info(Object.keys(new sn_codesearch.CodeSearch()).length); // SIScopes
|
|
5
5
|
|
|
6
6
|
var varsAreAllowed = "a val";
|
|
@@ -9,3 +9,4 @@ gs.info(varsAreAllowed);
|
|
|
9
9
|
const con = "a val";
|
|
10
10
|
con += "addition"; // Can't test for const changes
|
|
11
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.
|
|
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",
|
|
@@ -25,7 +25,9 @@
|
|
|
25
25
|
},
|
|
26
26
|
"homepage": "https://github.com/unsaved/eslint-plugin-sn#readme",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@admc.com/eslint-plugin-sn": "^1.0.1",
|
|
29
28
|
"mocha": "^10.0.0"
|
|
29
|
+
},
|
|
30
|
+
"peerDependencies": {
|
|
31
|
+
"@admc.com/eslint-plugin-sn": "^1.0.6"
|
|
30
32
|
}
|
|
31
33
|
}
|
|
@@ -17,14 +17,20 @@
|
|
|
17
17
|
"no-array-constructor": "error",
|
|
18
18
|
"max-depth": "error",
|
|
19
19
|
"dot-notation": "error",
|
|
20
|
-
"camelcase": "error",
|
|
20
|
+
"camelcase": ["error", { "properties": "never" }],
|
|
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
|
{
|
|
29
|
+
"files": ["**/@(sa_pattern_prepost_script|sys_script_fix|sys_script|sys_script_include|sys_auto_script|sys_ws_operation|sys_web_service)/@(global|scoped)/*.js"],
|
|
30
|
+
"rules": {
|
|
31
|
+
"camelcase": ["error", { "properties": "never", "ignoreGlobals": true }]
|
|
32
|
+
}
|
|
33
|
+
},{ // ES6 overrides
|
|
28
34
|
"files": ["**/@(sys|catalog|expert)_script_client/@(noniso|iso)/*.js"],
|
|
29
35
|
"rules": {
|
|
30
36
|
"strict": ["error", "safe"],
|