Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade packages to latest version #3

Merged
merged 6 commits into from
Nov 6, 2024
Merged
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
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

73 changes: 0 additions & 73 deletions .eslintrc.cjs

This file was deleted.

15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: 'npm' # See documentation for possible values
directory: '/' # Location of package manifests
schedule:
interval: daily
commit-message:
prefix: fix
prefix-development: chore
include: scope
105 changes: 105 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
import globals from 'globals';
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import reactRefreshPlugin from 'eslint-plugin-react-refresh';
import typescriptParser from '@typescript-eslint/parser';
import reactPlugin from 'eslint-plugin-react';
import simpleImportSortPlugin from 'eslint-plugin-simple-import-sort';
import prettierConfig from 'eslint-config-prettier';
import reactHooksPlugin from 'eslint-plugin-react-hooks';
import testingLibraryPlugin from 'eslint-plugin-testing-library';

// Fix for AudioWorkletGlobalScope global
const GLOBALS_BROWSER_FIX = Object.assign({}, globals.browser, {
AudioWorkletGlobalScope: globals.browser['AudioWorkletGlobalScope '],
});

delete GLOBALS_BROWSER_FIX['AudioWorkletGlobalScope '];

export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
...tseslint.configs.stylisticTypeChecked,
reactPlugin.configs.flat.recommended,
reactPlugin.configs.flat['jsx-runtime'],
prettierConfig,
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
globals: {
...GLOBALS_BROWSER_FIX,
},
parser: typescriptParser,
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
sourceType: 'module',
ecmaVersion: 'latest',
ecmaFeatures: {
jsx: true,
},
},
},
settings: {
react: {
version: 'detect',
},
},
plugins: {
'react-refresh': reactRefreshPlugin,
'simple-import-sort': simpleImportSortPlugin,
'react-hooks': reactHooksPlugin,
},
rules: {
...reactHooksPlugin.configs.recommended.rules,
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
// enforce import and export sorting
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',

// disable unused vars check for variables starting with underscore _
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],

// disable no empty function to work with saga
'@typescript-eslint/no-empty-function': 'off',
},
},
// unit and integration testing configuration
{
files: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'],
plugins: {
'testing-library': testingLibraryPlugin,
},
},
// import and export sorting configuration
{
files: ['**/*.js', '**/*.ts', '**/*.tsx'],
rules: {
'simple-import-sort/imports': [
'error',
{
groups: [
// `react` first, `next` second, then packages starting with a character
['^react$', '^http', '^next', '^[a-z]'],
// Packages starting with `@`
['^@'],
// Packages starting with `~`
['^~'],
// Imports starting with `../`
['^\\.\\.(?!/?$)', '^\\.\\./?$'],
// Imports starting with `./`
['^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'],
// Style imports
['^.+\\.s?css$'],
// Side effect imports
['^\\u0000'],
],
},
],
},
},
{
ignores: ['dist', 'eslint.config.mjs', '__mocks__'],
},
);
58 changes: 30 additions & 28 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,46 +9,48 @@
"preview": "vite preview",
"test": "jest",
"format": "prettier --write .",
"lint": "eslint . --ext ts --ext tsx --ext js --fix",
"check:lint": "eslint . --ext ts --ext tsx --ext js",
"lint": "eslint . --fix",
"check:lint": "eslint .",
"check:format": "prettier --check .",
"check:types": "tsc --pretty --noEmit",
"check:all": "yarn check:lint && yarn check:format && yarn check:types && yarn build",
"prepare": "husky"
},
"dependencies": {
"@reduxjs/toolkit": "^2.2.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-redux": "^9.1.0",
"@reduxjs/toolkit": "^2.3.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-redux": "^9.1.2",
"redux-saga": "^1.3.0"
},
"devDependencies": {
"@babel/preset-env": "^7.24.0",
"@babel/preset-react": "^7.23.3",
"@testing-library/react": "^14.2.1",
"@types/jest": "^29.5.12",
"@types/react": "^18.2.64",
"@types/react-dom": "^18.2.21",
"@typescript-eslint/eslint-plugin": "^7.1.1",
"@typescript-eslint/parser": "^7.1.1",
"@vitejs/plugin-react-swc": "^3.5.0",
"eslint": "^8.57.0",
"@babel/preset-env": "^7.26.0",
"@babel/preset-react": "^7.25.9",
"@eslint/js": "^9.14.0",
"@testing-library/dom": "^10.4.0",
"@testing-library/react": "^16.0.1",
"@types/eslint__js": "^8.42.3",
"@types/jest": "^29.5.14",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@typescript-eslint/parser": "^8.13.0",
"@vitejs/plugin-react-swc": "^3.7.1",
"eslint": "^9.14.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.5",
"eslint-plugin-simple-import-sort": "^12.0.0",
"eslint-plugin-testing-library": "^6.2.0",
"husky": "^9.0.11",
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-react-refresh": "^0.4.14",
"eslint-plugin-simple-import-sort": "^12.1.1",
"eslint-plugin-testing-library": "^6.4.0",
"husky": "^9.1.6",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"prettier": "^3.2.5",
"react-test-renderer": "^18.2.0",
"ts-jest": "^29.1.2",
"prettier": "^3.3.3",
"react-test-renderer": "^18.3.1",
"ts-jest": "^29.2.5",
"ts-node": "^10.9.2",
"typescript": "^5.2.2",
"vite": "^5.1.6"
"typescript": "^5.6.3",
"typescript-eslint": "^8.13.0",
"vite": "^5.4.10"
}
}
2 changes: 1 addition & 1 deletion src/redux/counter/saga.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function* watchIncrementByAmountAsync(
yield delay(1000);
yield put(counterActions.incrementByAmount(action.payload));
yield put(counterActions.incrementByAmountAsyncSuccess());
} catch (error) {
} catch {
yield put(counterActions.incrementByAmountAsyncFailure());
}
}
Expand Down
Loading
Loading