Skip to content

Commit

Permalink
Merge pull request #2 from OPGG-HACKTHON/feature/1
Browse files Browse the repository at this point in the history
[#1] Code Convention setting with ESLint & Prettier
  • Loading branch information
hanbin9775 authored Jul 11, 2021
2 parents e314b08 + 87b6736 commit 5e4ecb7
Show file tree
Hide file tree
Showing 7 changed files with 140 additions and 12 deletions.
39 changes: 39 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"extends": [
"prettier",
"airbnb",
"airbnb/hooks",
"prettier/react",
"plugin:@typescript-eslint/recommended",
"prettier/@typescript-eslint",
"plugin:prettier/recommended"
],
"parser": "@typescript-eslint/parser",
"settings": {
"import/resolver": {
"node": {
"extensions": [".js", ".jsx", ".ts", ".tsx"]
}
}
},
"plugins": ["@typescript-eslint"],
"rules": {
"indent": ["error", 2],
"import/extensions": [
"error",
"ignorePackages",
{
"js": "never",
"jsx": "never",
"ts": "never",
"tsx": "never",
"json": "never"
}
],
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"no-use-before-define": "off",
"import/no-unresolved": "off",
"react/jsx-filename-extension": [1, { "extensions": [".tsx", ".ts"] }]
}
}
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"singleQuote": false,
"parser": "typescript",
"semi": true,
"useTabs": false,
"printWidth": 80,
"endOfLine": "auto"
}
72 changes: 69 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
"@types/react-dom": "^17.0.0",
"@types/react-router-dom": "^5.1.8",
"@types/styled-components": "^5.1.11",
"@typescript-eslint/eslint-plugin": "^4.28.2",
"@typescript-eslint/parser": "^4.28.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-router-dom": "^5.2.0",
Expand Down Expand Up @@ -44,5 +46,16 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"eslint": "^7.30.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-react": "^7.24.0",
"eslint-plugin-react-hooks": "^1.7.0",
"prettier": "2.3.2"
}
}
11 changes: 6 additions & 5 deletions src/Root.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { StrictMode } from 'react';
import { Router } from 'react-router-dom';
import { RecoilRoot } from 'recoil';
import App from 'components/App';
import { historySingleton } from 'singleton/history';
import React from "react";
import { StrictMode } from "react";
import { Router } from "react-router-dom";
import { RecoilRoot } from "recoil";
import App from "components/App";
import { historySingleton } from "singleton/history";

const Root = () => {
return (
Expand Down
7 changes: 4 additions & 3 deletions src/components/App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import GreetingPage from 'pages/GreetingPage';
import { Route, Switch } from 'react-router-dom';
import GlobalStyle from 'styles/GlobalStyle';
import React from "react";
import GreetingPage from "pages/GreetingPage";
import { Route, Switch } from "react-router-dom";
import GlobalStyle from "styles/GlobalStyle";

const App = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx"
"jsx": "react"
},
"include": ["src"]
}

0 comments on commit 5e4ecb7

Please sign in to comment.