Skip to content
Draft
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
3 changes: 0 additions & 3 deletions .prettierignore

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ Closes the currently active browser. It can be used to close browsers launched t
### addListener('browserClosed' | 'browserPageLoaded', ...)

```typescript
addListener(eventName: 'browserClosed' | 'browserPageLoaded', listenerFunc: () => void) => Promise<PluginListenerHandle>
addListener(eventName: "browserClosed" | "browserPageLoaded", listenerFunc: () => void) => Promise<PluginListenerHandle>
```

Adds a listener for the specified browser events, with no data being returned.
Expand All @@ -175,7 +175,7 @@ Adds a listener for the specified browser events, with no data being returned.
### addListener('browserPageNavigationCompleted', ...)

```typescript
addListener(eventName: 'browserPageNavigationCompleted', listenerFunc: (data: BrowserPageNavigationCompletedEventData) => void) => Promise<PluginListenerHandle>
addListener(eventName: "browserPageNavigationCompleted", listenerFunc: (data: BrowserPageNavigationCompletedEventData) => void) => Promise<PluginListenerHandle>
```

Adds a listener for the specified browser event, which receives data.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {

@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext =
InstrumentationRegistry.getInstrumentation().getTargetContext();

assertEquals("com.getcapacitor.android", appContext.getPackageName());
}
assertEquals("com.getcapacitor.android", appContext.getPackageName());
}
}
8 changes: 4 additions & 4 deletions android/src/test/java/com/getcapacitor/ExampleUnitTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
*/
public class ExampleUnitTest {

@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
}
74 changes: 44 additions & 30 deletions eslint.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,48 +5,62 @@ import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'
import eslintjs from '@eslint/js';
*/

const tseslint = require('@typescript-eslint/eslint-plugin');
const tseslintparser = require('@typescript-eslint/parser');
const eslintPluginPrettierRecommended = require('eslint-plugin-prettier/recommended');
const eslintjs = require('@eslint/js');
const tseslint = require("@typescript-eslint/eslint-plugin");
const tseslintparser = require("@typescript-eslint/parser");
const eslintPluginPrettierRecommended = require("eslint-plugin-prettier/recommended");
const eslintjs = require("@eslint/js");

module.exports = [
{
files: ['**/*.ts'],
ignores: ['node_modules', 'dist/**/*', 'build/**/*', 'example-app/**/*'],
ignores: [
"node_modules/**",
"dist/**",
"build/**",
"example-app/**",
"example-app-spm/**",
"eslint.config.*",
],
},
{
files: ["**/*.ts"],
languageOptions: {
parser: tseslintparser,
},
plugins: {
'@typescript-eslint': tseslint,
"@typescript-eslint": tseslint,
},
rules: {
'@typescript-eslint/ban-ts-comment': 'error',
'@typescript-eslint/ban-types': 'error',
'no-array-constructor': 'off',
'@typescript-eslint/no-array-constructor': 'error',
'@typescript-eslint/no-duplicate-enum-values': 'error',
'@typescript-eslint/no-extra-non-null-assertion': 'error',
'no-loss-of-precision': 'off',
'@typescript-eslint/no-loss-of-precision': 'error',
'@typescript-eslint/no-misused-new': 'error',
'@typescript-eslint/no-namespace': 'error',
'@typescript-eslint/no-non-null-asserted-optional-chain': 'error',
'@typescript-eslint/no-unnecessary-type-constraint': 'error',
'@typescript-eslint/no-unsafe-declaration-merging': 'error',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/no-var-requires': 'error',
'@typescript-eslint/prefer-as-const': 'error',
'@typescript-eslint/triple-slash-reference': 'error',
"@typescript-eslint/ban-ts-comment": "error",
"no-array-constructor": "off",
"@typescript-eslint/no-array-constructor": "error",
"@typescript-eslint/no-duplicate-enum-values": "error",
"@typescript-eslint/no-extra-non-null-assertion": "error",
"no-loss-of-precision": "off",
"@typescript-eslint/no-loss-of-precision": "error",
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-non-null-asserted-optional-chain": "error",
"@typescript-eslint/no-unnecessary-type-constraint": "error",
"@typescript-eslint/no-unsafe-declaration-merging": "error",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
],
"@typescript-eslint/no-var-requires": "error",
"@typescript-eslint/prefer-as-const": "error",
"@typescript-eslint/triple-slash-reference": "error",
// https://eslint.org/docs/rules/
'no-fallthrough': 'off', // https://github.com/ionic-team/eslint-config/issues/7
'no-constant-condition': 'off',
"no-fallthrough": "off", // https://github.com/ionic-team/eslint-config/issues/7
"no-constant-condition": "off",

// https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin/docs/rules
'@typescript-eslint/no-this-alias': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/explicit-module-boundary-types': ['warn', { allowArgumentsExplicitlyTypedAsAny: true }],
"@typescript-eslint/no-this-alias": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-module-boundary-types": [
"warn",
{ allowArgumentsExplicitlyTypedAsAny: true },
],
},
},
eslintjs.configs.recommended,
Expand Down
8 changes: 4 additions & 4 deletions example-app-spm/capacitor.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { CapacitorConfig } from '@capacitor/cli';
import type { CapacitorConfig } from "@capacitor/cli";

const config: CapacitorConfig = {
appId: 'io.ionic.starter',
appName: 'example-app',
webDir: 'dist'
appId: "io.ionic.starter",
appName: "example-app",
webDir: "dist",
};

export default config;
2 changes: 1 addition & 1 deletion example-app-spm/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ export default defineConfig({
// implement node event listeners here
},
},
});
});
12 changes: 6 additions & 6 deletions example-app-spm/cypress/e2e/test.cy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
describe('My First Test', () => {
it('Visits the app root url', () => {
cy.visit('/')
cy.contains('#container', 'Ready to create an app?')
})
})
describe("My First Test", () => {
it("Visits the app root url", () => {
cy.visit("/");
cy.contains("#container", "Ready to create an app?");
});
});
2 changes: 1 addition & 1 deletion example-app-spm/cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@
// visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element>
// }
// }
// }
// }
4 changes: 2 additions & 2 deletions example-app-spm/cypress/support/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands'
import "./commands";

// Alternatively you can use CommonJS syntax:
// require('./commands')
// require('./commands')
Loading