
Security News
Deno 2.6 + Socket: Supply Chain Defense In Your CLI
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.
babel-plugin-transform-react-styled-components-qa
Advanced tools
Add data-qa property to styled-components via .attrs using the component name
This plugin adds data-qa props to styled-component using .attrs.
This plugin can be used with babel-plugin-transform-react-qa-classes to provide support for both styled-components and React components.
In
const Component = styled.p`
color: red;
`
Out
const Component = styled.p.attrs({
"data-qa": "Component"
})`
color: red;
`
In
const tagName = 'h1'
const Component = styled[tagName]`
background: 'pink';
`
Out
const tagName = 'h1'
const Component = styled[tagName].attrs({
"data-qa": "Component"
})`
background: 'pink';
`
data-qa is append after other attributes defined by usersIn
const PasswordInput = styled.input.attrs({
type: 'password'
})`
font-size: 14px;
line-height: 2em;
`
Out
const PasswordInput = styled.input.attrs({
type: 'password',
"data-qa": "PasswordInput"
})`
font-size: 14px;
line-height: 2em;
`
This plugin is intended to be use in pre-production environment.
Using this plugin with SSR could result in larger payload due to the extra attribute.
{
"env": {
"dev": {
plugins: [
["transform-react-styled-components-qa", {
"attribute": "data-qa",
"format": "kebab"
}]
]
}
}
}
The attribute name to be used instead of data-qa.
Support values: kebab, camel, snake, pascal
Default value: kebab
FAQs
Add data-qa property to styled-components via .attrs using the component name
We found that babel-plugin-transform-react-styled-components-qa demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.