Skip to content

Commit

Permalink
Merge pull request #256 from cosmos/upgrade-lint
Browse files Browse the repository at this point in the history
Upgrade eslint to v9
webmaster128 authored Jan 15, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 8edea74 + 61fb0c0 commit b5fab6c
Showing 9 changed files with 1,837 additions and 1,292 deletions.
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

38 changes: 0 additions & 38 deletions .eslintrc.js

This file was deleted.

6 changes: 3 additions & 3 deletions components/forms/CreateTxForm/Fields/FieldCommission.tsx
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ export const getFieldCommissionSchema = (fieldName: string) =>
.transform((value) => {
try {
return String(value);
} catch (error) {
} catch {
return value;
}
}),
@@ -28,7 +28,7 @@ export const getFieldCommissionSchema = (fieldName: string) =>
.transform((value) => {
try {
return String(value);
} catch (error) {
} catch {
return value;
}
}),
@@ -38,7 +38,7 @@ export const getFieldCommissionSchema = (fieldName: string) =>
.transform((value) => {
try {
return String(value);
} catch (error) {
} catch {
return value;
}
}),
4 changes: 2 additions & 2 deletions components/forms/CreateTxForm/Fields/FieldNumber.tsx
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ export const getFieldNumberSchema = (fieldName: string) => {
.transform((value) => {
try {
return BigInt(value);
} catch (error) {
} catch {
return value;
}
})
@@ -38,7 +38,7 @@ export const getFieldNumberSchema = (fieldName: string) => {
.transform((value) => {
try {
return String(value);
} catch (error) {
} catch {
return value;
}
});
4 changes: 2 additions & 2 deletions components/forms/CreateTxForm/Fields/FieldTimeoutHeight.tsx
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ export const getFieldTimeoutHeightSchema = (fieldName: string) =>
.transform((value) => {
try {
return BigInt(value);
} catch (error) {
} catch {
return value;
}
})
@@ -31,7 +31,7 @@ export const getFieldTimeoutHeightSchema = (fieldName: string) =>
.transform((value) => {
try {
return BigInt(value);
} catch (error) {
} catch {
return value;
}
})
91 changes: 91 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import globals from "globals";
import tsParser from "@typescript-eslint/parser";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});

export default [
{
ignores: ["components/ui/"],
},
...compat.extends("next/core-web-vitals", "plugin:@typescript-eslint/recommended", "prettier"),
{
plugins: {
"@typescript-eslint": typescriptEslint,
},

languageOptions: {
globals: {
...globals.browser,
process: "readonly",
},

parser: tsParser,
ecmaVersion: 2020,
sourceType: "module",

parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},

rules: {
curly: ["warn", "multi-line", "consistent"],
"no-bitwise": "warn",
"no-console": "off",
"no-param-reassign": "warn",
"no-shadow": "warn",
"no-unused-vars": "off",
"prefer-const": "warn",
radix: ["warn", "always"],

"spaced-comment": [
"warn",
"always",
{
line: {
markers: ["/ <reference"],
},
},
],

"react/no-unescaped-entities": [
"warn",
{
forbid: [">", "}"],
},
],

"react/prop-types": "off",
"@typescript-eslint/no-empty-function": "off",

"@typescript-eslint/no-unused-vars": [
"warn",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
},
],
},
},
// Be less docmatic for config files
{
files: ["**/*.config.{mjs,js}"],
rules: {
"@typescript-eslint/no-require-imports": "off",
"import/no-anonymous-default-export": "off",
},
},
];
2,966 changes: 1,730 additions & 1,236 deletions package-lock.json

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -8,8 +8,8 @@
"build": "next build",
"start": "next start",
"format": "prettier --write --log-level warn \"./**/*.{js,jsx,mjs,ts,tsx}\"",
"lint": "eslint --max-warnings 0 \"./**/*.{js,jsx,ts,tsx}\"",
"lint:fix": "eslint --max-warnings 0 \"./**/*.{js,jsx,ts,tsx}\" --fix"
"lint": "eslint --max-warnings 0 \"./**/*.{js,jsx,mjs,ts,tsx}\"",
"lint:fix": "eslint --max-warnings 0 \"./**/*.{js,jsx,mjs,ts,tsx}\" --fix"
},
"dependencies": {
"@cosmjs/amino": "^0.32.4",
@@ -57,24 +57,24 @@
"@types/node": "20.14.9",
"@types/react": "18.3.3",
"@types/react-dom": "18.3.0",
"@typescript-eslint/eslint-plugin": "^6.6.0",
"@typescript-eslint/parser": "^6.6.0",
"@typescript-eslint/eslint-plugin": "^8.20.0",
"@typescript-eslint/parser": "^8.20.0",
"autoprefixer": "10.4.19",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"cmdk": "^1.0.0",
"copy-to-clipboard": "^3.3.3",
"cosmjs-types": "^0.9.0",
"date-fns": "^3.6.0",
"eslint": "^8.56.0",
"eslint-config-next": "14.2.4",
"eslint-config-prettier": "^9.1.0",
"eslint": "^9.18.0",
"eslint-config-next": "^15.1.4",
"eslint-config-prettier": "^10.0.1",
"graphql": "^16.9.0",
"graphql-request": "^7.1.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"lucide-react": "^0.397.0",
"next": "14.2.4",
"next": "^14.2.23",
"next-themes": "^0.3.0",
"postcss": "8.4.38",
"prettier": "^3.4.2",
2 changes: 1 addition & 1 deletion types/window.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Window as KeplrWindow } from "@keplr-wallet/types";

declare global {
// eslint-disable-next-line @typescript-eslint/no-empty-interface
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
interface Window extends KeplrWindow {}
}

0 comments on commit b5fab6c

Please sign in to comment.