@servicetitan/eslint-plugin 31.4.0 → 31.5.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/rules/mobx/use-makeObservable-with-decorators.ts"],"sourcesContent":["import { Rule } from 'eslint';\n\n// NOTE: \"action\" also covers \"action.bound\"\nconst mobxDecorators = ['observable', 'action', 'computed', 'override'];\n\nexport const mobxUseMakeObservableWithDecorators: Rule.RuleModule = {\n meta: {\n type: 'problem',\n docs: {\n description: 'Testing makeObservable used with decorators',\n category: 'Possible Errors',\n recommended: false,\n url: 'https://github.com/servicetitan/uikit.git',\n },\n messages: {\n makeObservable: 'Use makeObservable in the constructor with MobX decorators',\n constructor: 'Add constructor with makeObservable when using MobX decorators',\n },\n },\n create(context) {\n return {\n ClassDeclaration(node) {\n let hasMobxDecorator = false;\n let hasConstructor = false;\n let hasMakeObservable = false;\n\n node.body.body.forEach((methodOrProperty: any) => {\n if (methodOrProperty.decorators) {\n methodOrProperty.decorators.forEach((decorator: any) => {\n if (\n mobxDecorators.includes(\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n decorator?.expression?.name ||\n decorator?.expression?.object?.name\n )\n ) {\n hasMobxDecorator = true;\n }\n });\n }\n\n if (methodOrProperty.kind === 'constructor') {\n hasConstructor = true;\n\n methodOrProperty.value?.body?.body.forEach((statement: any) => {\n if (statement?.expression?.callee?.name === 'makeObservable') {\n hasMakeObservable = true;\n }\n });\n }\n });\n\n if (hasMobxDecorator && !hasMakeObservable && hasConstructor) {\n context.report({\n node,\n messageId: 'makeObservable',\n });\n }\n\n if (hasMobxDecorator && !hasMakeObservable && !hasConstructor) {\n context.report({\n node,\n messageId: 'constructor',\n });\n }\n },\n };\n },\n};\n"],"names":["mobxUseMakeObservableWithDecorators","mobxDecorators","meta","type","docs","description","category","recommended","url","messages","makeObservable","
|
|
1
|
+
{"version":3,"sources":["../../../src/rules/mobx/use-makeObservable-with-decorators.ts"],"sourcesContent":["import { Rule } from 'eslint';\n\n// NOTE: \"action\" also covers \"action.bound\"\nconst mobxDecorators = ['observable', 'action', 'computed', 'override'];\n\nexport const mobxUseMakeObservableWithDecorators: Rule.RuleModule = {\n meta: {\n type: 'problem',\n docs: {\n description: 'Testing makeObservable used with decorators',\n category: 'Possible Errors',\n recommended: false,\n url: 'https://github.com/servicetitan/uikit.git',\n },\n messages: {\n makeObservable: 'Use makeObservable in the constructor with MobX decorators',\n constructor: 'Add constructor with makeObservable when using MobX decorators',\n },\n },\n create(context) {\n return {\n ClassDeclaration(node) {\n let hasMobxDecorator = false;\n let hasConstructor = false;\n let hasMakeObservable = false;\n\n node.body.body.forEach((methodOrProperty: any) => {\n if (methodOrProperty.decorators) {\n methodOrProperty.decorators.forEach((decorator: any) => {\n if (\n mobxDecorators.includes(\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n decorator?.expression?.name ||\n decorator?.expression?.object?.name\n )\n ) {\n hasMobxDecorator = true;\n }\n });\n }\n\n if (methodOrProperty.kind === 'constructor') {\n hasConstructor = true;\n\n methodOrProperty.value?.body?.body.forEach((statement: any) => {\n if (statement?.expression?.callee?.name === 'makeObservable') {\n hasMakeObservable = true;\n }\n });\n }\n });\n\n if (hasMobxDecorator && !hasMakeObservable && hasConstructor) {\n context.report({\n node,\n messageId: 'makeObservable',\n });\n }\n\n if (hasMobxDecorator && !hasMakeObservable && !hasConstructor) {\n context.report({\n node,\n messageId: 'constructor',\n });\n }\n },\n };\n },\n};\n"],"names":["mobxUseMakeObservableWithDecorators","mobxDecorators","meta","type","docs","description","category","recommended","url","messages","makeObservable","create","context","ClassDeclaration","node","hasMobxDecorator","hasConstructor","hasMakeObservable","body","forEach","methodOrProperty","decorators","decorator","includes","expression","name","object","kind","value","statement","callee","report","messageId"],"mappings":";;;;+BAKaA;;;eAAAA;;;AAHb,4CAA4C;AAC5C,MAAMC,iBAAiB;IAAC;IA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BAAgB;oBAC1DJ,QAAQmB,MAAM,CAAC;wBACXjB;wBACAkB,WAAW;oBACf;gBACJ;gBAEA,IAAIjB,oBAAoB,CAACE,qBAAqB,CAACD,gBAAgB;oBAC3DJ,QAAQmB,MAAM,CAAC;wBACXjB;wBACAkB,WAAW;oBACf;gBACJ;YACJ;QACJ;IACJ;AACJ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@servicetitan/eslint-plugin",
|
|
3
|
-
"version": "31.
|
|
3
|
+
"version": "31.5.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@types/eslint": "~9.6.1",
|
|
22
22
|
"@typescript-eslint/rule-tester": "~8.38.0",
|
|
23
|
-
"eslint": "~9.
|
|
23
|
+
"eslint": "~9.33.0"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"eslint": "~9.
|
|
27
|
-
"typescript": ">=5.
|
|
26
|
+
"eslint": "~9.33.0",
|
|
27
|
+
"typescript": ">=5.9.2"
|
|
28
28
|
},
|
|
29
29
|
"publishConfig": {
|
|
30
30
|
"access": "public"
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"cli": {
|
|
33
33
|
"webpack": false
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "6fce124ae36f2a36705247f6300ca8354aba6fb2"
|
|
36
36
|
}
|