Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@react-native-community/eslint-config
Advanced tools
@react-native-community/eslint-config is an ESLint configuration package specifically tailored for React Native projects. It provides a set of linting rules and configurations that help maintain code quality and consistency in React Native applications.
Standard React Native Linting Rules
This feature provides a standard set of linting rules for React Native projects. By extending the @react-native-community configuration, you can ensure that your code adheres to best practices and common conventions in the React Native community.
{
"extends": ["@react-native-community"]
}
Integration with Prettier
This feature allows you to integrate Prettier with ESLint, ensuring that your code is not only linted but also formatted according to Prettier's rules. This helps in maintaining a consistent code style across your project.
{
"extends": ["@react-native-community", "prettier"],
"plugins": ["prettier"],
"rules": {
"prettier/prettier": "error"
}
}
Customizable Rules
This feature allows you to customize the linting rules according to your project's needs. You can override the default rules provided by @react-native-community to better fit your development workflow.
{
"extends": ["@react-native-community"],
"rules": {
"no-console": "warn",
"react-native/no-inline-styles": "off"
}
}
eslint-config-airbnb is a popular ESLint configuration that follows the Airbnb JavaScript style guide. It is widely used in both React and React Native projects. Compared to @react-native-community/eslint-config, it provides a more general set of rules that are not specifically tailored for React Native.
eslint-config-standard is another popular ESLint configuration that follows the JavaScript Standard Style. It is less opinionated than eslint-config-airbnb and provides a simpler set of rules. While it can be used in React Native projects, it does not offer the specific rules and configurations that @react-native-community/eslint-config provides.
eslint-config-react-app is the ESLint configuration used by Create React App. It is designed for React projects and includes rules for both JavaScript and JSX. While it can be used in React Native projects, it is more focused on web development and does not include React Native-specific rules.
yarn add --dev eslint prettier @react-native-community/eslint-config
Note: We're using yarn
to install deps. Feel free to change commands to use npm
3+ and npx
if you like
Add to your eslint config (.eslintrc
, or eslintConfig
field in package.json
):
{
"extends": "@react-native-community"
}
FAQs
ESLint config for React Native
The npm package @react-native-community/eslint-config receives a total of 353,679 weekly downloads. As such, @react-native-community/eslint-config popularity was classified as popular.
We found that @react-native-community/eslint-config demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 31 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.