Skip to content

Commit 8813c00

Browse files
committed
Add guidance on making this config work on non-React projects
1 parent 610ebf6 commit 8813c00

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,20 @@ module.exports = {
2626
- Use ESLint’s [`--report-unused-disable-directives`](https://eslint.org/docs/user-guide/command-line-interface#--report-unused-disable-directives) flag to ensure you do not use more `eslint-disable` comments than needed.
2727
- This config is [Prettier](https://prettier.io/)-compatible, but it is still usable by projects which do not wish to use Prettier.
2828

29+
### React
30+
31+
This config is meant first and foremost for React projects, where it will detect which rules to apply based on the version of React used on the project. The config can also be used on non-React projects – just make sure to disable the version check by adding: the following in your config:
32+
33+
```js
34+
module.exports = {
35+
// [...]
36+
settings: {
37+
// Manually set the version to disable automated detection of the "react" dependency.
38+
react: { version: 'latest' },
39+
},
40+
};
41+
```
42+
2943
### Experimental syntax
3044

3145
By default, this config uses ESLint’s built-in parser, which doesn’t support [experimental ECMAScript features](https://github.com/eslint/eslint/blob/a675c89573836adaf108a932696b061946abf1e6/README.md#what-about-experimental-features). If your code uses experimental syntax transpiled with Babel, make sure to set the ESLint parser to [babel-eslint](https://github.com/babel/babel-eslint):

0 commit comments

Comments
 (0)