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
23 changes: 19 additions & 4 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,23 @@ name: Install Dependencies, Lint, Build and Test
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 }}
Expand All @@ -21,15 +38,13 @@ jobs:
os: [windows-latest, macOS-latest]

steps:
- uses: actions/checkout@v7
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v7
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: ${{ matrix.node_version }}
- name: Install Dependencies
run: npm ci
- name: Lint
run: npm run lint
- name: Build
run: npm run build -- --configuration=production
- name: Test
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ www/
log.txt
*.sublime-project
*.sublime-workspace
.vscode/
.vscode/*
!.vscode/extensions.json
npm-debug.log*
.firebase/
.idea/
Expand Down
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/
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"Angular.ng-template",
"Webnative.webnative"
]
}
42 changes: 13 additions & 29 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,38 +1,29 @@
// @ts-check
const eslint = require('@eslint/js');
const tseslint = require('typescript-eslint');
const ionic = require('@ionic/eslint-config/recommended');
const angular = require('angular-eslint');
const { defineConfig } = require('eslint/config');

module.exports = tseslint.config(
module.exports = defineConfig([
{
ignores: ['www/**', 'dist/**', 'coverage/**', '.angular/**'],
ignores: ['www/**', 'dist/**', 'coverage/**', '.angular/**', 'android/**', 'ios/**'],
},
ionic,
{
files: ['**/*.ts'],
extends: [
eslint.configs.recommended,
...tseslint.configs.recommended,
...angular.configs.tsRecommended,
],
extends: [angular.configs.tsRecommended],
processor: angular.processInlineTemplates,
rules: {
// Ionic's base level; `recommended` makes it an error, which is meant for libraries.
'@typescript-eslint/explicit-module-boundary-types': 'warn',
'@typescript-eslint/explicit-member-accessibility': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-inferrable-types': [
'error',
{ ignoreParameters: true },
],
'@typescript-eslint/no-inferrable-types': ['error', { ignoreParameters: true }],
'@typescript-eslint/no-non-null-assertion': 'error',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/member-ordering': [
'error',
{
default: [
'static-field',
'instance-field',
'static-method',
'instance-method',
],
default: ['static-field', 'instance-field', 'static-method', 'instance-method'],
},
],
'@typescript-eslint/naming-convention': [
Expand All @@ -47,23 +38,16 @@ module.exports = tseslint.config(
'@angular-eslint/no-output-rename': 'error',
'@angular-eslint/use-lifecycle-interface': 'error',
'@angular-eslint/use-pipe-transform-interface': 'error',
quotes: ['error', 'single'],
semi: ['error', 'always'],
'max-len': ['error', { code: 140 }],
'no-console': 'off',
curly: 'error',
eqeqeq: 'error',
'no-empty': 'off',
'arrow-parens': ['error', 'as-needed'],
'object-shorthand': 'error',
'eol-last': 'error',
'no-multiple-empty-lines': ['error', { max: 1 }],
'no-trailing-spaces': 'error',
},
},
{
files: ['**/*.html'],
extends: [...angular.configs.templateRecommended],
extends: [angular.configs.templateRecommended],
rules: {},
}
);
},
]);
Loading
Loading