Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
eslint-config-kingstinct-react-native
Advanced tools
ESLint configuration for React-native based on Airbnb with some great tweaks
If you see something that could be improved based on these principles, please submit a pull request! :)
This is the base eslint config I use for React Native. It's based on the popular Airbnb-config with a few plugin additions:
I've also made some minor changes to the rules, so if you've got other preferences you might want to override some rules. I highly recommend you to use eslint, flowtype with plugins for your texteditor/IDE.
The two main principles are to catch errors early on and to boost productivity (so for example I've disabled react/sort-comp as it's not fixed automatically yet).
Why? Many lodash methods are mutable which might cause hard-to-debug side effects, especially when using redux . With lodash-fp you're safe.
Disable if you really want to use the mutable lodash flavour (not recommended). Add this to your .eslintrc:
{ ...,
rules: { ...,
'lodash-fp/use-fp': 0
}
}
npm info "eslint-config-kingstinct-react-native@latest" peerDependencies
Linux/OSX users can run (if you're using NPM)
(
export PKG=eslint-config-kingstinct-react-native;
npm info "$PKG@latest" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs npm install --save-dev "$PKG@latest"
)
or (if you're using yarn)
(
export PKG=eslint-config-kingstinct-react-native;
npm info "$PKG@latest" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs yarn add --dev "$PKG@latest"
)
Which produces and runs a command like:
npm install --save-dev eslint-config-kingstinct-react-native eslint@^#.#.# eslint-plugin-jsx-a11y@^#.#.# eslint-plugin-import@^#.#.# eslint-plugin-react@^#.#.#
Windows users can either install all the peer dependencies manually, or use the install-peerdeps cli tool.
npm install -g install-peerdeps
install-peerdeps --dev eslint-config-kingstinct-react-native
The cli will produce and run a command like:
npm install --save-dev eslint-config-kingstinct-react-native eslint@^#.#.# eslint-plugin-jsx-a11y@^#.#.# eslint-plugin-import@^#.#.# eslint-plugin-react@^#.#.#
"extends": "kingstinct-react-native"
to your .eslintrcPrevious versions (before 4.0) used flow for type checking.
You can run tests with npm test
. It will run the lint config on the project itself.
FAQs
ESLint configuration for React-native based on Airbnb with some great tweaks
We found that eslint-config-kingstinct-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
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.