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

Dev #22

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Dev #22

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
57 changes: 57 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"root": true,
"env": {
"browser": true,
"node": true
},
"parser": "@typescript-eslint/parser",
"extends": [
"eslint:recommended",
"plugin:prettier/recommended",
"plugin:tailwind/recommended",
"next", // includes eslint-plugin-react / eslint-plugin-react-hooks /eslint-plugin-next
"next/core-web-vitals",
"prettier" // deletes props with conflict with prettier
],
"rules": {
"no-console": "warn",
"react/prop-types": "off",
"react/display-name": "off",
"react/jsx-indent-props": [2, "first"],
"import/prefer-default-export": "off",
"import/no-cycle": "off",
"no-multi-assign": "off",
"react/react-in-jsx-scope": "off",
"jsx-a11y/anchor-is-valid": "off",
"no-unused-vars": "warn",
"import/order": [
"warn",
{
"pathGroups": [
{
"pattern": "@/**",
"group": "external",
"position": "after"
}
],
"newlines-between": "always"
}
],
"react/jsx-sort-props": [
"error",
{
"callbacksLast": true,
"shorthandFirst": true,
"noSortAlphabetically": false,
"reservedFirst": true
}
],
"padding-line-between-statements": [
"error",
{ "blankLine": "always", "prev": "*", "next": "return" },
{ "blankLine": "always", "prev": ["const", "let", "var"], "next": "*" },
{ "blankLine": "any", "prev": ["const", "let", "var"], "next": ["const", "let", "var"] }
]
},
"plugins": ["import", "@typescript-eslint"]
}
24 changes: 0 additions & 24 deletions .eslintrc.js

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ jobs:
run: |
yarn install

- name: Run Prettier and ESlint
- name: Run Prettier and ESLint
run: |
yarn lint
yarn eslint

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

yarn eslint --fix
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No me gusta que te edite el codigo sin que te des cuenta 😕
como prefieras, no es nada grave igual xD

Suggested change
yarn eslint --fix
yarn eslint

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Buen punto eh, tenes razon banco también que no hayan sorpresas

6 changes: 2 additions & 4 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{
"arrowParens": "always",
"arrowParens": "avoid",
"bracketSpacing": true,
"embeddedLanguageFormatting": "auto",
"htmlWhitespaceSensitivity": "css",
"insertPragma": false,
"jsxBracketSameLine": false,
"jsxSingleQuote": true,
"printWidth": 100,
Expand All @@ -14,6 +13,5 @@
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5",
"useTabs": false,
"vueIndentScriptAndStyle": false
"useTabs": false
}
39 changes: 0 additions & 39 deletions .vscode/launch.json

This file was deleted.

15 changes: 15 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
// other settings
// formatting using eslint
// let editor format using prettier for all other files
"editor.formatOnSave": true,
// disable editor formatting, so eslint can handle it
"[javascript]": {
"editor.formatOnSave": false
},
// available through eslint plugin in vscode
"eslint.alwaysShowStatus": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
}
18 changes: 0 additions & 18 deletions .vscode/tasks.json

This file was deleted.

15 changes: 0 additions & 15 deletions jsconfig.json

This file was deleted.

14 changes: 0 additions & 14 deletions jsconfig.server.json

This file was deleted.

10 changes: 5 additions & 5 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
const securityHeaders = require('./src/lib/security')

const plugins = require('next-compose-plugins')
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
})

const withOffline = require('next-offline')

// const securityHeaders = require('./src/lib/security')

function esbuildLoader(config, options) {
const jsLoader = config.module.rules.find((rule) => rule.test && rule.test.test('.js'))
const jsLoader = config.module.rules.find(rule => rule.test && rule.test.test('.js'))

if (jsLoader && jsLoader.use) {
if (jsLoader.use.length > 0) {
jsLoader.use.forEach((e) => {
jsLoader.use.forEach(e => {
e.loader = 'esbuild-loader'
e.options = options
})
Expand Down
30 changes: 11 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{
"name": "react-three-next",
"version": "2.0.0",
"name": "coderhood",
"version": "1.0.0",
"authors": [
"Renaud ROHLINGER <https://twitter.com/onirenaud>"
"Emanuel Lorenzo <https://twitter.com/aemalorenzo>",
"Tomas Discoli <https://twitter.com/tomasdisk>"
],
"private": false,
"scripts": {
"lint": "yarn prettier && yarn eslint",
"eslint": "eslint --max-warnings 20 'src/**/*.{js,jsx}' --ext jsconfig.json",
"eslint-fix": "eslint --fix 'src/**/*.{js,jsx}' --ext jsconfig.json",
"eslint": "eslint --max-warnings 50 'src/**/*.{js,jsx,ts,tsx}' --ext tsconfig.json",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

50 👀
Lol cada vez mas grande!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jajaja era para que me deje pushear y me colgué. Lo tengo que sacar 😅

"eslint-fix": "eslint --fix 'src/**/*.{js,jsx,ts,tsx}' --ext tsconfig.json",
"prettier": "prettier --list-different '**/*.{js,jsx,md}'",
"tsc": "tsc --noEmit",
"dev": "next dev",
Expand All @@ -17,14 +18,6 @@
"analyze": "ANALYZE=true next build",
"start": "next start"
},
"lint-staged": {
"*.{js,jsx,json,md}": [
"prettier --write"
],
"*.{js,jsx}": [
"eslint --fix"
]
},
"dependencies": {
"@code-surfer/themes": "^3.1.1",
"@headlessui/react": "^1.2.0",
Expand Down Expand Up @@ -53,24 +46,23 @@
"@next/bundle-analyzer": "^10.0.7",
"@types/node": "^16.3.3",
"@types/react": "^17.0.14",
"@typescript-eslint/eslint-plugin": "^4.28.5",
"@typescript-eslint/parser": "^4.28.5",
"autoprefixer": "^10.2.6",
"babel-eslint": "^10.1.0",
"babel-plugin-glsl": "^1.0.0",
"code-surfer": "^3.1.1",
"eslint": "^7.25.0",
"eslint": "^7.31.0",
"eslint-config-next": "^11.0.1",
"eslint-config-prettier": "^8.3.0",
"eslint-config-react-app": "^6.0.0",
"eslint-plugin-flowtype": "^5.2.2",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-react": "^7.23.2",
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-plugin-tailwind": "^0.2.1",
"file-loader": "^6.2.0",
"glslify": "^7.1.1",
"glslify-loader": "^2.0.0",
"lint-staged": "^10.5.4",
"husky": "^7.0.1",
"mdx-code": "^2.0.0",
"mdx-deck": "^4.1.1",
"next-compose-plugins": "^2.2.1",
Expand Down
8 changes: 0 additions & 8 deletions sandbox.config.json

This file was deleted.

9 changes: 5 additions & 4 deletions src/components/Account.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useState, useEffect } from 'react'

import { supabase } from '@/lib/supabaseClient'

export const Account = ({ session }) => {
Expand Down Expand Up @@ -69,15 +70,15 @@ export const Account = ({ session }) => {
<div className='form-widget'>
<div>
<label htmlFor='email'>Email</label>
<input id='email' type='text' value={session.user.email} disabled />
<input disabled id='email' type='text' value={session.user.email} />
</div>
<div>
<label htmlFor='username'>Name</label>
<input
id='username'
type='text'
value={username || ''}
onChange={(e) => setUsername(e.target.value)}
onChange={e => setUsername(e.target.value)}
/>
</div>
<div>
Expand All @@ -86,15 +87,15 @@ export const Account = ({ session }) => {
id='website'
type='website'
value={website || ''}
onChange={(e) => setWebsite(e.target.value)}
onChange={e => setWebsite(e.target.value)}
/>
</div>

<div>
<button
className='block button primary'
onClick={() => updateProfile({ username, website, avatar_url })}
disabled={loading}
onClick={() => updateProfile({ username, website, avatar_url })}
>
{loading ? 'Loading ...' : 'Update'}
</button>
Expand Down
Loading