Skip to content

Commit

Permalink
chore: eslint update (#55)
Browse files Browse the repository at this point in the history
* chore: progress on upgrading eslint

* chore: update deprecated rimraf dep

* chore: misc lint fixes

* chore: setup stylistic

* chore: restore prettier
  • Loading branch information
zone117x authored Nov 11, 2024
1 parent 24219b8 commit 6556fc5
Show file tree
Hide file tree
Showing 34 changed files with 1,223 additions and 1,739 deletions.
39 changes: 0 additions & 39 deletions .eslintrc.js

This file was deleted.

73 changes: 73 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
// @ts-check
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-argument */

import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';

export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.strictTypeChecked,
eslintPluginPrettierRecommended,
{
languageOptions: {
parserOptions: {
projectService: { allowDefaultProject: ['eslint.config.mjs', 'jest.config.ts'] },
tsconfigRootDir: import.meta.dirname,
},
},
},
{
ignores: ['dist/**', 'coverage/**', 'testing/**', 'chunk-parser/**'],
},
{
rules: {
'prettier/prettier': [
'error',
{
printWidth: 100,
trailingComma: 'es5',
tabWidth: 2,
useTabs: false,
semi: true,
singleQuote: true,
arrowParens: 'avoid',
},
],
'@typescript-eslint/non-nullable-type-assertion-style': 'off',
'@typescript-eslint/no-dynamic-delete': 'off',
'@typescript-eslint/no-useless-constructor': 'off',
'@typescript-eslint/no-unnecessary-condition': 'off',
'@typescript-eslint/consistent-type-definitions': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/no-confusing-void-expression': [
'error',
{ ignoreArrowShorthand: true, ignoreVoidOperator: true },
],
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{
args: 'all',
argsIgnorePattern: '^_',
caughtErrors: 'all',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
varsIgnorePattern: '^_',
ignoreRestSiblings: true,
},
],
},
},
{
files: ['tests/**/*.ts'],
rules: {
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-confusing-void-expression': 'off',
'@typescript-eslint/use-unknown-in-catch-callback-variable': 'off',
},
}
);
7 changes: 2 additions & 5 deletions jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ const transform = { ...createDefaultPreset().transform };
const jestConfig: JestConfigWithTsJest = {
testEnvironment: 'node',
coverageProvider: 'v8',
collectCoverageFrom: [
'src/**/*.ts',
'migrations/*.ts',
],
collectCoverageFrom: ['src/**/*.ts', 'migrations/*.ts'],
projects: [
{
transform,
Expand All @@ -22,7 +19,7 @@ const jestConfig: JestConfigWithTsJest = {
globalTeardown: './tests/db/jest-global-teardown.ts',
setupFilesAfterEnv: ['./tests/db/jest-setup.ts'],
},
]
],
};

export default jestConfig;
1 change: 0 additions & 1 deletion migrations/1729684505751_chain_tip.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/naming-convention */
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate';

export const shorthands: ColumnDefinitions | undefined = undefined;
Expand Down
1 change: 0 additions & 1 deletion migrations/1729684505752_blocks.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/naming-convention */
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate';

export const shorthands: ColumnDefinitions | undefined = undefined;
Expand Down
1 change: 0 additions & 1 deletion migrations/1729684505753_block_signer_signatures.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/naming-convention */
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate';

export const shorthands: ColumnDefinitions | undefined = undefined;
Expand Down
1 change: 0 additions & 1 deletion migrations/1729684505754_reward_set_signers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/naming-convention */
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate';

export const shorthands: ColumnDefinitions | undefined = undefined;
Expand Down
1 change: 0 additions & 1 deletion migrations/1729684505755_block_proposals.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/naming-convention */
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate';

export const shorthands: ColumnDefinitions | undefined = undefined;
Expand Down
1 change: 0 additions & 1 deletion migrations/1729684505756_block_responses.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/naming-convention */
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate';

export const shorthands: ColumnDefinitions | undefined = undefined;
Expand Down
1 change: 0 additions & 1 deletion migrations/1729684505757_chain_tip_pox_info.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/naming-convention */
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate';

export const shorthands: ColumnDefinitions | undefined = undefined;
Expand Down
1 change: 0 additions & 1 deletion migrations/1729684505758_mock_proposals.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/naming-convention */
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate';

export const shorthands: ColumnDefinitions | undefined = undefined;
Expand Down
1 change: 0 additions & 1 deletion migrations/1729684505759_mock_signature.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/naming-convention */
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate';

export const shorthands: ColumnDefinitions | undefined = undefined;
Expand Down
1 change: 0 additions & 1 deletion migrations/1729684505760_mock_blocks.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/naming-convention */
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate';

export const shorthands: ColumnDefinitions | undefined = undefined;
Expand Down
1 change: 0 additions & 1 deletion migrations/1731067485167_reward_set_signers-slot-index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/naming-convention */
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate';

export const shorthands: ColumnDefinitions | undefined = undefined;
Expand Down
Loading

0 comments on commit 6556fc5

Please sign in to comment.