Skip to content

Commit 4ed547c

Browse files
committed
Set up prettier + eslint with very basic config
I feel safer this way. I don't want to keep thinking whether I want single or double quotes, and I want someone to point me out dumb mistakes I may make in JS.
1 parent 548f389 commit 4ed547c

File tree

5 files changed

+1869
-12
lines changed

5 files changed

+1869
-12
lines changed

.eslintrc.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es2021": true
5+
},
6+
"extends": [
7+
"eslint:recommended",
8+
"plugin:react/recommended"
9+
],
10+
"overrides": [
11+
],
12+
"parserOptions": {
13+
"ecmaVersion": "latest",
14+
"sourceType": "module"
15+
},
16+
"plugins": [
17+
"react",
18+
"unused-imports"
19+
],
20+
"rules": {
21+
"no-unused-vars": "off",
22+
"unused-imports/no-unused-imports": "error",
23+
"unused-imports/no-unused-vars": [
24+
"warn",
25+
{ "vars": "all", "varsIgnorePattern": "^_", "args": "after-used", "argsIgnorePattern": "^_" }
26+
]
27+
}
28+
}

App.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as Notifications from "expo-notifications";
33
import { StatusBar } from 'expo-status-bar';
44
import { WebView } from 'react-native-webview';
55
import registerForPushNotificationsAsync from './lib/pushNotifications';
6-
import { StyleSheet, Text, View, BackHandler } from 'react-native';
6+
import { StyleSheet, BackHandler } from 'react-native';
77
import Constants from "expo-constants";
88
import handleExternalLinks from './lib/handleExternalLinks';
99
import injectCustomJavaScript from './lib/injectCustomJavaScript.js';
@@ -40,7 +40,7 @@ export default function App() {
4040
} catch (err) {
4141
console.log("[handleBackButtonPress] Error : ", err.message);
4242
} finally {
43-
return true;
43+
return true; // eslint-disable-line no-unsafe-finally
4444
}
4545
};
4646

0 commit comments

Comments
 (0)