Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .eslintignore

This file was deleted.

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

This file was deleted.

55 changes: 55 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
const js = require('@eslint/js')
const { FlatCompat } = require('@eslint/eslintrc')

const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
})

module.exports = [
{
ignores: ['node_modules', 'dist', '.test-reports', '.coverage', '.nostr', 'tslint.json'],
},
...compat.config({
parser: '@typescript-eslint/parser',
parserOptions: {
sourceType: 'module',
},
plugins: ['@typescript-eslint'],
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
env: {
node: true,
},
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': ['error', {
argsIgnorePattern: '^_',
caughtErrors: 'none',
}],
'@typescript-eslint/no-unused-expressions': 'off',
semi: ['error', 'never'],
quotes: ['error', 'single', { avoidEscape: true }],
'sort-imports': ['error', {
ignoreCase: true,
allowSeparatedGroups: true,
}],
curly: [2, 'multi-line'],
'max-len': [
'error',
{
code: 120,
ignoreStrings: true,
ignoreTemplateLiterals: true,
ignoreRegExpLiterals: true,
},
],
'comma-dangle': ['error', {
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
functions: 'ignore',
}],
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Mahmoud-s-Khedr Can we ensure there's a 1:1 between previous and new?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reverted to the legacy ESLint setup (.eslintrc.js and .eslintignore) and ran it with ESLINT_USE_FLAT_CONFIG=false so it still works under ESLint 9.

After doing that, the linter started reporting two categories of issues that were not clean before:

  • @typescript-eslint/no-unused-vars for unused error bindings in many try/catch blocks
  • @typescript-eslint/no-unused-expressions in test and *.spec.ts files

I patched both in .eslintrc.js to restore the previous behavior as closely as possible.

My suggestion is to keep the legacy config for now. It is still supported in ESLint 9, even though it is removed in ESLint 10, and since we are planning to move to Biome, this should be a reasonable short-term approach.

},
}),
]
Loading
Loading