Merge pull request 'Fix lint errors' (#4) from fix-lint-errors into master

Reviewed-on: billnerds/rn-playground#4
This commit is contained in:
Kat Huang 2024-01-05 19:20:57 -07:00
commit 59541ec0e8
6 changed files with 47 additions and 33 deletions

View File

@ -1,33 +1,38 @@
module.exports = {
"settings": {
"react": {
"version": "detect",
},
},
"env": {
"browser": true,
"es2021": true,
"node": true
"node": true,
},
"extends": "plugin:react/recommended",
"overrides": [
{
"env": {
"node": true
"node": true,
},
"files": [
".eslintrc.{js,cjs}"
".eslintrc.{js,cjs}",
],
"parserOptions": {
"sourceType": "script"
}
}
"sourceType": "script",
},
},
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
"sourceType": "module",
},
"plugins": [
"@typescript-eslint",
"react",
"react-hooks",
"react-native"
"react-native",
],
"rules": {
// Enforce tab width of 4 spaces
@ -39,7 +44,7 @@ module.exports = {
"no-unused-vars": "warn", // Warn about variables that are declared but not used
// Stylistic Issues
"quotes": ["error", "single"], // Enforce single quotes
"quotes": ["error", "double"], // Enforce double quotes
"semi": ["error", "always"], // Enforce semicolons at the end of statements
"no-multi-spaces": "error", // Disallow multiple spaces that are not used for indentation
"comma-dangle": ["error", "always-multiline"], // Require trailing commas for multiline

20
App.js
View File

@ -1,20 +0,0 @@
import { StatusBar } from 'expo-status-bar';
import { StyleSheet, Text, View } from 'react-native';
export default function App() {
return (
<View style={styles.container}>
<Text>Open up App.js to start working on your app!</Text>
<StatusBar style="auto" />
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
});

View File

@ -1,6 +1,6 @@
module.exports = function(api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
};
api.cache(true);
return {
presets: ["babel-preset-expo"],
};
};

View File

@ -11,6 +11,7 @@
"lint:fix": "eslint . --ext .ts,.tsx --fix"
},
"dependencies": {
"@types/react": "~18.2.14",
"@typescript-eslint/eslint-plugin": "^6.17.0",
"@typescript-eslint/parser": "^6.17.0",
"eslint": "^8.56.0",

4
tsconfig.json Normal file
View File

@ -0,0 +1,4 @@
{
"compilerOptions": {},
"extends": "expo/tsconfig.base"
}

View File

@ -2026,6 +2026,25 @@
dependencies:
undici-types "~5.26.4"
"@types/prop-types@*":
version "15.7.11"
resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.11.tgz#2596fb352ee96a1379c657734d4b913a613ad563"
integrity sha512-ga8y9v9uyeiLdpKddhxYQkxNDrfvuPrlFb0N1qnZZByvcElJaXthF1UhvCh9TLWJBEHeNtdnbysW7Y6Uq8CVng==
"@types/react@~18.2.14":
version "18.2.46"
resolved "https://registry.yarnpkg.com/@types/react/-/react-18.2.46.tgz#f04d6c528f8f136ea66333bc66abcae46e2680df"
integrity sha512-nNCvVBcZlvX4NU1nRRNV/mFl1nNRuTuslAJglQsq+8ldXe5Xv0Wd2f7WTE3jOxhLH2BFfiZGC6GCp+kHQbgG+w==
dependencies:
"@types/prop-types" "*"
"@types/scheduler" "*"
csstype "^3.0.2"
"@types/scheduler@*":
version "0.16.8"
resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.8.tgz#ce5ace04cfeabe7ef87c0091e50752e36707deff"
integrity sha512-WZLiwShhwLRmeV6zH+GkbOFT6Z6VklCItrDioxUnv+u4Ll+8vKeFySoFyK/0ctcRpOmwAicELfmys1sDc/Rw+A==
"@types/semver@^7.5.0":
version "7.5.6"
resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.6.tgz#c65b2bfce1bec346582c07724e3f8c1017a20339"
@ -3083,6 +3102,11 @@ crypto-random-string@^2.0.0:
resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-2.0.0.tgz#ef2a7a966ec11083388369baa02ebead229b30d5"
integrity sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==
csstype@^3.0.2:
version "3.1.3"
resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.3.tgz#d80ff294d114fb0e6ac500fbf85b60137d7eff81"
integrity sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==
dag-map@~1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/dag-map/-/dag-map-1.0.2.tgz#e8379f041000ed561fc515475c1ed2c85eece8d7"