-
-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit ca52be2
Showing
65 changed files
with
6,782 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
module.exports = { | ||
env: { | ||
browser: true, | ||
es2021: true, | ||
node: true, | ||
}, | ||
plugins: ['@typescript-eslint', 'simple-import-sort'], | ||
extends: [ | ||
'eslint:recommended', | ||
'next', | ||
'next/core-web-vitals', | ||
'plugin:@typescript-eslint/recommended', | ||
'prettier', | ||
], | ||
rules: { | ||
'no-unused-vars': 'off', | ||
'no-console': 'warn', | ||
'@typescript-eslint/explicit-module-boundary-types': 'off', | ||
|
||
// Sort | ||
'simple-import-sort/exports': 'warn', | ||
'simple-import-sort/imports': [ | ||
'warn', | ||
{ | ||
groups: [ | ||
// ext library & side effect imports | ||
['^@?\\w', '^\\u0000'], | ||
// {s}css files | ||
['^.+\\.s?css$'], | ||
// Lib and hooks | ||
['^@/lib', '^@/hooks'], | ||
// static data | ||
['^@/data'], | ||
// components | ||
['^@/components'], | ||
// Other imports | ||
['^@/'], | ||
// relative paths up until 3 level | ||
[ | ||
'^\\./?$', | ||
'^\\.(?!/?$)', | ||
'^\\.\\./?$', | ||
'^\\.\\.(?!/?$)', | ||
'^\\.\\./\\.\\./?$', | ||
'^\\.\\./\\.\\.(?!/?$)', | ||
'^\\.\\./\\.\\./\\.\\./?$', | ||
'^\\.\\./\\.\\./\\.\\.(?!/?$)', | ||
], | ||
['^@/types'], | ||
// other that didnt fit in | ||
['^'], | ||
], | ||
}, | ||
], | ||
}, | ||
globals: { | ||
React: true, | ||
JSX: true, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
|
||
# next.js | ||
/.next/ | ||
/out/ | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
*.pem | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# local env files | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
# vercel | ||
.vercel | ||
|
||
# next-sitemap | ||
robots.txt | ||
sitemap.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npx --no-install commitlint --edit "$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
yarn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
yarn lint-staged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
|
||
# next.js | ||
.next | ||
/.next/ | ||
/out/ | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
*.pem | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# local env files | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
# vercel | ||
.vercel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = { | ||
arrowParens: 'always', | ||
singleQuote: true, | ||
jsxSingleQuote: true, | ||
tabWidth: 2, | ||
semi: true, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"recommendations": [ | ||
// Sort Tailwind CSS class | ||
"heybourn.headwind", | ||
// Tailwind CSS Intellisense | ||
"bradlc.vscode-tailwindcss", | ||
"esbenp.prettier-vscode", | ||
"dbaeumer.vscode-eslint", | ||
"aaron-bond.better-comments" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"css.validate": false, | ||
"editor.formatOnSave": true, | ||
"editor.tabSize": 2, | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
{ | ||
//#region //*=========== React =========== | ||
"import React": { | ||
"prefix": "ir", | ||
"body": ["import * as React from 'react';"] | ||
}, | ||
"React.useState": { | ||
"prefix": "us", | ||
"body": [ | ||
"const [${1}, set${1/(^[a-zA-Z])(.*)/${1:/upcase}${2}/}] = React.useState(${2:initial${1/(^[a-zA-Z])(.*)/${1:/upcase}${2}/}})$0" | ||
] | ||
}, | ||
"React.useEffect": { | ||
"prefix": "uf", | ||
"body": ["React.useEffect(() => {", " $0", "}, []);"] | ||
}, | ||
"React.useReducer": { | ||
"prefix": "ur", | ||
"body": [ | ||
"const [state, dispatch] = React.useReducer(${0:someReducer}, {", | ||
" ", | ||
"})" | ||
] | ||
}, | ||
"React.useRef": { | ||
"prefix": "urf", | ||
"body": ["const ${1:someRef} = React.useRef($0)"] | ||
}, | ||
"React Functional Component": { | ||
"prefix": "rc", | ||
"body": [ | ||
"import * as React from 'react';\n", | ||
"export default function ${1:${TM_FILENAME_BASE}}() {", | ||
" return (", | ||
" <div>", | ||
" $0", | ||
" </div>", | ||
" )", | ||
"}" | ||
] | ||
}, | ||
//#endregion //*======== React =========== | ||
|
||
//#region //*=========== Commons =========== | ||
"Region": { | ||
"prefix": "reg", | ||
"body": [ | ||
"//#region //*=========== ${1} ===========\n", | ||
"//#endregion //*======== ${1} ===========" | ||
] | ||
}, | ||
//#endregion //*======== Commons =========== | ||
|
||
//#region //*=========== Nextjs =========== | ||
"Next Pages": { | ||
"prefix": "np", | ||
"body": [ | ||
"import * as React from 'react';\n", | ||
"import Seo from '@/components/Seo';\n", | ||
"export default function ${1:${TM_FILENAME_BASE/(^[a-zA-Z])(.*)/${1:/upcase}${2}/}}Page() {", | ||
" return (", | ||
" <>", | ||
" <Seo templateTitle='${1:${TM_FILENAME_BASE/(^[a-zA-Z])(.*)/${1:/upcase}${2}/}}' />\n", | ||
" <main>\n", | ||
" <section className=''>", | ||
" <div className='layout'>", | ||
" $0", | ||
" </div>", | ||
" </section>", | ||
" </main>", | ||
" </>", | ||
" )", | ||
"}" | ||
] | ||
}, | ||
"Next API": { | ||
"prefix": "napi", | ||
"body": [ | ||
"import { NextApiRequest, NextApiResponse } from 'next';\n", | ||
"export default function ${1:${TM_FILENAME_BASE}}(req: NextApiRequest, res: NextApiResponse) {", | ||
" if (req.method === 'GET') {", | ||
" res.status(200).json({ name: 'Bambang' });", | ||
" } else {", | ||
" res.status(405).json({ message: 'Method Not Allowed' });", | ||
" }", | ||
"}" | ||
] | ||
}, | ||
"Get Static Props": { | ||
"prefix": "gsp", | ||
"body": [ | ||
"export const getServerSideProps: GetServerSideProps = async (context) => {", | ||
" return {", | ||
" props: {}", | ||
" };", | ||
"}" | ||
] | ||
}, | ||
"Get Static Paths": { | ||
"prefix": "gspa", | ||
"body": [ | ||
"export const getStaticPaths: GetStaticPaths = async () => {", | ||
" return {", | ||
" paths: [", | ||
" { params: { $1 }}", | ||
" ],", | ||
" fallback: ", | ||
" };", | ||
"}" | ||
] | ||
}, | ||
"Get Server Side Props": { | ||
"prefix": "gssp", | ||
"body": [ | ||
"export const getServerSideProps: GetServerSideProps = async (context) => {", | ||
" return {", | ||
" props: {}", | ||
" };", | ||
"}" | ||
] | ||
}, | ||
"Import useRouter": { | ||
"prefix": "imust", | ||
"body": ["import { useRouter } from 'next/router';"] | ||
}, | ||
"Import Next Image": { | ||
"prefix": "imimg", | ||
"body": ["import Image from 'next/image';"] | ||
} | ||
//#endregion //*======== Nextjs =========== | ||
} |
Oops, something went wrong.