Skip to content

Commit fa3d88a

Browse files
authored
Merge pull request #2 from garageScript/initial
Creating Next.JS template with TypeScript and ESLint
2 parents 238f48d + c5e02f9 commit fa3d88a

File tree

11 files changed

+6427
-1
lines changed

11 files changed

+6427
-1
lines changed

.eslintrc.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es6": true,
5+
"node": true
6+
},
7+
"extends": [
8+
"eslint:recommended",
9+
"plugin:react/recommended",
10+
"plugin:@typescript-eslint/eslint-recommended",
11+
"plugin:prettier/recommended",
12+
"prettier/@typescript-eslint"
13+
],
14+
"globals": {
15+
"Atomics": "readonly",
16+
"SharedArrayBuffer": "readonly"
17+
},
18+
"parser": "@typescript-eslint/parser",
19+
"parserOptions": {
20+
"ecmaFeatures": {
21+
"jsx": true
22+
},
23+
"ecmaVersion": 2018,
24+
"sourceType": "module"
25+
},
26+
"plugins": [
27+
"react",
28+
"@typescript-eslint"
29+
],
30+
"rules": {
31+
},
32+
"settings": {
33+
"react": {
34+
"version": "detect"
35+
}
36+
}
37+
}

.prettierrc.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
semi: false,
3+
singleQuote: true,
4+
parser: 'typescript',
5+
trailingComma: 'none',
6+
};

README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
11
# c0d3.com
22

3-
Repo for c0d3.com. A website to train people to be full stack software engineers.
3+
Repo for c0d3.com powered by NextJS. A website to train people to be full stack software engineers.
4+
5+
## Prerequisites
6+
7+
- Node.JS
8+
- Git
9+
10+
## How to Start
11+
12+
1. Clone the repository with SSH or HTTPS
13+
> SSH - `git clone git@github.com:garageScript/c0d3.com.git`
14+
15+
> HTTPS - `git clone https://github.com/garageScript/c0d3.com.git`
16+
2. After cloning the repository, run `npm install`.
17+
3. Start the local development server with `npm run dev`.
18+
4. Navigate to `http://localhost:3000` to view your application.
19+
20+
## Contributing
21+
22+
Watch the video below to find out how to develop with TypeScript in React
23+
24+
[![React TypeScript Tutorial](http://i3.ytimg.com/vi/Z5iWr6Srsj8/hqdefault.jpg)](https://www.youtube.com/watch?v=Z5iWr6Srsj8)
25+
26+
Before submitting your code run `npm run autofix`.

components/.gitkeep

Whitespace-only changes.

next-env.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/// <reference types="next" />
2+
/// <reference types="next/types/global" />

package.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "with-typescript",
3+
"version": "1.0.0",
4+
"scripts": {
5+
"dev": "next",
6+
"build": "next build",
7+
"start": "next start",
8+
"lint": "eslint . --ext .ts --ext .tsx",
9+
"autofix": "eslint . --ext .ts --ext .tsx --fix",
10+
"type-check": "tsc"
11+
},
12+
"dependencies": {
13+
"isomorphic-unfetch": "3.0.0",
14+
"next": "latest",
15+
"react": "^16.12.0",
16+
"react-dom": "^16.12.0"
17+
},
18+
"devDependencies": {
19+
"@types/node": "^12.12.21",
20+
"@types/react": "^16.9.16",
21+
"@types/react-dom": "^16.9.4",
22+
"@typescript-eslint/eslint-plugin": "^2.17.0",
23+
"@typescript-eslint/parser": "^2.17.0",
24+
"eslint": "^6.8.0",
25+
"eslint-config-prettier": "^6.9.0",
26+
"eslint-plugin-prettier": "^3.1.2",
27+
"eslint-plugin-react": "^7.18.0",
28+
"prettier": "^1.19.1",
29+
"typescript": "3.7.3"
30+
},
31+
"license": "ISC"
32+
}

pages/index.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import * as React from 'react'
2+
3+
const IndexPage: React.FC = () => {
4+
return <h1>c0d3.com under construction</h1>
5+
}
6+
7+
export default IndexPage

pages/login.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import * as React from 'react'
2+
3+
const Login: React.FC = () => {
4+
return <h1>Login</h1>
5+
}
6+
7+
export default Login

pages/register.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import * as React from 'react'
2+
3+
const Register: React.FC = () => {
4+
return <h1>Register</h1>
5+
}
6+
7+
export default Register

tsconfig.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"compilerOptions": {
3+
"allowJs": true,
4+
"alwaysStrict": true,
5+
"esModuleInterop": true,
6+
"forceConsistentCasingInFileNames": true,
7+
"isolatedModules": true,
8+
"jsx": "preserve",
9+
"lib": ["dom", "es2017"],
10+
"module": "esnext",
11+
"moduleResolution": "node",
12+
"noEmit": true,
13+
"noFallthroughCasesInSwitch": true,
14+
"noUnusedLocals": true,
15+
"noUnusedParameters": true,
16+
"resolveJsonModule": true,
17+
"skipLibCheck": false,
18+
"strict": true,
19+
"target": "esnext"
20+
},
21+
"exclude": ["node_modules"],
22+
"include": ["**/*.ts", "**/*.tsx"]
23+
}

0 commit comments

Comments
 (0)