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

[#10] Eslint 관련 버그 수정 #12

Merged
merged 4 commits into from
Aug 1, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
34 changes: 31 additions & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,54 @@
"eslint:recommended",
"plugin:react/recommended",
"airbnb",
"airbnb-typescript",
"plugin:prettier/recommended"
],
"settings": {
"react": {
"version": "detect"
},
"import/extensions": [".js", ".jsx", ".ts", ".tsx"],
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"]
},
"import/resolver": {
"typescript": {
"alwaysTryTypes": true,
"project": "./tsconfig.json"
},
"node": {
"extensions": [".js", ".jsx", ".ts", ".tsx"]
}
}
},
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 2018,
"sourceType": "module",
"project": ["tsconfig.json"],
"sourceType": "module"
},
"plugins": ["react", "react-hooks", "prettier"],
"rules": {
"react/react-in-jsx-scope": 0,
"react/function-component-definition": [2, { "namedComponents": "arrow-function" }],
"react/prefer-stateless-function": 0,
"react/jsx-filename-extension": 0,
"react/jsx-one-expression-per-line": 0,
"no-nested-ternary": 0
"no-nested-ternary": 0,
"@typescript-eslint/no-use-before-define": 0,
"react/jsx-props-no-spreading": 0,
"import/extensions": [
"error",
"ignorePackages",
{
"js": "never",
"jsx": "never",
"ts": "never",
"tsx": "never"
}
]
}
}
}
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"@types/react": "18.2.15",
"@types/react-dom": "18.2.7",
"eslint": "^8.45.0",
"eslint-config-airbnb-typescript": "^17.1.0",
"eslint-config-next": "13.4.11",
"next": "13.4.11",
"react": "18.2.0",
Expand All @@ -25,8 +24,12 @@
},
"devDependencies": {
"@types/styled-components": "^5.1.26",
"@typescript-eslint/eslint-plugin": "^5.31.0",
"eslint-config-airbnb-typescript": "^17.1.0",
"@typescript-eslint/parser": "^6.2.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^8.8.0",
"eslint-import-resolver-typescript": "^3.4.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-prettier": "^5.0.0",
Expand Down
4 changes: 2 additions & 2 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { AppProps } from 'next/app';
import { GlobalStyle } from '../styles/globalStyle';

function MyApp({ Component, pageProps }: AppProps) {
const MyApp = ({ Component, pageProps }: AppProps) => {
return (
<>
<GlobalStyle />
<Component {...pageProps} />
</>
);
}
};

export default MyApp;
17 changes: 5 additions & 12 deletions pages/_document.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
import { Fragment } from "react";
import Document, {
DocumentContext,
Head,
Html,
Main,
NextScript,
} from "next/document";
import { ServerStyleSheet } from "styled-components";
import { Fragment } from 'react';
import Document, { DocumentContext, Head, Html, Main, NextScript } from 'next/document';
import { ServerStyleSheet } from 'styled-components';

export default class MyDocument extends Document {
static async getInitialProps(ctx: DocumentContext) {
Expand All @@ -16,8 +10,7 @@ export default class MyDocument extends Document {
try {
ctx.renderPage = () =>
originalRenderPage({
enhanceApp: (App) => (props) =>
sheet.collectStyles(<App {...props} />),
enhanceApp: (App) => (props) => sheet.collectStyles(<App {...props} />),
});

const initialProps = await Document.getInitialProps(ctx);
Expand Down Expand Up @@ -46,4 +39,4 @@ export default class MyDocument extends Document {
</Html>
);
}
}
}
10 changes: 4 additions & 6 deletions pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import type { NextPage } from 'next'
import type { NextPage } from 'next';

const Home: NextPage = () => {
return (
<h1>Home Page</h1>
)
}
return <h1>Home Page</h1>;
};

export default Home
export default Home;
10 changes: 4 additions & 6 deletions pages/mypage.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import type { NextPage } from 'next'
import type { NextPage } from 'next';

const Mypage: NextPage = () => {
return (
<h1>Mypage Page</h1>
)
}
return <h1>Mypage Page</h1>;
};

export default Mypage
export default Mypage;
10 changes: 4 additions & 6 deletions pages/search.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import type { NextPage } from 'next'
import type { NextPage } from 'next';

const Search: NextPage = () => {
return (
<h1>Search Page</h1>
)
}
return <h1>Search Page</h1>;
};

export default Search
export default Search;
10 changes: 4 additions & 6 deletions pages/signin.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import type { NextPage } from 'next'
import type { NextPage } from 'next';

const Signin: NextPage = () => {
return (
<h1>Signin Page</h1>
)
}
return <h1>Signin Page</h1>;
};

export default Signin
export default Signin;
10 changes: 4 additions & 6 deletions pages/signup.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import type { NextPage } from 'next'
import type { NextPage } from 'next';

const Signup: NextPage = () => {
return (
<h1>Signup Page</h1>
)
}
return <h1>Signup Page</h1>;
};

export default Signup
export default Signup;
Loading