Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@hint/hint-no-inline-styles
Advanced tools
This hint checks if the HTML is using inline CSS styles.
The use of inline CSS styles prevent the reuse of the styles anywhere else. The html markup of the page becomes hard to read for the naked eye. The inline CSS styles are hard to maintain and does not provide consistency since they are not stored in a single place. The inline styles are repeated downloaded by the client on every request since it does not provide you with browser cache advantage. Inline styles take precedence of external stylesheets, this could accidentally override styles that you did not intend to overwrite.
This hint checks if the HTML is using inline CSS styles.
Examples of inline CSS styles
<div style="color: blue;"></div>
<style></style>
It checks that no element has the attribute style
.
It also checks that no internal styles <style>
is used.
The hint will trigger if any element have the attribute style
<div style="color: blue;"></div>
The hint will trigger if you use internal styles, this is disabled by default
<style>
div {
color: blue;
}
</style>
No inline style in the element
<!DOCTYPE html>
<html lang="en">
<head>
...
</head>
<body>
...
<div>Hi styles</div>
</body>
</html>
requireNoStyleElement
can be set to true
to disallow and require the use of
no style
tag.
In the .hintrc
file:
{
"connector": {...},
"formatters": [...],
"hints": {
"no-inline-styles": [ "warning", {
"requireNoStyleElement": true
}],
...
},
...
}
Install this hint with:
npm install @hint/hint-no-inline-styles --save-dev
To use it, activate it via the .hintrc
configuration file:
{
"connector": {...},
"formatters": [...],
"parsers": [...],
"hints": {
"no-inline-styles": "error",
...
},
...
}
FAQs
Invalidate the use of CSS inline styles in HTML
The npm package @hint/hint-no-inline-styles receives a total of 16,006 weekly downloads. As such, @hint/hint-no-inline-styles popularity was classified as popular.
We found that @hint/hint-no-inline-styles demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.