Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add eslint #1

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions apps/expo/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
extends: ['universe/native', 'custom'],
ignorePatterns: ['./android', './ios'],
}
16 changes: 9 additions & 7 deletions apps/expo/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
{
"name": "expo-app",
"version": "1.0.0",
"main": "index.js",
"private": true,
"main": "index.js",
"scripts": {
"start": "npx expo start -c",
"android": "npx expo run:android",
"eject": "npx expo eject",
"ios": "npx expo run:ios",
"eject": "npx expo eject"
"start": "npx expo start -c"
},
"resolutions": {
"metro": "0.76.0",
"metro-resolver": "0.76.0"
},
"dependencies": {
"@babel/runtime": "^7.18.9",
Expand Down Expand Up @@ -41,13 +45,11 @@
"@expo/metro-config": "~0.10.0",
"@tamagui/babel-plugin": "^1.80.4",
"babel-plugin-transform-inline-environment-variables": "^0.4.4",
"eslint-config-custom": "0.0.0",
"eslint-config-universe": "^11.3.0",
"metro-minify-terser": "^0.74.1",
"typescript": "^5.1.3"
},
"resolutions": {
"metro": "0.76.0",
"metro-resolver": "0.76.0"
},
"overrides": {
"metro": "0.76.0",
"metro-resolver": "0.76.0"
Expand Down
2 changes: 1 addition & 1 deletion apps/next/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
extends: 'next',
root: true,
extends: ['next', 'custom'],
}
10 changes: 6 additions & 4 deletions apps/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "cd ../.. && yarn build && cd apps/next && next build",
"start": "next start",
"dev": "next dev",
"lint": "next lint",
"serve": "NODE_ENV=production next start --port 8151",
"lint": "next lint"
"start": "next start"
},
"dependencies": {
"@tamagui/config": "^1.80.4",
Expand All @@ -20,11 +20,13 @@
"react-native": "0.72.6",
"react-native-web": "~0.19.6",
"react-native-web-lite": "^1.80.4",
"tamagui": "^1.80.4",
"vercel": "latest"
},
"devDependencies": {
"@tamagui/next-plugin": "^1.80.4",
"@types/node": "^18.6.4",
"eslint-config-next": "^13.0.4"
"eslint-config-custom": "0.0.0",
"eslint-config-next": "^13.4.12"
}
}
5 changes: 3 additions & 2 deletions apps/next/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import '@tamagui/font-inter/css/400.css'
import '@tamagui/font-inter/css/700.css'
import 'raf/polyfill'

import { NextThemeProvider, useRootTheme } from '@tamagui/next-theme'
import { ColorScheme, NextThemeProvider, useRootTheme } from '@tamagui/next-theme'
import { Provider } from 'app/provider'
import Head from 'next/head'
import React from 'react'
Expand Down Expand Up @@ -34,7 +34,8 @@ function ThemeProvider({ children }: { children: React.ReactNode }) {
return (
<NextThemeProvider
onChangeTheme={(next) => {
setTheme(next as any)
// TODO: next type needs to be fixed
setTheme(next as unknown as ColorScheme)
}}
>
<Provider disableRootThemeClass defaultTheme={theme}>
Expand Down
4 changes: 2 additions & 2 deletions apps/next/pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ export default class Document extends NextDocument {
AppRegistry.registerComponent('Main', () => Main)
const page = await ctx.renderPage()

// @ts-ignore
// @ts-expect-error - need to fix types in @types/react-native-web
const { getStyleElement } = AppRegistry.getApplication('Main')

/**
* Note: be sure to keep tamagui styles after react-native-web styles like it is here!
* Note: be sure to keep Tamagui styles after react-native-web styles like it is here!
* So Tamagui styles can override the react-native-web styles.
*/
const styles = [
Expand Down
21 changes: 11 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,27 @@
"packages/*"
],
"scripts": {
"build": "yarn workspaces foreach --all --exclude next-app run build",
"check-deps": "check-dependency-version-consistency .",
"fix": "manypkg fix",
"postinstall": "yarn check-deps && yarn build",
"lint": "turbo lint",
"native": "cd apps/expo && yarn start",
"watch": "yarn workspaces foreach -pi run watch",
"upgrade:tamagui": "yarn up '*tamagui*'@latest '@tamagui/*'@latest react-native-web-lite@latest",
"upgrade:tamagui:canary": "yarn up '*tamagui*'@canary '@tamagui/*'@canary react-native-web-lite@canary",
"vercel:install": "yarn set version 3.5 && yarn install",
"watch": "yarn workspaces foreach -pi run watch",
"web": "yarn build && cd apps/next && yarn next",
"web:extract": "DISABLE_EXTRACTION=false yarn workspace next-app dev",
"web:prod": "yarn workspace next-app build",
"web:prod:serve": "yarn workspace next-app serve",
"fix": "manypkg fix",
"postinstall": "yarn check-deps && yarn build",
"build": "yarn workspaces foreach --all --exclude next-app run build",
"upgrade:tamagui": "yarn up '*tamagui*'@latest '@tamagui/*'@latest react-native-web-lite@latest",
"upgrade:tamagui:canary": "yarn up '*tamagui*'@canary '@tamagui/*'@canary react-native-web-lite@canary",
"check-deps": "check-dependency-version-consistency ."
"web:prod:serve": "yarn workspace next-app serve"
},
"resolutions": {
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-refresh": "^0.14.0",
"react-native-svg": "13.9.0",
"react-native-web": "~0.19.6"
"react-native-web": "~0.19.6",
"react-refresh": "^0.14.0"
},
"dependencies": {
"@babel/runtime": "^7.18.9",
Expand Down
3 changes: 3 additions & 0 deletions packages/app/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ['custom'],
}
7 changes: 4 additions & 3 deletions packages/app/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"version": "0.0.0",
"name": "app",
"main": "index.ts",
"version": "0.0.0",
"private": true,
"sideEffects": [
"*.css"
],
"main": "index.ts",
"dependencies": {
"@my/ui": "0.0.1",
"@tamagui/animations-react-native": "^1.80.4",
Expand All @@ -22,6 +22,7 @@
},
"devDependencies": {
"@types/react": "^18.0.27",
"@types/react-native": "^0.71.3"
"@types/react-native": "^0.71.3",
"eslint-config-custom": "0.0.0"
}
}
23 changes: 23 additions & 0 deletions packages/eslint-config-custom/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module.exports = {
parser: '@typescript-eslint/parser',
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
],
rules: {
'react/react-in-jsx-scope': 'off',
'react/prop-types': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unused-vars': 'warn',
'react/no-unescaped-entities': 'warn',
'react-hooks/rules-of-hooks': 'warn',
},
settings: {
'import/ignore': ['react-native'],
react: {
version: 'detect',
},
},
}
9 changes: 9 additions & 0 deletions packages/eslint-config-custom/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "eslint-config-custom",
"version": "0.0.0",
"private": true,
"devDependencies": {
"@vercel/style-guide": "^4.0.2",
"eslint-config-turbo": "^1.10.12"
}
}
4 changes: 4 additions & 0 deletions packages/ui/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
root: true,
extends: ['custom'],
}
11 changes: 6 additions & 5 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
{
"name": "@my/ui",
"version": "0.0.1",
"private": true,
"sideEffects": [
"*.css"
],
"private": true,
"types": "./types/index",
"main": "src/index.tsx",
"module:jsx": "src",
"types": "./types/index",
"files": [
"types",
"dist"
Expand All @@ -26,6 +25,8 @@
"tamagui": "^1.80.4"
},
"devDependencies": {
"@tamagui/build": "^1.80.4"
}
"@tamagui/build": "^1.80.4",
"eslint-config-custom": "0.0.0"
},
"module:jsx": "src"
}
1 change: 1 addition & 0 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"dependsOn": ["^build"],
"outputs": [".next/**", "!.next/cache/**", "build/**", "node_modules/.cache/metro/**"]
},
"lint": {},
"dev": {
"cache": false,
"persistent": true
Expand Down
Loading