Skip to content
Open
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
2 changes: 2 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ Talk to us before creating a PR that refactors the code or directory structure o

Make sure to follow the existing code style as much as possible.

Code is linted with ESLint and formatted with Prettier, and pull requests must pass `npm run lint`. Run `npm run lint:fix` to fix what can be fixed automatically.

* No underscores prefixing JS functions.
* Use flat Sass:
* **Don't** use [BEM conventions](https://css-tricks.com/bem-101/)
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# GitHub Actions docs
# https://help.github.com/en/articles/about-github-actions
# https://help.github.com/en/articles/workflow-syntax-for-github-actions

name: Install Dependencies, Lint and Build

on: [pull_request]

jobs:
lint:
name: Lint
# Lint once on Linux. Windows runners check out with CRLF line endings,
# which Prettier would report as formatting changes.
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Use Node.js 24
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
- name: Install Dependencies
run: npm ci
- name: Lint
run: npm run lint

test:
name: Test on node ${{ matrix.node_version }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
# When node version is updated, update the version in the GitHub repository settings (admin access required):
# Branches -> Edit `main` -> Protect matching branches ->
# Require status checks to pass before merging ->
# Search for the new version -> Add them to the list ->
# Remove the old version from the list -> Save changes
node_version: [24]
os: [windows-latest, macOS-latest]

steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: ${{ matrix.node_version }}
- name: Install Dependencies
run: npm ci
- name: Build
run: npm run build
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Prettier only reads the root .gitignore, not the ones inside the native
# projects, so ignore them here to skip Capacitor's copied web build and
# Gradle's build output.
android/
ios/
5 changes: 0 additions & 5 deletions .prettierrc

This file was deleted.

7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"Webnative.webnative"
]
}
42 changes: 42 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import ionic from '@ionic/eslint-config/recommended.js';
import { defineConfig } from 'eslint/config';
import reactHooks from 'eslint-plugin-react-hooks';
import reactRefresh from 'eslint-plugin-react-refresh';
import globals from 'globals';

export default defineConfig([
{ ignores: ['dist/**', 'android/**', 'ios/**'] },
ionic,
{
files: ['**/*.{ts,tsx}'],
extends: [reactHooks.configs.flat.recommended, reactRefresh.configs.vite],
languageOptions: {
globals: {
...globals.browser,
...globals.node,
},
},
rules: {
// Ionic's base level; `recommended` makes it an error, which is meant for libraries.
'@typescript-eslint/explicit-module-boundary-types': 'warn',
// Every page exports both the component and a `connect()`-wrapped default,
// which fast refresh can't follow. Revisit if the custom connect HOC in
// data/connect.tsx is replaced with hooks.
'react-refresh/only-export-components': 'off',
// `connect()` and several page props use `{}` as an empty-props generic.
'@typescript-eslint/no-empty-object-type': 'off',
// The demo uses `cond && fn()` and ternaries for side effects throughout.
'@typescript-eslint/no-unused-expressions': 'off',
},
},
{
// The snapshot test predates the current tooling and has no runner; it is
// still typechecked by `tsc`, so keep it linted with jest globals defined.
files: ['**/*.test.{ts,tsx}'],
languageOptions: {
globals: {
...globals.jest,
},
},
},
]);
Loading
Loading