Skip to content

Commit

Permalink
revamp wip
Browse files Browse the repository at this point in the history
  • Loading branch information
MoOx committed Nov 27, 2024
1 parent 1121453 commit 30bb9b2
Show file tree
Hide file tree
Showing 301 changed files with 22,841 additions and 21,263 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**/svgs/**/*.tsx
out
73 changes: 63 additions & 10 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,68 @@
/* eslint-env node */
module.exports = {
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
// @todo
// "plugin:@typescript-eslint/recommended-type-checked",
"next/core-web-vitals",
"next/typescript",
"eslint-config-prettier",
],
overrides: [
{
files: ["*.js", "*.cjs", "*.mjs"],
extends: ["plugin:@typescript-eslint/disable-type-checked"],
},
],
parser: "@typescript-eslint/parser",
root: true,
extends: ["@react-native-community/eslint-config", "eslint-config-prettier"],
rules: {
"prettier/prettier": 0,
// not interesting for rescript generated js
"no-bitwise": 0,
"no-shadow": 0,
"no-unused-vars": 0,
"no-useless-escape": 0,
parserOptions: {
project: true,
tsconfigRootDir: __dirname,
},
env: {
"jest/globals": true,
plugins: [
"@typescript-eslint",
"eslint-plugin-import",
"eslint-plugin-unused-imports",
],
rules: {
// not relevant with some switch/case usage
"no-fallthrough": "off",

// that's for escape hatch, why would we want to ban it?
"@typescript-eslint/ban-ts-comment": "off",

// handy sometimes
"@typescript-eslint/no-explicit-any": "off",

"sort-imports": [
"error",
{
ignoreCase: true,
ignoreDeclarationSort: true,
},
],
"import/order": [
"error",
{
alphabetize: {
order: "asc",
caseInsensitive: true,
},
"newlines-between": "always",
},
],

"unused-imports/no-unused-imports": "error",
"unused-imports/no-unused-vars": [
"warn",
{
vars: "all",
varsIgnorePattern: "^_",
args: "after-used",
argsIgnorePattern: "^_",
},
],
},
};
89 changes: 36 additions & 53 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,65 +1,48 @@
# OSX
#
.DS_Store
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/versions

# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
project.xcworkspace
# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# Android/IntelliJ
#
build/
.idea
.gradle
local.properties
*.iml
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# node.js
#
node_modules/
npm-debug.log
yarn-error.log
# env files (can opt-in for committing if needed)
.env*

# BUCK
buck-out/
\.buckd/
*.keystore
# vercel
.vercel

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/
# typescript
*.tsbuildinfo
next-env.d.ts

*/fastlane/report.xml
*/fastlane/Preview.html
*/fastlane/screenshots

# custom
dist
lib
.merlin
.bsb.lock
assets/SVGs/components
src/svgs/components
tmp
*.bs.js
content/**/*.json

# next.js
Expand Down
5 changes: 1 addition & 4 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

lint-staged
npm test
3 changes: 0 additions & 3 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm test
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16
22
19 changes: 11 additions & 8 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
{
"javascript.validate.enable": false,
"typescript.format.enable": false,
"typescript.validate.enable": false,
"flow.useBundledFlow": false,
"eslint.enable": true,
"triggerTaskOnSave.tasks": {
"eslint-rescript": ["src/**/*.res"]
"search.exclude": {
"**/node_modules": true,
"**/.next": true
},
"triggerTaskOnSave.delay": 1000
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"eslint.validate": ["javascript"],
"typescript.preferences.importModuleSpecifier": "non-relative",
"typescript.tsserver.experimental.enableProjectDiagnostics": true
}
18 changes: 0 additions & 18 deletions .vscode/tasks.json

This file was deleted.

4 changes: 0 additions & 4 deletions babel.config.js

This file was deleted.

30 changes: 0 additions & 30 deletions bsconfig.json

This file was deleted.

53 changes: 0 additions & 53 deletions next.config.js

This file was deleted.

52 changes: 52 additions & 0 deletions next.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import type { NextConfig } from "next";
import packageJson from "./package.json" with { type: "json" };

const transpilePackages = [
// react-native packages
"react-native",
...Object.keys(packageJson.dependencies).filter(
(dep) => dep.startsWith("react-native") || dep.startsWith("@react-native")
),
];
const nextConfig: NextConfig = {
experimental: {
turbo: {
rules: {
"*.js": {
loaders: [
{
loader: "string-replace-loader",
options: {
search: "__DEV__",
replace:
process.env.NODE_ENV !== "production" ? "true" : "false",
},
},
],
},
},
resolveAlias: {
"react-native": "react-native-web",
},
resolveExtensions: [
".web.tsx",
".web.ts",
".web.jsx",
".web.js",
".tsx",
".ts",
".jsx",
".js",
".mjs",
".json",
],
},
},
transpilePackages,

env: {
ENV: process.env.NODE_ENV,
},
};

export default nextConfig;
Loading

0 comments on commit 30bb9b2

Please sign in to comment.