Skip to content

Commit 81a0394

Browse files
zgliczclaude
andauthored
JS-1136 Fix SonarCloud quality gate code smells (#6227)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent fdba8a4 commit 81a0394

3 files changed

Lines changed: 6 additions & 8 deletions

File tree

.github/workflows/LabelEslintPlugin.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,11 @@ jobs:
4444
- name: Add eslint-plugin label
4545
if: steps.extract-jira-key.outputs.has_jira_key == 'true'
4646
env:
47-
JIRA_USER: ${{ fromJSON(steps.secrets.outputs.vault).JIRA_USER }}
48-
JIRA_TOKEN: ${{ fromJSON(steps.secrets.outputs.vault).JIRA_TOKEN }}
47+
VAULT_OUTPUT: ${{ steps.secrets.outputs.vault }}
4948
JIRA_KEY: ${{ steps.extract-jira-key.outputs.jira_key }}
5049
run: |
50+
JIRA_USER=$(echo "$VAULT_OUTPUT" | jq -r '.JIRA_USER')
51+
JIRA_TOKEN=$(echo "$VAULT_OUTPUT" | jq -r '.JIRA_TOKEN')
5152
# Use Jira REST API to add label
5253
curl -s -X PUT \
5354
-H "Content-Type: application/json" \

packages/jsts/src/rules/S100/rule.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,7 @@ export const rule: Rule.RuleModule = {
116116
for (let i = ancestors.length - 1; i >= 0; i--) {
117117
if (functionLike.has(ancestors[i].type)) {
118118
const enclosingFunction = ancestors[i];
119-
if (
120-
knowledge?.func === enclosingFunction &&
121-
(node.argument as any)?.type?.startsWith('JSX')
122-
) {
119+
if (knowledge?.func === enclosingFunction && node.argument?.type.startsWith('JSX')) {
123120
knowledge.returnsJSX = true;
124121
}
125122
return;

packages/jsts/src/rules/S4721/rule.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ function checkOSCommand(context: Rule.RuleContext, call: estree.CallExpression)
5757
const fqnParts = fqn.split('.');
5858
const module = fqnParts[0];
5959
// JS-638: Use the last part of the FQN as the method (the actual method being called).
60-
const method = fqnParts[fqnParts.length - 1];
61-
if (module === CHILD_PROCESS_MODULE && isQuestionable(method, args)) {
60+
const method = fqnParts.at(-1);
61+
if (method && module === CHILD_PROCESS_MODULE && isQuestionable(method, args)) {
6262
context.report({
6363
node: callee,
6464
messageId: 'safeOSCommand',

0 commit comments

Comments
 (0)