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
48 changes: 48 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# 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]

# Cancel a pull request's in-progress run when a newer commit is pushed.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

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: Set up Node.js
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: .nvmrc
- name: Install Dependencies
run: npm ci
- name: Lint
run: npm run lint

test:
name: Test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, macOS-latest]

steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Node.js
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: .nvmrc
- name: Install Dependencies
run: npm ci
- name: Build
run: npm run build
4 changes: 2 additions & 2 deletions .github/workflows/capacitor-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ jobs:
with:
ref: ${{ github.ref_name }}
token: ${{ secrets.IONITRON_GITHUB_TOKEN }}
- name: Configure Node
- name: Set up Node.js
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 26
node-version-file: .nvmrc
- name: Install Dependencies
run: npm ci
- name: Build
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
26
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"
]
}
43 changes: 43 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
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',
// Pages export a component wrapped in the custom `connect()` HOC from data/connect.tsx.
'react-refresh/only-export-components': [
'error',
{ allowConstantExport: true, allowCompoundComponents: true, extraHOCs: ['connect'] },
],
// `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