Skip to content

Commit 571f106

Browse files
NickGerlemanfacebook-github-bot
authored andcommitted
Simplify Template ESLint Configuration
Summary: ESLint configuration is derived from `react-native/eslint-config`, which has supported Flow, vanilla JS, and TypeScript. react-native-community/react-native-template-typescript#238 and a related PR ended up adding new rules to the TypeScript config, to fix bugs with TS linting. It required a followup change, to specify the parser/plugin, and explicity reference them as devDependencies. react-native-community/react-native-template-typescript#240 `react-native/eslint-config` already includes setting the plugin/parser. But overriding rules requires declaring that again, and directly referencing a plugin means a need for the app to declare dependencies, since ESLint resolves modules from the current config. The rules overridedn were later fixed in `react-native/eslint-config`, which is really the right place for the fix (e.g. facebook#32644). I noticed this when deriving from the TS template in facebook#32644 and removed the rule overrides, but didn't have the historical context to realize this means we can then: 1. Remove the explicit parser/plugins since `react-native/eslint-config` already sets them, and we are no longer overriding any rules. 2. Remove the devDependencies, to let the versions be managed entirely by `react-native/eslint-config`. Changelog: [General][Changed] - Simplify Template ESLint Configuration Differential Revision: D41652699 fbshipit-source-id: 67620f12f8fa0ec94fc4db2cbbd2a60a62b70874
1 parent da4243b commit 571f106

File tree

2 files changed

+0
-4
lines changed

2 files changed

+0
-4
lines changed

template/_eslintrc.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
module.exports = {
22
root: true,
33
extends: '@react-native',
4-
parser: '@typescript-eslint/parser',
5-
plugins: ['@typescript-eslint'],
64
};

template/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
"@types/jest": "^29.2.1",
2323
"@types/react": "^18.0.24",
2424
"@types/react-test-renderer": "^18.0.0",
25-
"@typescript-eslint/eslint-plugin": "^5.37.0",
26-
"@typescript-eslint/parser": "^5.37.0",
2725
"babel-jest": "^29.2.1",
2826
"eslint": "^8.19.0",
2927
"jest": "^29.2.1",

0 commit comments

Comments
 (0)