Skip to content

Commit

Permalink
chore: upgrade eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
slowbackspace committed Oct 22, 2024
1 parent 14dbe29 commit b9c35d5
Show file tree
Hide file tree
Showing 228 changed files with 1,217 additions and 993 deletions.
5 changes: 0 additions & 5 deletions .eslintignore

This file was deleted.

31 changes: 0 additions & 31 deletions .eslintrc.cjs

This file was deleted.

1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"**/.pnp.*": true
},
"eslint.nodePath": ".yarn/sdks",
"prettier.prettierPath": ".yarn/sdks/prettier/index.js",
"typescript.tsdk": ".yarn/sdks/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"yaml.schemas": {
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/open-npm-9.1.0-d104a17ec5-b45bcc7a67.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
70 changes: 70 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import { fixupConfigRules, fixupPluginRules } from '@eslint/compat';
import typescriptEslint from '@typescript-eslint/eslint-plugin';
import prettier from 'eslint-plugin-prettier';
import unicorn from 'eslint-plugin-unicorn';
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: [
'**/dist',
'**/node_modules',
'**/.eslintrc.js',
'**/jest.config.js',
'**/babel.config.js',
],
},
...fixupConfigRules(
compat.extends(
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:import/recommended',
'prettier',
'plugin:unicorn/recommended',
),
),
{
plugins: {
'@typescript-eslint': fixupPluginRules(typescriptEslint),
prettier,
unicorn: fixupPluginRules(unicorn),
},

languageOptions: {
parser: tsParser,
ecmaVersion: 'latest',
sourceType: 'module',
},

rules: {
'no-console': 'off',
'unicorn/no-negated-condition': 'off',
'unicorn/no-null': 'off',
'unicorn/prefer-type-error': 'off',
'no-extra-boolean-cast': 'off',
'newline-after-var': ['error', 'always'],
'arrow-parens': [2, 'as-needed'],
'prettier/prettier': 2,
eqeqeq: ['error', 'always'],
'unicorn/prevent-abbreviations': 'off',
'unicorn/prefer-node-protocol': 0,
'import/extensions': ['error', 'always'],
'import/no-unresolved': 'off',
'unicorn/no-anonymous-default-export': 'off',
'unicorn/consistent-existence-index-check': 'off',
},
},
];
21 changes: 12 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
"devDependencies": {
"@esbuild/darwin-arm64": "npm:0.19.8",
"@esbuild/linux-x64": "npm:0.19.8",
"@eslint/compat": "^1.2.1",
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.13.0",
"@rollup/rollup-darwin-arm64": "npm:4.6.1",
"@rollup/rollup-linux-x64-gnu": "npm:4.6.1",
"@types/express": "^4.17.17",
Expand All @@ -45,15 +48,15 @@
"@types/sinon": "^10.0.15",
"@types/uuid": "^9.0.1",
"@types/ws": "^8.5.4",
"@typescript-eslint/eslint-plugin": "^6.2.0",
"@typescript-eslint/parser": "^6.2.0",
"@typescript-eslint/eslint-plugin": "^8.11.0",
"@typescript-eslint/parser": "^8.11.0",
"c8": "^7.13.0",
"eslint": "^8.45.0",
"eslint-config-prettier": "8.8.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-prettier": "5.0.0",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-unicorn": "^48.0.1",
"eslint": "^9.13.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-promise": "^7.1.0",
"eslint-plugin-unicorn": "^56.0.0",
"nock": "^13.3.2",
"prettier": "^3.0.0",
"rimraf": "^5.0.1",
Expand All @@ -68,4 +71,4 @@
"type": "module",
"main": "dist/server.js",
"packageManager": "[email protected]"
}
}
1 change: 0 additions & 1 deletion src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ const heartbeat = (ws: Server.Ws) => {
ws.isAlive = true;
};

// eslint-disable-next-line @typescript-eslint/no-empty-function
function noop() {}

// ping all clients every 30s to keep connection alive
Expand Down
8 changes: 6 additions & 2 deletions src/utils/address.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,11 @@ export const addressesToUtxos = async (

for (const addressUtxos of allUtxos)
for (const utxo of addressUtxos)
for (const a of utxo.amount) a.unit !== 'lovelace' ? assets.add(a.unit) : undefined;
for (const a of utxo.amount) {
if (a.unit !== 'lovelace') {
assets.add(a.unit);
}
}

const tokenMetadata = await Promise.all(
[...assets].map(a => assetMetadataLimiter.add(() => getAssetData(a), { throwOnTimeout: true })),
Expand Down Expand Up @@ -290,7 +294,7 @@ export const getStakingData = async (stakeAddress: string): Promise<Addresses.St
return {
rewards: '0',
isActive: false,
// eslint-disable-next-line unicorn/no-null

poolId: null,
};
}
Expand Down
3 changes: 1 addition & 2 deletions src/utils/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ export const getLogger = (options: LoggerOptions): Logger => {

const getMethod = (methodLevel: Level) => {
return requestedLevel > LevelMap[methodLevel]
? // eslint-disable-next-line @typescript-eslint/no-empty-function
() => {}
? () => {}
: (...arguments_: unknown[]) => onMessage({ ...options, level: methodLevel }, ...arguments_);
};

Expand Down
Loading

0 comments on commit b9c35d5

Please sign in to comment.