Update dependencies and add logging
Upgraded package.json to version 1.1.0 and added several development dependencies. Introduced a logger for better tracking of operations. Additionally, improved type definitions across the project and integrated enhanced ESLint configurations.
This commit is contained in:
@@ -1,74 +1,38 @@
|
||||
import globals from 'globals';
|
||||
// eslint.config.js
|
||||
import js from '@eslint/js';
|
||||
import typescript from '@typescript-eslint/eslint-plugin';
|
||||
import typescriptParser from '@typescript-eslint/parser';
|
||||
import globals from 'globals';
|
||||
|
||||
/** @type {import('eslint').Linter.Config[]} */
|
||||
export default [
|
||||
js.configs.recommended,
|
||||
{
|
||||
ignores: ['dist/**', 'node_modules/**', '*.min.js', '*.d.ts'],
|
||||
},
|
||||
{
|
||||
files: ['**/*.{ts,tsx}'],
|
||||
plugins: {
|
||||
'@typescript-eslint': typescript,
|
||||
},
|
||||
languageOptions: {
|
||||
ecmaVersion: 2024,
|
||||
sourceType: 'module',
|
||||
parser: typescriptParser,
|
||||
parserOptions: {
|
||||
ecmaVersion: 'latest',
|
||||
sourceType: 'module',
|
||||
project: './tsconfig.json',
|
||||
},
|
||||
globals: {
|
||||
...globals.node,
|
||||
...globals.browser,
|
||||
},
|
||||
},
|
||||
linterOptions: {
|
||||
reportUnusedDisableDirectives: true,
|
||||
},
|
||||
rules: {
|
||||
...js.configs.recommended.rules,
|
||||
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
|
||||
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
|
||||
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
|
||||
'no-constant-condition': ['error', { checkLoops: false }],
|
||||
'no-multiple-empty-lines': ['error', { max: 1, maxEOF: 0 }],
|
||||
quotes: ['error', 'single', { avoidEscape: true }],
|
||||
semi: ['error', 'always'],
|
||||
indent: ['error', 2, { SwitchCase: 1 }],
|
||||
'comma-dangle': ['error', 'always-multiline'],
|
||||
'arrow-parens': ['error', 'as-needed'], // Changed from 'avoid' to 'as-needed'
|
||||
'object-curly-spacing': ['error', 'always'],
|
||||
'array-bracket-spacing': ['error', 'never'],
|
||||
'space-before-function-paren': [
|
||||
'error',
|
||||
{
|
||||
anonymous: 'never',
|
||||
named: 'never',
|
||||
asyncArrow: 'always',
|
||||
},
|
||||
],
|
||||
'no-trailing-spaces': 'error',
|
||||
'eol-last': ['error', 'always'],
|
||||
'prefer-const': 'error',
|
||||
'no-var': 'error',
|
||||
eqeqeq: ['error', 'always'],
|
||||
curly: ['error', 'all'],
|
||||
'brace-style': ['error', '1tbs', { allowSingleLine: false }],
|
||||
'keyword-spacing': ['error', { before: true, after: true }],
|
||||
'space-infix-ops': 'error',
|
||||
'comma-spacing': ['error', { before: false, after: true }],
|
||||
'no-multi-spaces': 'error',
|
||||
'no-irregular-whitespace': 'error',
|
||||
'no-mixed-spaces-and-tabs': 'error',
|
||||
'no-else-return': 'error',
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['src/TokenCleaner.js'],
|
||||
rules: {
|
||||
'no-useless-escape': 'off',
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['**/*.test.js', '**/*.spec.js'],
|
||||
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...globals.jest,
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
...typescript.configs['recommended'].rules,
|
||||
'@typescript-eslint/no-explicit-any': 'warn',
|
||||
'@typescript-eslint/explicit-function-return-type': 'warn',
|
||||
'@typescript-eslint/explicit-module-boundary-types': 'warn',
|
||||
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
|
||||
'no-console': ['warn', { allow: ['warn', 'error'] }]
|
||||
},
|
||||
},
|
||||
];
|
||||
{
|
||||
ignores: ['dist/**', '*.test.{js,ts}', '**/*.spec.{js,ts}'],
|
||||
},
|
||||
];
|
Reference in New Issue
Block a user