Skip to content

Commit f1e56f8

Browse files
authored
Merge pull request #3 from JaeYeopHan/fix/eslint-rules
Fix/eslint rules
2 parents dc1a3e1 + b6ede2b commit f1e56f8

File tree

8 files changed

+38
-44
lines changed

8 files changed

+38
-44
lines changed

template/.eslintrc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
"rules": {
55
"react-hooks/rules-of-hooks": "error",
66
"simple-import-sort/sort": "error",
7-
"no-multiple-empty-lines": "error"
7+
"no-multiple-empty-lines": "error",
8+
"comma-dangle": ["error", "always-multiline"],
9+
"eol-last": ["error", "always"],
10+
"semi": ["error", "never"],
11+
"quotes": ["error", "double"]
812
}
913
}

template/.vscode/settings.json

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,9 @@
55
"eslint.options": {
66
"extensions": [".html", ".ts", ".js", ".tsx"]
77
},
8-
"eslint.validate": [
9-
"javascript",
10-
"javascriptreact",
11-
{
12-
"language": "typescript",
13-
"autoFix": true
14-
},
15-
{
16-
"language": "typescriptreact",
17-
"autoFix": true
18-
}
19-
],
20-
"eslint.autoFixOnSave": true,
218
"eslint.packageManager": "yarn",
22-
"typescript.tsdk": "node_modules/typescript/lib"
23-
}
9+
"typescript.tsdk": "node_modules/typescript/lib",
10+
"editor.codeActionsOnSave": {
11+
"source.fixAll.eslint": true
12+
}
13+
}

template/src/components/App.test.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import React from "react";
2-
import { render } from "@testing-library/react";
3-
import App from "./App";
1+
import React from 'react'
2+
import { render } from '@testing-library/react'
3+
import App from './App'
44

5-
test("renders learn react link", () => {
6-
const { getByText } = render(<App />);
7-
const linkElement = getByText(/learn react/i);
8-
expect(linkElement).toBeInTheDocument();
9-
});
5+
test('renders learn react link', () => {
6+
const { getByText } = render(<App />)
7+
const linkElement = getByText(/learn react/i)
8+
expect(linkElement).toBeInTheDocument()
9+
})

template/src/components/App.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from "react";
1+
import React from 'react'
22

33
export default () => {
44
return (
@@ -11,5 +11,5 @@ export default () => {
1111
cra-template-unicorn
1212
</a>
1313
</h1>
14-
);
15-
};
14+
)
15+
}

template/src/features/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { combineReducers } from "@reduxjs/toolkit";
2-
import { configureStore } from "@reduxjs/toolkit";
1+
import { combineReducers } from '@reduxjs/toolkit'
2+
import { configureStore } from '@reduxjs/toolkit'
33

4-
const rootReducer = combineReducers({});
4+
const rootReducer = combineReducers({})
55

6-
const store = configureStore({ reducer: rootReducer });
6+
const store = configureStore({ reducer: rootReducer })
77

8-
export type RootState = ReturnType<typeof rootReducer>;
9-
export default store;
8+
export type RootState = ReturnType<typeof rootReducer>
9+
export default store

template/src/index.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import React from "react";
2-
import ReactDOM from "react-dom";
3-
import { Provider } from "react-redux";
4-
import { Router } from "react-router-dom";
1+
import React from 'react'
2+
import ReactDOM from 'react-dom'
3+
import { Provider } from 'react-redux'
4+
import { Router } from 'react-router-dom'
55

6-
import App from "@/components/App";
7-
import store from "@/features";
8-
import history from "@/utils/history";
6+
import App from '@/components/App'
7+
import store from '@/features'
8+
import history from '@/utils/history'
99

1010
ReactDOM.render(
1111
<Provider store={store}>
@@ -14,4 +14,4 @@ ReactDOM.render(
1414
</Router>
1515
</Provider>,
1616
document.getElementById("root")
17-
);
17+
)

template/src/setupTests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
// allows you to do things like:
33
// expect(element).toHaveTextContent(/react/i)
44
// learn more: https://github.com/testing-library/jest-dom
5-
import '@testing-library/jest-dom/extend-expect';
5+
import '@testing-library/jest-dom/extend-expect'

template/src/utils/history.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import { createBrowserHistory } from "history";
1+
import { createBrowserHistory } from 'history'
22

3-
export default createBrowserHistory();
3+
export default createBrowserHistory()

0 commit comments

Comments
 (0)