Skip to content

Commit 29106d5

Browse files
authored
docs: how to handle files ignored by typescript (#82)
1 parent 8fdb40b commit 29106d5

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

packages/eslint-plugin/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,24 @@ Update your `.vscode/settings.json` by adding the directories of apps using the
4141
}
4242
```
4343

44+
### Handling files ignored by TypeScript
45+
46+
The plugin default behavior is to use TypeScript configuration to lint all TypeScript files. However, in your project, there may be files you've chosen to ignore with TypeScript. It's advisable to also disable ESLint checking for these files. To achieve this, add the files you want to ignore with ESLint in the overrides section of your `eslintrc.js`. Below is an example illustrating this. The configuration for mock files is overridden: the TypeScript parser is removed, and the behavior of the `@typescript-eslint/return-await` rule is modified.
47+
48+
```javascript
49+
overrides: [
50+
{
51+
files: ["mocks/**/*"],
52+
parserOptions: {
53+
project: null,
54+
},
55+
rules: {
56+
"@typescript-eslint/return-await": "off",
57+
},
58+
},
59+
];
60+
```
61+
4462
### ⚠️ React version
4563

4664
With the introduction of React 18, it's no longer necessary to import React in your JSX files. The ESLint plugin is configured for React version 18 and above, so you won't encounter any errors. However, TypeScript will generate an error if it isn't configured correctly. To resolve this, simply add `"jsx": "react-native"` to your `tsconfig.json` file.

0 commit comments

Comments
 (0)