
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
eslint-plugin-react-data-attr
Advanced tools
ESLint rules for data attribute of React's JSX.
You'll first need to install ESLint:
$ npm i eslint --save-dev
Next, install eslint-plugin-react-data-attr
:
$ npm install eslint-plugin-react-data-attr --save-dev
Add react-data-attr
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
module.exports = {
plugins: ['react-data-attr'],
};
Then configure the rules you want to use under the rules section.
module.exports = {
rules: {
'react-data-attr/deny-upper-case': 2,
},
};
This plugin currently supports 1 rule.
Detects that uppercase letters are used in the data attribute name.
Examples of incorrect code for this rule:
const Foo = () => {
return <div data-attrName="value">bar</div>;
};
Examples of correct code for this rule:
const Foo = () => {
return <div data-attr-name="value">bar</div>;
};
Example:
module.exports = {
rules: {
'react-data-attr/deny-upper-case': [
2,
{
excludeSourceFilePatterns: [
'\\.test\\.(jsx|tsx)$', // Ignore filenames ending in `.test.jsx` or `.test.tsx`
'\\.stories\\.(jsx|tsx)$',
'\\.foo', // Ignore filenames containing `.foo`
],
},
],
},
};
Property Name | Description | Default Value |
---|---|---|
excludeSourceFilePatterns | An array of RegExp patterns. File paths that match any pattern are excluded from the check. | here |
MIT
FAQs
ESLint rules for data attribute of React's JSX
The npm package eslint-plugin-react-data-attr receives a total of 312 weekly downloads. As such, eslint-plugin-react-data-attr popularity was classified as not popular.
We found that eslint-plugin-react-data-attr 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.