Skip to content

Commit

Permalink
Merge pull request #3 from unionlabs/cleanup-fix
Browse files Browse the repository at this point in the history
fix: remove unused deps and actually run the linter and formatter
  • Loading branch information
PoisonPhang authored Aug 28, 2024
2 parents f8e8a12 + e4fb67b commit fe04665
Show file tree
Hide file tree
Showing 16 changed files with 244 additions and 782 deletions.
2 changes: 2 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
use flake
export DIRENV_WARN_TIMEOUT=1m
5 changes: 0 additions & 5 deletions .github/FUNDING.yml

This file was deleted.

21 changes: 0 additions & 21 deletions .github/workflows/config-check.yaml

This file was deleted.

51 changes: 0 additions & 51 deletions .github/workflows/docker.yaml

This file was deleted.

28 changes: 0 additions & 28 deletions .github/workflows/mainnet-deploy.yaml.disabled

This file was deleted.

27 changes: 0 additions & 27 deletions .github/workflows/testnet-deploy.yaml

This file was deleted.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ dist
._*
_
result
.direnv
.eslintcache
.prettiercache
83 changes: 71 additions & 12 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,14 +1,73 @@
import globals from "globals";
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";
import pluginVue from "eslint-plugin-vue";
import globals from 'globals';
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import eslintPluginVue from 'eslint-plugin-vue';
import eslintPrettierConfig from 'eslint-config-prettier';
import eslintPluginPrettier from 'eslint-plugin-prettier/recommended';


export default [
{files: ["**/*.{js,mjs,cjs,ts,vue}"]},
{languageOptions: { globals: globals.browser }},
pluginJs.configs.recommended,
export default tseslint.config(
{ files: ['**/*.{js,mjs,cjs,ts,vue,html}'] },
eslint.configs.recommended,
...tseslint.configs.recommended,
...pluginVue.configs["flat/essential"],
{files: ["**/*.vue"], languageOptions: {parserOptions: {parser: tseslint.parser}}},
];
...eslintPluginVue.configs['flat/recommended'],
{ languageOptions: { globals: globals.browser } },
{
files: ['**/*.vue', '*.vue'],
languageOptions: {
parserOptions: {
projectService: true,
extraFileExtensions: ['.vue'],
tsconfigRootDir: import.meta.dirname,
},
},
},
{
languageOptions: {
parserOptions: {
sourceType: 'module',
ecmaVersion: 'latest',
parser: tseslint.parser,
ecmaFeatures: { jsx: true },
},
},
},
{
rules: {
'prettier/prettier': [
'error',
{},
{ usePrettierrc: true, fileInfoOptions: { withNodeModules: true } },
],
/**
* the following rules are all temporarily disabled
*/
'no-empty': ['off'],
'no-debugger': ['off'],
'no-unsafe-optional-chaining': ['off'],

'@typescript-eslint/ban-ts-comment': ['off'],
'@typescript-eslint/no-unused-vars': ['off'],
'@typescript-eslint/no-explicit-any': ['off'],
'@typescript-eslint/no-empty-object-type': ['off'],
'@typescript-eslint/no-unused-expressions': ['off'],
'@typescript-eslint/no-unsafe-function-type': ['off'],

'vue/valid-v-for': ['off'],
'vue/valid-v-else': ['off'],
'vue/no-dupe-keys': ['off'],
'vue/no-unused-vars': ['off'],
'vue/no-explicit-any': ['off'],
'vue/no-parsing-error': ['off'],
'vue/require-v-for-key': ['off'],
'vue/require-prop-types': ['off'],
'vue/no-use-v-if-with-v-for': ['off'],
'vue/no-empty-component-block': ['off'],
'vue/multi-word-component-names': ['off'],
'vue/return-in-computed-property': ['off'],
'vue/no-unsafe-optional-chaining': ['off'],
'vue/no-async-in-computed-properties': ['off'],
},
},
eslintPrettierConfig,
eslintPluginPrettier,
);
7 changes: 3 additions & 4 deletions explorer.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@
src = ./.;

nativeBuildInputs = with pkgs; [
fixup-yarn-lock
nodejs
tree
nodePackages.npm
nodePackages.yarn
fixup-yarn-lock
nodePackages_latest.yarn
nodePackages_latest.nodejs
];

configurePhase = ''
Expand Down
12 changes: 10 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,27 @@

outputs = inputs@{ self, nixpkgs, flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "x86_64-linux" ];
systems = [ "x86_64-linux" "aarch64-linux" ];
imports = [
./explorer.nix
];
perSystem = { config, self', inputs', system, pkgs, lib, ... }: {

_module.args = {
inherit nixpkgs;

pkgs = import nixpkgs {
inherit system;
};
};

devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
tree
direnv
nodePackages_latest.yarn
nodePackages_latest.nodejs
];
};
};
};
nixConfig = {
Expand Down
23 changes: 15 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@
"name": "ping.pub",
"version": "3.0.0",
"private": true,
"target": "",
"type": "module",
"scripts": {
"dev": "vite",
"serve": "vite",
"serve-dist":"npm_config_yes=true npx serve@latest ./dist/",
"serve-dist": "npm_config_yes=true npx serve@latest ./dist/",
"preview": "vite preview",
"prebuild": "yarn typecheck",
"build": "vite build",
"typecheck": "vue-tsc --noEmit",
"lint": "eslint --fix . --ext .js,.cjs,.mjs,.ts,.vue,.html --cache",
"format": "prettier --config .prettierrc.json . --ignore-path .eslintignore --write --ignore-unknown"
"lint": "eslint --fix src --config eslint.config.mjs --cache",
"lint:check": "eslint src --config eslint.config.mjs --cache",
"format": "prettier --config prettier.config.mjs . --ignore-path .gitignore --write --ignore-unknown"
},
"dependencies": {
"@chenfengyuan/vue-countdown": "2",
Expand All @@ -39,8 +40,6 @@
"cross-fetch": "^4.0.0",
"daisyui": "^4.12.10",
"dayjs": "^1.11.13",
"eslint": "^9.9.1",
"eslint-plugin-vue": "^9.27.0",
"lazy-load-vue3": "^2.0.1",
"long": "^5.2.3",
"md-editor-v3": "^4.19.1",
Expand All @@ -63,27 +62,35 @@
"devDependencies": {
"@eslint/js": "^9.9.1",
"@osmonauts/telescope": "^1.0.2",
"@types/eslint": "^9.6.1",
"@types/eslint-config-prettier": "^6.11.3",
"@types/eslint__js": "^8.42.3",
"@types/marked": "^6.0.0",
"@types/node": "^22.5.0",
"@types/numeral": "^2.0.5",
"@types/postcss-import": "^14.0.3",
"@types/semver": "7.5.8",
"@vitejs/plugin-vue": "^5.1.2",
"@vue/tsconfig": "^0.5.1",
"eslint": "^9.9.1",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-prettier-vue": "^5.0.0",
"eslint-plugin-vue": "^9.27.0",
"globals": "^15.9.0",
"npm-run-all": "^4.1.5",
"postcss-import": "^16.1.0",
"postcss-load-config": "^6.0.1",
"prettier": "^3.3.3",
"sass": "^1.77.8",
"shiki": "^1.14.1",
"typescript": "~5.5.4",
"typescript": "^5.5.4",
"typescript-eslint": "^8.3.0",
"unplugin-auto-import": "^0.18.2",
"unplugin-vue-components": "^0.27.4",
"unplugin-vue-define-options": "1.4.9",
"vite": "5.4.2",
"vite-plugin-pages": "^0.32.3",
"vite-tsconfig-paths": "^5.0.1",
"vue-json-viewer": "3",
"vue-tsc": "^2.0.29"
}
Expand Down
4 changes: 3 additions & 1 deletion .prettierrc.json → prettier.config.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
/** @type {import('prettier').Options} */
export default {
"tabWidth": 2,
useTabs: false,
"singleQuote": true,
"semi": true,
"endOfLine": "auto",
Expand Down
5 changes: 2 additions & 3 deletions src/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ import {
useDashboard,
LoadingStatus,
type ChainConfig,
} from '@/stores/useDashboard';
} from '@/stores/useDashboard.ts';
import ChainSummary from '@/components/ChainSummary.vue';
import AdBanner from '@/components/ad/AdBanner.vue';
import { computed, onMounted, ref } from 'vue';
import { useBlockchain } from '@/stores';
import { useBlockchain } from '@/stores/useBlockchain.ts';
const dashboard = useDashboard();
Expand Down
Loading

0 comments on commit fe04665

Please sign in to comment.