Skip to content

Commit

Permalink
clean up prettier/eslint vscode integration (frolic#19)
Browse files Browse the repository at this point in the history
* clean up prettier/eslint vscode integration

* add global prettier command

* use eslint rather than next lint
  • Loading branch information
frolic authored Jun 11, 2022
1 parent a6a1536 commit d49056a
Show file tree
Hide file tree
Showing 7 changed files with 352 additions and 60 deletions.
16 changes: 6 additions & 10 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp

// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"dbaeumer.vscode-eslint"
],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": [

]
// List of extensions which should be recommended for users of this workspace.
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": []
}
16 changes: 7 additions & 9 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
{
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.fixAll.eslint": true
},
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
],
// improve monorepo handling
"eslint.workingDirectories": [{"mode":"auto"}]
"eslint.workingDirectories": [
{
"mode": "auto"
}
]
}
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,18 @@
},
"scripts": {
"preinstall": "npx -y only-allow pnpm",
"dev": "pnpm -r dev --stream"
"dev": "pnpm -r dev --stream",
"prettier": "pnpm -r prettier --stream"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.27.1",
"@typescript-eslint/parser": "^5.27.1",
"eslint": "^8.17.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-simple-import-sort": "^7.0.0",
"prettier": "^2.6.2"
},
"dependencies": {
"@typescript-eslint/eslint-plugin": "^5.27.1",
"@typescript-eslint/parser": "^5.27.1",
"prettier": "^2.6.2",
"typescript": "^4.7.3"
}
}
3 changes: 1 addition & 2 deletions packages/app/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"extends": ["../../.eslintrc.json"],
"plugins": ["@next/next"]
"extends": ["next", "../../.eslintrc.json"]
}
7 changes: 4 additions & 3 deletions packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
"dev": "next dev & graphql-codegen --watch",
"build": "next build",
"start": "next start",
"lint": "next lint",
"codegen": "graphql-codegen"
"lint": "eslint .",
"codegen": "graphql-codegen",
"prettier": "prettier --write src"
},
"dependencies": {
"@ethersproject/address": "^5.5.0",
Expand All @@ -36,11 +37,11 @@
"@graphql-codegen/typescript": "^2.4.2",
"@graphql-codegen/typescript-operations": "^2.2.2",
"@graphql-codegen/typescript-urql": "^3.4.2",
"@next/eslint-plugin-next": "^12.1.0",
"@types/debug": "^4.1.7",
"@types/node": "17.0.0",
"@types/react": "17.0.37",
"autoprefixer": "^10.4.0",
"eslint-config-next": "^12.1.6",
"postcss": "^8.4.5",
"tailwindcss": "^3.0.5",
"typescript": "4.5.5"
Expand Down
3 changes: 2 additions & 1 deletion packages/subgraph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"scripts": {
"codegen": "graph codegen subgraph*.yaml",
"build": "pnpm codegen && graph build subgraph*.yaml",
"deploy:goerli": "graph deploy --node https://api.thegraph.com/deploy/ holic/example-nft subgraph-goerli.yaml"
"deploy:goerli": "graph deploy --node https://api.thegraph.com/deploy/ holic/example-nft subgraph-goerli.yaml",
"prettier": "prettier --write src"
},
"dependencies": {
"@graphprotocol/graph-cli": "0.30.4",
Expand Down
Loading

0 comments on commit d49056a

Please sign in to comment.