mirror of
https://github.com/aleleba/create-react-component-library.git
synced 2026-06-20 07:21:09 -06:00
- Bump all dependencies to latest (React 19.2.7, Storybook 10.4.3, Webpack 5.107.2 + webpack-cli 7, Jest 30.4.2, Cypress 15.17.0, Babel 7.29.7, sass-loader 17, css-minimizer-webpack-plugin 8, eslint-webpack-plugin 6). - Migrate TypeScript 5.9 -> 6.0.3: set tsconfig rootDir, add ignoreDeprecations "6.0", scope include to src/components + src/@types, and declare *.scss/*.sass/*.css modules for stricter side-effect imports. - Switch @babel/preset-react to the automatic JSX runtime and drop redundant React imports in stories and tests. - Migrate ESLint from the deprecated .eslintrc.js to flat config (eslint.config.mjs) using typescript-eslint, @eslint/js, globals and the React/Storybook plugins. Keep ESLint at v9 because eslint-plugin-react does not support v10 yet. This fixes the previously broken lint (missing @typescript-eslint parser/plugin) and normalizes formatting. - Fix a latent bug in .storybook/main.js (comma instead of semicolon joining two assignments via the comma operator). - npm audit fix: 0 vulnerabilities. - Bump package version to 1.4.0.
40 lines
1.0 KiB
TypeScript
40 lines
1.0 KiB
TypeScript
|
|
// ***********************************************************
|
|
// This example support/component.ts is processed and
|
|
// loaded automatically before your test files.
|
|
//
|
|
// This is a great place to put global configuration and
|
|
// behavior that modifies Cypress.
|
|
//
|
|
// You can change the location of this file or turn off
|
|
// automatically serving support files with the
|
|
// 'supportFile' configuration option.
|
|
//
|
|
// You can read more here:
|
|
// https://on.cypress.io/configuration
|
|
// ***********************************************************
|
|
|
|
// Import commands.js using ES2015 syntax:
|
|
import './commands';
|
|
|
|
// Alternatively you can use CommonJS syntax:
|
|
// require('./commands')
|
|
|
|
import { mount } from 'cypress/react';
|
|
|
|
// Augment the Cypress namespace to include type definitions for
|
|
// your custom command.
|
|
declare global {
|
|
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
namespace Cypress {
|
|
interface Chainable {
|
|
mount: typeof mount
|
|
}
|
|
}
|
|
}
|
|
|
|
Cypress.Commands.add('mount', mount);
|
|
|
|
// Example use:
|
|
// cy.mount(<MyComponent />)
|