Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit223404c

Browse files
committed
Add rule to prevent setting context from outside the ContextManager class
1 parent2aa197c commit223404c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

‎.eslintrc.json‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@
2323
"import/internal-regex":"^@/"
2424
},
2525
"overrides": [
26+
{
27+
"files": ["src/core/contextManager.ts"],
28+
"rules": {
29+
"no-restricted-syntax":"off"
30+
}
31+
},
2632
{
2733
"files": ["test/**/*.{ts,tsx}","**/*.{test,spec}.ts?(x)"],
2834
"settings": {
@@ -110,6 +116,13 @@
110116
"sublings_only":true
111117
}
112118
}
119+
],
120+
"no-restricted-syntax": [
121+
"error",
122+
{
123+
"selector":"CallExpression[callee.property.name='executeCommand'][arguments.0.value='setContext'][arguments.length>=3]",
124+
"message":"Do not use executeCommand('setContext', ...) directly. Use the ContextManager class instead."
125+
}
113126
]
114127
}
115128
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp