Skip to content

Commit 0c9468f

Browse files
committed
added prettier & eslint
1 parent dccce79 commit 0c9468f

5 files changed

Lines changed: 66 additions & 17 deletions

File tree

.prettierrc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"printWidth": 80,
3+
"tabWidth": 2,
4+
"useTabs": false,
5+
"semi": true,
6+
"singleQuote": true,
7+
"trailingComma": "es5",
8+
"bracketSpacing": true,
9+
"jsxBracketSameLine": false,
10+
"arrowParens": "always"
11+
}

eslint.config.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
import js from '@eslint/js'
2-
import globals from 'globals'
3-
import reactHooks from 'eslint-plugin-react-hooks'
4-
import reactRefresh from 'eslint-plugin-react-refresh'
5-
import tseslint from 'typescript-eslint'
1+
import prettier from 'eslint-config-prettier';
2+
import js from '@eslint/js';
3+
import globals from 'globals';
4+
import reactHooks from 'eslint-plugin-react-hooks';
5+
import reactRefresh from 'eslint-plugin-react-refresh';
6+
import tseslint from 'typescript-eslint';
67

78
export default tseslint.config(
8-
{ ignores: ['dist'] },
9+
{ ignores: ['dist', 'coverage', 'sonar-project.js'] },
910
{
1011
extends: [js.configs.recommended, ...tseslint.configs.recommended],
11-
files: ['**/*.{ts,tsx}'],
12+
files: ['**/*.{ts,tsx,js}'],
1213
languageOptions: {
1314
ecmaVersion: 2020,
1415
globals: globals.browser,
@@ -25,4 +26,5 @@ export default tseslint.config(
2526
],
2627
},
2728
},
28-
)
29+
prettier
30+
);

package-lock.json

Lines changed: 34 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"type": "module",
66
"scripts": {
77
"dev": "vite",
8-
"build": "tsc -b && vite build",
8+
"build": "npm run lint && tsc -b && vite build",
99
"lint": "eslint .",
1010
"preview": "vite preview",
1111
"test": "vitest run --coverage"
@@ -23,10 +23,12 @@
2323
"@vitejs/plugin-react": "^5.1.2",
2424
"@vitest/coverage-v8": "^4.0.15",
2525
"eslint": "^9.39.2",
26+
"eslint-config-prettier": "^10.1.8",
2627
"eslint-plugin-react-hooks": "^7.0.1",
2728
"eslint-plugin-react-refresh": "^0.4.25",
2829
"globals": "^16.5.0",
2930
"jsdom": "^27.3.0",
31+
"prettier": "3.7.4",
3032
"sonarqube-scanner": "^4.3.2",
3133
"typescript": "~5.9.3",
3234
"typescript-eslint": "^8.50.0",

src/App.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import { useState } from 'react'
2-
import './App.css'
1+
import { useState } from 'react';
2+
import './App.css';
33

44
function App() {
5-
const [count, setCount] = useState(0)
5+
const [count, setCount] = useState(0);
66

77
return (
88
<div className="card">
9-
<button onClick={() => setCount((count) => count + 1)}>
10-
count is {count}
11-
</button>
9+
<button onClick={() => setCount((count) => count + 1)}>
10+
count is {count}
11+
</button>
1212
</div>
13-
)
13+
);
1414
}
1515

16-
export default App
16+
export default App;

0 commit comments

Comments
 (0)