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

Add eslint and prettier for the dApp #18

Merged
merged 9 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions dapp/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist
4 changes: 4 additions & 0 deletions dapp/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"root": true,
"extends": ["@thesis-co"]
}
18 changes: 0 additions & 18 deletions dapp/.eslintrc.cjs

This file was deleted.

1 change: 1 addition & 0 deletions dapp/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lts/iron
1 change: 1 addition & 0 deletions dapp/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist
3 changes: 3 additions & 0 deletions dapp/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
...require("@thesis-co/prettier-config"),
}
1 change: 1 addition & 0 deletions dapp/.tsconfig-eslint.json
19 changes: 13 additions & 6 deletions dapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,28 @@
"start": "vite",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
"preview": "vite preview",
"format": "npm run lint:js && npm run lint:config",
"format:fix": "npm run lint:js:fix && npm run lint:config:fix",
"lint:js": "eslint .",
"lint:js:fix": "eslint . --fix",
"lint:config": "prettier -c '**/*.@(json|yaml|toml)'",
"lint:config:fix": "prettier -w '**/*.@(json|yaml|toml)'"
},
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@thesis-co/eslint-config": "^0.6.1",
"@thesis/prettier-config": "github:thesis/prettier-config",
"@types/react": "^18.2.15",
"@types/react-dom": "^18.2.7",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"@typescript-eslint/eslint-plugin": "^6.10.0",
"@typescript-eslint/parser": "^6.10.0",
"@vitejs/plugin-react": "^4.0.3",
"eslint": "^8.45.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.3",
"eslint": "^8.53.0",
"prettier": "^3.1.0",
"typescript": "^5.2.2",
"vite": "^4.4.5"
}
Expand Down
6 changes: 4 additions & 2 deletions dapp/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React from "react"

function App() {
return <h1>Acre dApp</h1>;
return <h1>Acre dApp</h1>
}

export default App;
export default App
10 changes: 5 additions & 5 deletions dapp/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App.tsx";
import React from "react"
import ReactDOM from "react-dom/client"
import App from "./App"

ReactDOM.createRoot(document.getElementById("root")!).render(
<React.StrictMode>
<App />
</React.StrictMode>
);
</React.StrictMode>,
)
5 changes: 1 addition & 4 deletions dapp/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
"strict": true
},
"include": ["src"],
"references": [{ "path": "./tsconfig.node.json" }]
Expand Down
8 changes: 5 additions & 3 deletions dapp/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
// Unfortunately, the Vite React package structure does not play nice with no-extraneous-dependencies.
/* eslint-disable import/no-extraneous-dependencies */
import { defineConfig } from "vite"
import react from "@vitejs/plugin-react"

export default defineConfig({
plugins: [react()],
});
})
Loading
Loading