Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

49 changes: 49 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
module.exports = {
root: true,
ignorePatterns: ['node_modules', 'lib', 'examples', 'docs'],
env: {
es2021: true,
node: true,
},
extends: ['eslint:recommended'],
parserOptions: {
ecmaVersion: 2021,
sourceType: 'module',
},
settings: {
'import/extensions': ['.js'],
},
plugins: ['@typescript-eslint', 'import'],
rules: {
'no-console': ['error', { allow: ['warn', 'error', 'time'] }],
'import/extensions': ['error', 'ignorePackages'],
},
overrides: [
{
files: ['**/*.ts'],
parser: '@typescript-eslint/parser',
rules: {
'no-undef': 'off',
'no-unused-vars': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
],
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
},
{
files: ['*.spec.ts', '*.test.ts', 'tests/**/*.ts'],
env: {
jest: true,
},
rules: {
'import/extensions': 'off',
},
},
],
};


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

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/pull-reqeust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 16.x, 18.x, 20.x ]
node-version: [ 18.x, 20.x, 22.x, 24.x ]
name: Nodejs ${{ matrix.node-version }}
steps:
- uses: actions/checkout@v2
Expand Down
72 changes: 72 additions & 0 deletions eslint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
const tsParser = require('@typescript-eslint/parser');
const tsPlugin = require('@typescript-eslint/eslint-plugin');
const importPlugin = require('eslint-plugin-import');
const eslintJs = require('@eslint/js');
const globals = require('globals');

module.exports = [
// Ignored paths (replaces .eslintignore)
{
ignores: ['node_modules', 'lib', 'examples', 'docs'],
},

// Base JavaScript recommended rules
eslintJs.configs.recommended,

// Project rules for JS/TS files
{
files: ['**/*.{ts,js}'],
languageOptions: {
parser: tsParser,
ecmaVersion: 2021,
sourceType: 'module',
globals: {
...globals.es2021,
...globals.node,
},
},
plugins: {
'@typescript-eslint': tsPlugin,
import: importPlugin,
},
settings: {
'import/extensions': ['.js'],
},
rules: {
'no-console': ['error', { allow: ['warn', 'error', 'time'] }],
'@typescript-eslint/no-var-requires': 'off',
// Use the TS version of this rule; base rule disabled for TS below
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
],
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'import/extensions': ['error', 'ignorePackages'],
},
},

// TypeScript-specific overrides to avoid false positives from base rules
{
files: ['**/*.ts'],
rules: {
'no-undef': 'off',
'no-unused-vars': 'off',
},
},

// Test-specific tweaks
{
files: ['*.spec.ts', '*.test.ts', 'tests/**/*.ts'],
languageOptions: {
globals: {
...globals.jest,
},
},
rules: {
'import/extensions': 'off',
},
},
];


Loading
Loading