e0aec42efd
Summary: Our ESLint configuration currently disallows template literals that can be expressed using plain string syntax (with single quotes). Jest's inline snapshots feature sometimes produces such template literals. This not only adds unnecessary friction from the linter, but can break subsequent snapshot updates in a test file (after accepting the ESLint autofix). This conflict between Jest and ESLint is a known issue (https://github.com/facebook/jest/issues/10164) with no upstream fix. Here we relax the linter's settings to allow all template literals in test files. Ideally we could allow them *only* in inline snapshots, but this is a reasonable approximation. Changelog: [Internal] Reviewed By: MichaReiser Differential Revision: D28120785 fbshipit-source-id: c6c6c0ab8a3b8aca14df06f430b777cef42cd554 |
||
---|---|---|
.. | ||
README.md | ||
index.js | ||
package.json | ||
yarn.lock |
README.md
eslint-config-react-native-community
Installation
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
Usage
Add to your eslint config (.eslintrc
, or eslintConfig
field in package.json
):
{
"extends": "@react-native-community"
}