Skip to content
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
5 changes: 5 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ on:
types: [created]

jobs:
quality-check:
uses: ./.github/workflows/quality-check.yml
secrets: inherit

publish:
needs: quality-check
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/quality-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Quality Check

on:
pull_request:
push:
branches: [main]
workflow_call:

jobs:
checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Set Node.js
uses: actions/setup-node@v6
with:
node-version: 24
cache: 'pnpm'

- name: Install dependencies
run: pnpm i --frozen-lockfile

- name: Lint
run: pnpm lint

- name: Type check
run: pnpm check-types

- name: Tests
run: pnpm test
14 changes: 14 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export default [
...js.configs.recommended.rules,
...tsPlugin.configs.recommended.rules,
...reactPlugin.configs.recommended.rules,
...reactPlugin.configs['jsx-runtime'].rules,
...reactHooksPlugin.configs.recommended.rules,
...importPlugin.configs.recommended.rules,
...jsxA11yPlugin.configs.recommended.rules,
Expand All @@ -61,6 +62,19 @@ export default [
'react/require-default-props': 'off',
'react/jsx-props-no-spreading': 'off',
'react/jsx-filename-extension': [1, { extensions: ['.tsx', '.jsx'] }],
'react-hooks/preserve-manual-memoization': 'warn',
'react-hooks/refs': 'warn',
},
},
{
files: ['src/**/*.test.{ts,tsx}'],
languageOptions: {
globals: {
...globals.jest,
},
},
rules: {
'import/no-unresolved': 'off',
},
},
];
26 changes: 26 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/** @type {import('jest').Config} */
module.exports = {
testEnvironment: 'jsdom',
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
transform: {
'^.+\\.tsx?$': [
'ts-jest',
{
tsconfig: {
jsx: 'react-jsx',
esModuleInterop: true,
module: 'commonjs',
moduleResolution: 'node',
target: 'es2020',
lib: ['dom', 'dom.iterable', 'esnext'],
strict: true,
skipLibCheck: true,
isolatedModules: true,
allowJs: true,
ignoreDeprecations: '6.0',
},
},
],
},
testMatch: ['<rootDir>/src/**/*.test.@(ts|tsx)'],
};
1 change: 1 addition & 0 deletions jest.setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import '@testing-library/jest-dom';
52 changes: 35 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
{
"name": "react-simply-carousel",
"version": "9.1.18",
"version": "10.0.0",
"description": "A simple, lightweight, fully controlled isomorphic (with SSR support) React.js carousel component. Touch enabled and responsive. With support for autoplay and infinity options. Fully customizable",
"files": [
"dist/"
],
"main": "dist/index.js",
"module": "dist/index.esm.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.esm.js",
"require": "./dist/index.js"
},
"./package.json": "./package.json"
},
"sideEffects": false,
"scripts": {
"build": "rm -rf dist && pnpm lint && rollup -c",
"lint": "eslint src --ext .tsx",
"lint": "eslint src --ext .tsx --quiet",
"prepare": "husky install",
"prepublish": "pnpm build",
"check-types": "tsc --noEmit"
"check-types": "tsc --noEmit",
"test": "jest",
"test:watch": "jest --watch"
},
"keywords": [
"react",
Expand Down Expand Up @@ -42,36 +52,44 @@
},
"homepage": "https://github.com/vadymshymko/react-simply-carousel#readme",
"devDependencies": {
"@eslint/compat": "^2.0.3",
"@eslint/compat": "^2.0.5",
"@eslint/js": "^10.0.1",
"@rollup/plugin-commonjs": "^29.0.2",
"@rollup/plugin-node-resolve": "^16.0.3",
"@rollup/plugin-terser": "^1.0.0",
"@rollup/plugin-typescript": "^12.3.0",
"@testing-library/dom": "^10.4.1",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.2",
"@testing-library/user-event": "^14.6.1",
"@types/jest": "^30.0.0",
"@types/react": "^19.2.14",
"@types/react-dom": "^19.2.3",
"@typescript-eslint/eslint-plugin": "^8.56.1",
"@typescript-eslint/parser": "^8.56.1",
"eslint": "^10.0.3",
"@typescript-eslint/eslint-plugin": "^8.59.0",
"@typescript-eslint/parser": "^8.59.0",
"eslint": "^10.2.1",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^7.0.1",
"globals": "^17.4.0",
"eslint-plugin-react-hooks": "^7.1.1",
"globals": "^17.5.0",
"husky": "^9.1.7",
"jest": "^30.3.0",
"jest-environment-jsdom": "^30.3.0",
"lint-staged": "^16.3.2",
"prettier": "3.8.1",
"react": "^19.2.4",
"react-dom": "^19.2.4",
"rollup": "^4.59.0",
"prettier": "3.8.3",
"react": "^19.2.5",
"react-dom": "^19.2.5",
"rollup": "^4.60.2",
"ts-jest": "^29.4.9",
"tslib": "^2.8.1",
"typescript": "5.9.3"
"typescript": "6.0.3"
},
"peerDependencies": {
"@types/react": "^16.8 || ^17 || ^18 || ^19",
"react": "^16.8 || ^17 || ^18 || ^19",
"react-dom": "^16.8 || ^17 || ^18 || ^19"
"@types/react": "^17 || ^18 || ^19",
"react": "^17 || ^18 || ^19",
"react-dom": "^17 || ^18 || ^19"
},
"peerDependenciesMeta": {
"@types/react": {
Expand Down
Loading
Loading