Skip to content

Commit

Permalink
Rework the ESLint and Jest configurations to use the new ECMAScript m…
Browse files Browse the repository at this point in the history
…odule format.
  • Loading branch information
regadas committed Nov 18, 2024
1 parent bf45497 commit 8ad3289
Show file tree
Hide file tree
Showing 7 changed files with 279 additions and 248 deletions.
23 changes: 0 additions & 23 deletions .eslintrc.cjs

This file was deleted.

5 changes: 0 additions & 5 deletions eslint.config.js

This file was deleted.

26 changes: 26 additions & 0 deletions eslint.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import jest from 'eslint-plugin-jest';

export default tseslint.config(
{
ignores: ['dist'],
},
jest.configs['flat/recommended'],
eslint.configs.recommended,
...tseslint.configs.recommended,
{
rules: {
'@typescript-eslint/no-explicit-any': ['warn'],
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
},
],
},
}
);
5 changes: 0 additions & 5 deletions jest.config.cjs

This file was deleted.

17 changes: 17 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* For a detailed explanation regarding each configuration property, visit:
* https://jestjs.io/docs/configuration
*/

import type {Config} from 'jest';

const config: Config = {
clearMocks: true,
coverageProvider: 'v8',
moduleFileExtensions: ['js', 'ts'],
preset: 'ts-jest',
testEnvironment: 'node',
verbose: true,
};

export default config;
20 changes: 11 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,28 @@
"dist"
],
"devDependencies": {
"@types/jest": "^29.5.12",
"@eslint/js": "9.14.0",
"@types/eslint__js": "^8.42.3",
"@types/jest": "^29.5.14",
"@types/node": "^22.3.0",
"@typescript-eslint/eslint-plugin": "^8.1.0",
"@typescript-eslint/parser": "^8.1.0",
"eslint": "^9.10.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-jest": "^28.2.0",
"eslint": "9.14.0",
"eslint-plugin-jest": "^28.9.0",
"jest": "^29.7.0",
"jiti": "^2.4.0",
"prettier": "^3.0.0",
"ts-jest": "^29.2.3",
"ts-jest": "^29.2.5",
"ts-node": "^10.9.2",
"typedoc": "^0.26.5",
"typescript": "^5.5.4"
"typescript": "^5.6.3",
"typescript-eslint": "^8.14.0"
},
"dependencies": {
"axios": "1.7.7"
},
"scripts": {
"build": "tsc --project tsconfig.build.json",
"test:it": "jest --testPathPattern tests/it",
"test:lint": "eslint .",
"test:lint": "eslint . --flag unstable_ts_config",
"publish": "yarn build && yarn npm publish"
}
}
Loading

0 comments on commit 8ad3289

Please sign in to comment.