-
Notifications
You must be signed in to change notification settings - Fork 5
Preview/oxlint #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preview/oxlint #27
Changes from all commits
14e89ad
6949947
ea98f47
f25aa13
500f9ce
b5e74a0
d657d9d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"plugins": ["import", "typescript", "unicorn"], | ||
"env": { | ||
"browser": true | ||
}, | ||
"globals": { | ||
"foo": "readonly" | ||
}, | ||
"settings": {}, | ||
"rules": { | ||
"eqeqeq": "warn", | ||
"import/no-cycle": "error", | ||
"react/self-closing-comp": [ | ||
"error", | ||
{ | ||
"html": false | ||
} | ||
] | ||
}, | ||
"overrides": [ | ||
{ | ||
"files": ["*.test.ts", "*.spec.ts"], | ||
"rules": { | ||
"@typescript-eslint/no-explicit-any": "off" | ||
} | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
reviews: | ||
path_filters: ["**/*.yml"] | ||
tools: | ||
# oxlint does not run if biome is enabled | ||
biome: | ||
enabled: false | ||
yamllint: | ||
enabled: false |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,11 @@ | ||||||||||||||||||||||
function TestComponent() { | ||||||||||||||||||||||
// ruleid:react-dangerouslysetinnerhtml | ||||||||||||||||||||||
return <div dangerouslySetInnerHTML={createMarkup()} />; | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
function OkComponent() { | ||||||||||||||||||||||
// OK | ||||||||||||||||||||||
const discordClientKey = '8dyfuiRyq=vVc3RRr_edRk-fK__JItpZ'; | ||||||||||||||||||||||
return {__html: 'Первый · Второй'}; | ||||||||||||||||||||||
} | ||||||||||||||||||||||
Comment on lines
+6
to
+10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove or secure the Discord client secret. The Discord client key should not be hardcoded in the source code. If this is for testing purposes, use environment variables or mock data. function OkComponent() {
- // OK
- const discordClientKey = '8dyfuiRyq=vVc3RRr_edRk-fK__JItpZ';
+ // Example of safe HTML rendering
+ const discordClientKey = process.env.DISCORD_CLIENT_KEY || 'mock-key-for-testing';
return {__html: 'Первый · Второй'};
} 📝 Committable suggestion
Suggested change
🧰 Tools🪛 Gitleaks (8.27.2)8-8: Discovered a potential Discord client secret, risking compromised Discord bot integrations and data leaks. (discord-client-secret) 🤖 Prompt for AI Agents
🛠️ Refactor suggestion Consider proper component return type. The function OkComponent() {
- const discordClientKey = process.env.DISCORD_CLIENT_KEY || 'mock-key-for-testing';
- return {__html: 'Первый · Второй'};
+ return <div>Первый · Второй</div>;
}
🧰 Tools🪛 Gitleaks (8.27.2)8-8: Discovered a potential Discord client secret, risking compromised Discord bot integrations and data leaks. (discord-client-secret) 🤖 Prompt for AI Agents
|
||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Address the dangerouslySetInnerHTML security concern.
The use of
dangerouslySetInnerHTML
with an undefinedcreateMarkup()
function poses a security risk. If this is intentional for testing purposes, ensure proper sanitization and add clear documentation.📝 Committable suggestion
🧰 Tools
🪛 Biome (1.9.4)
[error] 3-3: Avoid passing content using the dangerouslySetInnerHTML prop.
Setting content using code can expose users to cross-site scripting (XSS) attacks
(lint/security/noDangerouslySetInnerHtml)
🤖 Prompt for AI Agents