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.
eslint-config-react-native
Advanced tools
Pluggable ESLint config for React Native that you can import, extend and override
In your js project directory:
npm install --save-dev eslint-config-react-native
And in your .eslintrc.yaml
:
extends:
- react-native
Alternatively, in your .eslintrc.js
or .eslintrc.json
:
{
"extends": ["react-native"]
}
To add a git-hook to your commits, consider using husky
npm install --save-dev husky
And in your package.json
:
"scripts": {
"precommit": "eslint ."
}
This config is biased and opinionated, and errs on the side of too many rules instead of too few. Think of this as a superset of your repo's lint config, and discard what you don't like in it. It's easy to override and disable the rules you find inconvenient.
env:
browser: true
enables browser features and global variables
plugins:
- react
- react-native
provides React, JSX and React Native specific rules
extends:
- esnext
- plugin:react/recommended
enables jsx
parsing, includes config and rules from eslint-config-esnext and the following react-specific recommended rules:
react/display-name
: prevent missing displayName
in a React component definitionreact/jsx-no-duplicate-props
: prevent duplicate properties in JSX componentsreact/jsx-no-undef
: disallow undeclared variables as JSX componentsreact/jsx-uses-react
: prevent React from being marked as unused in a file using JSXreact/jsx-uses-vars
: prevent variables used in JSX to be incorrectly marked as unusedreact/no-deprecated
: prevent usage of deprecated methodsreact/no-direct-mutation-state
: prevent direct mutation of this.state
react/no-is-mounted
: prevent usage of isMounted
react/no-unknown-property
: prevent usage of unknown DOM propertyreact/prop-types
: prevent missing props validation in a React component definitionreact/react-in-jsx-scope
: prevent missing React
when using JSXreact/require-render-return
: prevent missing return
in render()
rules:
selected from here, configured to:
react-native/no-color-literals
: detect StyleSheet
rules and inline styles containing color literals instead of variablesreact-native/no-inline-styles
: detect JSX components with inline styles that contain literal valuesreact-native/no-unused-styles
: detect unused StyleSheet
rulesreact-native/split-platform-components
: enforce using platform specific filenames when necessaryreact/jsx-boolean-value
: prefer shorthand if an attribute has a true
value in JSXreact/jsx-handler-names
: enforce event handler naming conventions in JSXreact/jsx-key
: validate JSX has key
prop when in array or iterator; set to warn onlyreact/jsx-no-bind
: prevent usage of .bind()
and arrow functions in JSX props; set to warn onlyreact/jsx-pascal-case
: enforce PascalCase for user-defined JSX componentsreact/jsx-wrap-multilines
: prevent missing parentheses around multiline JSXreact/no-danger
: prevent usage of dangerouslySetInnerHTML
react/no-did-mount-set-state
: prevent usage of setState
in componentDidMount
, but allow inside callbacksreact/no-did-update-set-state
: prevent usage of setState
in componentDidUpdate
, but allow inside callbacksreact/no-find-dom-node
: Prevent usage of findDOMNode
react/no-multi-comp
: prevent multiple component definitions per file, apart from stateless functional componentsreact/no-render-return-value
: prevent usage of the return value of ReactDOM.render()
react/no-string-refs
: prevent using string references in ref
attributereact/no-unused-prop-types
: prevent definitions of unused prop typesreact/prefer-es6-class
: enforce ES5 or ES6 class for React Componentsreact/prefer-stateless-function
: enforce stateless React Components to be written as a pure functionFAQs
Pluggable ESLint config for React Native that you can import, extend and override
The npm package eslint-config-react-native receives a total of 27,954 weekly downloads. As such, eslint-config-react-native popularity was classified as popular.
We found that eslint-config-react-native 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
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.