eslint-plugin-sfmc 1.0.0 → 1.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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-sfmc",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "ESLint plugin for Salesforce Marketing Cloud
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"description": "ESLint plugin for Salesforce Marketing Cloud  AMPscript and Server-Side JavaScript (SSJS)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
7
7
|
"exports": {
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"sfmc"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"ampscript-data": "^0.
|
|
36
|
-
"ampscript-parser": "^0.1.
|
|
37
|
-
"ssjs-data": "^0.
|
|
35
|
+
"ampscript-data": "^0.2.0",
|
|
36
|
+
"ampscript-parser": "^0.1.3",
|
|
37
|
+
"ssjs-data": "^0.4.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"eslint": ">=9.0.0"
|
|
@@ -60,6 +60,12 @@
|
|
|
60
60
|
"eslint-plugin-unicorn": "^64.0.0",
|
|
61
61
|
"globals": "^17.4.0",
|
|
62
62
|
"husky": "^9.1.7",
|
|
63
|
+
"lint-staged": "^17.0.5",
|
|
63
64
|
"prettier": "^3.8.2"
|
|
65
|
+
},
|
|
66
|
+
"lint-staged": {
|
|
67
|
+
"*.{js,mjs,cjs}": [
|
|
68
|
+
"eslint --fix"
|
|
69
|
+
]
|
|
64
70
|
}
|
|
65
71
|
}
|
|
@@ -163,8 +163,8 @@ export default {
|
|
|
163
163
|
/**
|
|
164
164
|
* Returns true if `node` is a `ContentAreaObj.Init(…)` call.
|
|
165
165
|
*
|
|
166
|
-
* @param {import('eslint').Rule.Node} node
|
|
167
|
-
* @returns {boolean}
|
|
166
|
+
* @param {import('eslint').Rule.Node} node - AST node to inspect
|
|
167
|
+
* @returns {boolean} true when the node is a ContentAreaObj.Init call
|
|
168
168
|
*/
|
|
169
169
|
function isContentAreaObjInit(node) {
|
|
170
170
|
if (!node || node.type !== 'CallExpression') {
|
|
@@ -182,8 +182,8 @@ export default {
|
|
|
182
182
|
* If `node` is a Core Library Init call (e.g. `DataExtension.Init("key")`),
|
|
183
183
|
* return the Core Library type name; otherwise return null.
|
|
184
184
|
*
|
|
185
|
-
* @param {import('eslint').Rule.Node} node
|
|
186
|
-
* @returns {string | null}
|
|
185
|
+
* @param {import('eslint').Rule.Node} node - AST node to inspect
|
|
186
|
+
* @returns {string | null} Core Library type name, or null when not a Core Library Init call
|
|
187
187
|
*/
|
|
188
188
|
function getCoreInitType(node) {
|
|
189
189
|
if (!node || node.type !== 'CallExpression') {
|
|
@@ -215,8 +215,8 @@ function getCoreInitType(node) {
|
|
|
215
215
|
/**
|
|
216
216
|
* Returns true if `node` is `new Script.Util.WSProxy()`.
|
|
217
217
|
*
|
|
218
|
-
* @param {import('eslint').Rule.Node} node
|
|
219
|
-
* @returns {boolean}
|
|
218
|
+
* @param {import('eslint').Rule.Node} node - AST node to inspect
|
|
219
|
+
* @returns {boolean} true when the node is a WSProxy constructor call
|
|
220
220
|
*/
|
|
221
221
|
function isWSProxyConstructor(node) {
|
|
222
222
|
if (!node || node.type !== 'NewExpression') {
|
|
@@ -62,7 +62,7 @@ export default {
|
|
|
62
62
|
|
|
63
63
|
create(context) {
|
|
64
64
|
const coreVars = new Map(); // varName → className (Core Library instances)
|
|
65
|
-
const wsproxyVars = new Set(); // varNames assigned new WSProxy()
|
|
65
|
+
const wsproxyVars = new Set(); // varNames assigned new Script.Util.WSProxy()
|
|
66
66
|
|
|
67
67
|
function checkArgs(entry, args, callName) {
|
|
68
68
|
if (!entry || !entry.params || entry.params.length === 0) {
|