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
32 changes: 32 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2023,
sourceType: 'module',
ecmaFeatures: { jsx: true },
project: false,
},
plugins: ['@typescript-eslint', 'react', 'react-hooks', 'jsx-a11y'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:jsx-a11y/recommended',
],
settings: {
react: { version: 'detect' },
},
env: {
browser: true,
es2023: true,
node: true,
},
rules: {
'react/react-in-jsx-scope': 'off',
},
ignorePatterns: ['dist/', 'node_modules/', '.storybook/'],
};


61 changes: 61 additions & 0 deletions .github/workflows/ci-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: CI Build

on:
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm ci
- name: Build app
run: npm run build
- name: Build Storybook
run: npm run build:storybook

lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm ci
- name: Run ESLint
run: npm run lint

tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Start Storybook
run: |
npm run storybook &
npx wait-on http://127.0.0.1:6006
- name: Run Storybook tests (CI)
run: npm run test:stories:ci


43 changes: 43 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// ESLint flat config for TypeScript + React
import js from '@eslint/js';
import tseslint from '@typescript-eslint/eslint-plugin';
import tsparser from '@typescript-eslint/parser';
import reactPlugin from 'eslint-plugin-react';
import reactHooks from 'eslint-plugin-react-hooks';
import jsxA11y from 'eslint-plugin-jsx-a11y';

export default [
js.configs.recommended,
{
files: ['**/*.{ts,tsx}'],
languageOptions: {
parser: tsparser,
ecmaVersion: 2023,
sourceType: 'module',
globals: {
document: 'readonly',
window: 'readonly',
navigator: 'readonly',
},
},
plugins: {
'@typescript-eslint': tseslint,
react: reactPlugin,
'react-hooks': reactHooks,
'jsx-a11y': jsxA11y,
},
rules: {
...reactPlugin.configs.recommended.rules,
...reactHooks.configs.recommended.rules,
'react/react-in-jsx-scope': 'off',
},
settings: {
react: { version: 'detect' },
},
},
{
ignores: ['dist/', 'node_modules/', '.storybook/'],
},
];


14 changes: 14 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>library-react</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>


Loading