Skip to content

Commit

Permalink
style(dx): centralize code style tools
Browse files Browse the repository at this point in the history
refs #223
  • Loading branch information
ygrishajev committed Jun 7, 2024
1 parent 371acf2 commit e69d8cd
Show file tree
Hide file tree
Showing 38 changed files with 518 additions and 822 deletions.
24 changes: 24 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const path = require("path");
const baseConfig = require("@akashnetwork/dev-config/.eslintrc.base");
const tsConfig = require("@akashnetwork/dev-config/.eslintrc.ts");
const nextConfig = require("@akashnetwork/dev-config/.eslintrc.next");

module.exports = {
...baseConfig,
settings: {
next: {
rootDir: "apps/*"
}
},
overrides: [
...baseConfig.overrides,
...tsConfig.overrides,
...nextConfig.overrides.map(override => ({
...override,
files: ["apps/*-web/**/*.{ts,tsx}", "apps/landing/**/*.{ts,tsx}"],
rules: {
"@next/next/no-html-link-for-pages": ["error", ["deploy-web", "landing"].map(app => path.resolve(__dirname, `apps/${app}/src/pages`))]
}
}))
]
};
19 changes: 19 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const config = require("@akashnetwork/dev-config/.prettierrc");

module.exports = {
...config,
overrides: [
{
files: "./apps/deploy-web/**",
options: {
tailwindConfig: "./apps/deploy-web/tailwind.config.ts"
}
},
{
files: "./apps/stats-web/**",
options: {
tailwindConfig: "./apps/stats-web/tailwind.config.ts"
}
}
]
};
1 change: 1 addition & 0 deletions apps/api/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@akashnetwork/dev-config/.eslintrc.ts');
17 changes: 0 additions & 17 deletions apps/api/.eslintrc.json

This file was deleted.

16 changes: 0 additions & 16 deletions apps/api/.prettierrc

This file was deleted.

1 change: 1 addition & 0 deletions apps/api/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("@akashnetwork/dev-config/.prettierrc");
6 changes: 2 additions & 4 deletions apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"start": "webpack --config webpack.dev.js --watch",
"build": "webpack --config webpack.prod.js",
"lint": "eslint .",
"format": "prettier --write ./*.{js,json} **/*.{ts,js,json}",
"test": "jest --selectProjects unit functional",
"test:watch": "jest --selectProjects unit functional --watch",
"test:cov": "jest --selectProjects unit functional --coverage",
Expand Down Expand Up @@ -63,6 +64,7 @@
"zod": "^3.22.4"
},
"devDependencies": {
"@akashnetwork/dev-config": "*",
"@faker-js/faker": "^8.4.1",
"@types/jest": "^29.5.12",
"@types/lodash": "^4.17.0",
Expand All @@ -72,15 +74,11 @@
"@types/pg": "^8.6.5",
"@types/semver": "^7.5.2",
"@types/uuid": "^8.3.1",
"@typescript-eslint/eslint-plugin": "^6.19.0",
"@typescript-eslint/parser": "^6.19.0",
"alias-hq": "^5.1.6",
"eslint": "^8.56.0",
"jest": "^29.7.0",
"nock": "^13.5.4",
"nodemon": "^2.0.7",
"nodemon-webpack-plugin": "^4.8.2",
"prettier": "^3.2.5",
"supertest": "^6.1.5",
"ts-jest": "^29.1.2",
"ts-loader": "^9.2.5",
Expand Down
1 change: 1 addition & 0 deletions apps/deploy-web/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@akashnetwork/dev-config/.eslintrc.next');
9 changes: 0 additions & 9 deletions apps/deploy-web/.eslintrc.json

This file was deleted.

17 changes: 0 additions & 17 deletions apps/deploy-web/.prettierrc

This file was deleted.

1 change: 1 addition & 0 deletions apps/deploy-web/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("@akashnetwork/dev-config/.prettierrc");
3 changes: 3 additions & 0 deletions apps/deploy-web/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ const moduleExports = {
typescript: {
tsconfigPath: "./tsconfig.json"
},
eslint: {
ignoreDuringBuilds: true
},
transpilePackages: ["geist"],
// experimental: {
// // outputStandalone: true,
Expand Down
8 changes: 3 additions & 5 deletions apps/deploy-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
"license": "Apache-2.0",
"author": "Akash Network",
"scripts": {
"lint": "eslint .",
"format": "prettier --write ./*.{ts,js,json} **/*.{ts,tsx,js,json}",
"build": "next build",
"build-analyze": "set ANALYZE=true&& next build",
"dev": "next -p 3000",
"pretty": "prettier --write \"./**/*.{js,jsx,ts,tsx,json}\"",
"start": "next start",
"type-check": "tsc"
},
Expand Down Expand Up @@ -73,7 +74,6 @@
"cmdk": "^0.2.0",
"cosmjs-types": "^0.6.1",
"date-fns": "^2.29.3",
"eslint-config-next": "^13.4.18",
"file-saver": "^2.0.5",
"geist": "^1.3.0",
"http-proxy": "^1.18.1",
Expand Down Expand Up @@ -127,6 +127,7 @@
"zod": "^3.22.4"
},
"devDependencies": {
"@akashnetwork/dev-config": "*",
"@keplr-wallet/types": "^0.10.15",
"@next/bundle-analyzer": "^14.0.1",
"@tailwindcss/typography": "^0.5.12",
Expand All @@ -140,13 +141,10 @@
"@types/react": "18.2.12",
"@types/react-dom": "18.2.5",
"@types/react-simple-maps": "^3.0.0",
"@typescript-eslint/parser": "^7.8.0",
"autoprefixer": "^10.4.16",
"patch-package": "^8.0.0",
"postcss": "^8.4.31",
"postcss-nesting": "^12.0.2",
"prettier": "^3.1.0",
"prettier-plugin-tailwindcss": "^0.5.7",
"tailwindcss": "^3.4.3",
"typescript": "5.1.3"
},
Expand Down
1 change: 1 addition & 0 deletions apps/indexer/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@akashnetwork/dev-config/.eslintrc.ts');
16 changes: 0 additions & 16 deletions apps/indexer/.prettierrc

This file was deleted.

1 change: 1 addition & 0 deletions apps/indexer/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("@akashnetwork/dev-config/.prettierrc");
9 changes: 4 additions & 5 deletions apps/indexer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
"author": "Cloudmos",
"main": "server.js",
"scripts": {
"lint": "eslint .",
"format": "prettier --write ./*.{js,json} **/*.{ts,js,json}",
"build": "webpack --config webpack.prod.js",
"start": "webpack --mode development --config webpack.dev.js --watch",
"test": "jest"
Expand Down Expand Up @@ -50,6 +52,7 @@
"uuid": "^9.0.1"
},
"devDependencies": {
"@akashnetwork/dev-config": "*",
"@types/async": "^3.2.15",
"@types/express": "^4.17.13",
"@types/lodash": "^4.17.1",
Expand All @@ -60,13 +63,9 @@
"@types/semver": "^7.5.6",
"@types/uuid": "^8.3.1",
"@types/validator": "^13.7.8",
"@typescript-eslint/eslint-plugin": "^7.2.0",
"alias-hq": "^5.1.6",
"eslint": "^8.57.0",
"eslint-plugin-simple-import-sort": "^12.0.0",
"nodemon": "^2.0.7",
"nodemon-webpack-plugin": "^4.8.2",
"prettier": "^3.2.5",
"nodemon-webpack-plugin": "^4.5.2",
"supertest": "^6.1.5",
"ts-jest": "^27.0.4",
"ts-loader": "^9.5.1",
Expand Down
1 change: 1 addition & 0 deletions apps/landing/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@akashnetwork/dev-config/.eslintrc.next');
16 changes: 0 additions & 16 deletions apps/landing/.prettierrc

This file was deleted.

1 change: 1 addition & 0 deletions apps/landing/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("@akashnetwork/dev-config/.prettierrc");
3 changes: 3 additions & 0 deletions apps/landing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"private": true,
"license": "Apache-2.0",
"scripts": {
"lint": "eslint .",
"format": "prettier --write ./*.{ts,js,json} **/*.{ts,tsx,js,json}",
"dev": "next -p 3001",
"build": "next build",
"start": "next start",
Expand Down Expand Up @@ -38,6 +40,7 @@
"tss-react": "^4.8.5"
},
"devDependencies": {
"@akashnetwork/dev-config": "*",
"@types/node": "^12.12.21",
"@types/nprogress": "^0.2.0",
"@types/react": "18.2.12",
Expand Down
1 change: 1 addition & 0 deletions apps/provider-proxy/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("@akashnetwork/dev-config/.eslintrc.ts");
1 change: 1 addition & 0 deletions apps/provider-proxy/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("@akashnetwork/dev-config/.prettierrc");
3 changes: 3 additions & 0 deletions apps/provider-proxy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"license": "Apache-2.0",
"main": "main.js",
"scripts": {
"lint": "eslint .",
"format": "prettier --write ./*.{ts,js,json} **/*.{ts,js,json}",
"start": "npx tsc && node ./build/main.js",
"build": "npx tsc"
},
Expand All @@ -18,6 +20,7 @@
"ws": "^7.5.9"
},
"devDependencies": {
"@akashnetwork/dev-config": "*",
"@types/cors": "^2.8.13",
"@types/express": "^4.17.16",
"@types/node-fetch": "^2.6.2",
Expand Down
1 change: 1 addition & 0 deletions apps/stats-web/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("@akashnetwork/dev-config/.eslintrc.next");
17 changes: 0 additions & 17 deletions apps/stats-web/.prettierrc

This file was deleted.

1 change: 1 addition & 0 deletions apps/stats-web/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("@akashnetwork/dev-config/.prettierrc");
3 changes: 3 additions & 0 deletions apps/stats-web/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ const nextConfig = {
output: "standalone",
publicRuntimeConfig: {
version
},
eslint: {
ignoreDuringBuilds: true
}
};

Expand Down
7 changes: 2 additions & 5 deletions apps/stats-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
"lint": "eslint .",
"format": "prettier --write ./*.{ts,js,json} **/*.{ts,tsx,js,json}"
},
"dependencies": {
"@cosmjs/encoding": "^0.32.0",
Expand Down Expand Up @@ -58,12 +59,8 @@
"@types/json2csv": "^5.0.7",
"@types/node": "^20",
"autoprefixer": "^10.4.16",
"eslint": "^8",
"eslint-config-next": "14.0.2",
"postcss": "^8.4.31",
"postcss-nesting": "^12.0.1",
"prettier": "^3.1.0",
"prettier-plugin-tailwindcss": "^0.5.7",
"tailwindcss": "^3.3.5",
"@types/react": "18.2.12",
"@types/react-dom": "18.2.5",
Expand Down
Loading

0 comments on commit e69d8cd

Please sign in to comment.