Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit 960c359

Browse files
committed
refactor(linter): adoption of the prettier configuration
1 parent 7b90983 commit 960c359

File tree

93 files changed

+794
-738
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+794
-738
lines changed

.eslintrc.js

Lines changed: 71 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -6,107 +6,107 @@ module.exports = {
66
worker: true,
77
},
88
extends: [
9-
'eslint:recommended',
10-
'plugin:@typescript-eslint/eslint-recommended',
11-
'plugin:@typescript-eslint/recommended',
12-
'plugin:@typescript-eslint/recommended-requiring-type-checking',
13-
'plugin:@typescript-eslint/strict',
14-
'plugin:react/recommended',
15-
'plugin:react/jsx-runtime',
16-
'plugin:import/recommended',
17-
'plugin:import/typescript',
18-
'plugin:jsx-a11y/recommended',
19-
'plugin:playwright/playwright-test',
20-
'plugin:sonarjs/recommended',
21-
'plugin:typescript-sort-keys/recommended',
9+
"eslint:recommended",
10+
"plugin:@typescript-eslint/eslint-recommended",
11+
"plugin:@typescript-eslint/recommended",
12+
"plugin:@typescript-eslint/recommended-requiring-type-checking",
13+
"plugin:@typescript-eslint/strict",
14+
"plugin:react/recommended",
15+
"plugin:react/jsx-runtime",
16+
"plugin:import/recommended",
17+
"plugin:import/typescript",
18+
"plugin:jsx-a11y/recommended",
19+
"plugin:playwright/playwright-test",
20+
"plugin:sonarjs/recommended",
21+
"plugin:typescript-sort-keys/recommended",
2222
// HINT: prettier must be the last extension to work
23-
'plugin:prettier/recommended',
23+
"plugin:prettier/recommended",
2424
],
25-
ignorePatterns: ['build', 'dist', 'docker', 'node_modules', 'openshift', 'public'],
25+
ignorePatterns: ["build", "dev-dist", "dist", "docker", "node_modules", "openshift", "public"],
2626
overrides: [
2727
{
28-
files: ['*.ts', '*.tsx'],
28+
files: ["*.ts", "*.tsx"],
2929
rules: {
30-
'no-undef': 'off',
31-
'no-unused-vars': 'off',
30+
"no-undef": "off",
31+
"no-unused-vars": "off",
3232
},
3333
},
3434
],
35-
parser: '@typescript-eslint/parser',
35+
parser: "@typescript-eslint/parser",
3636
parserOptions: {
37-
project: ['./tsconfig.json'],
37+
project: ["./tsconfig.json"],
3838
tsconfigRootDir: __dirname,
3939
},
4040
plugins: [
41-
'@typescript-eslint',
42-
'jsx-a11y',
43-
'react-hooks',
44-
'react',
45-
'sonarjs',
46-
'sort-keys-fix',
47-
'typescript-sort-keys',
41+
"@typescript-eslint",
42+
"jsx-a11y",
43+
"react-hooks",
44+
"react",
45+
"sonarjs",
46+
"sort-keys-fix",
47+
"typescript-sort-keys",
4848
// HINT: prettier must be the last plugin to work
49-
'prettier',
49+
"prettier",
5050
],
5151
rules: {
52-
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
53-
'@typescript-eslint/no-floating-promises': ['error', { ignoreVoid: true }],
54-
'@typescript-eslint/no-misused-promises': [
55-
'error',
52+
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
53+
"@typescript-eslint/no-floating-promises": ["error", { ignoreVoid: true }],
54+
"@typescript-eslint/no-misused-promises": [
55+
"error",
5656
{
5757
checksVoidReturn: false,
5858
},
5959
],
60-
'@typescript-eslint/no-unused-vars': [
61-
'warn',
60+
"@typescript-eslint/no-unused-vars": [
61+
"warn",
6262
{
63-
argsIgnorePattern: '^_',
64-
caughtErrorsIgnorePattern: '^_',
65-
varsIgnorePattern: '^_',
63+
argsIgnorePattern: "^_",
64+
caughtErrorsIgnorePattern: "^_",
65+
varsIgnorePattern: "^_",
6666
},
6767
],
68-
'@typescript-eslint/sort-type-union-intersection-members': 'error',
69-
camelcase: 'warn',
70-
curly: 'error',
71-
'import/no-unused-modules': [
72-
'error',
68+
"@typescript-eslint/sort-type-union-intersection-members": "error",
69+
camelcase: "warn",
70+
curly: "error",
71+
"import/no-unused-modules": [
72+
"error",
7373
{
7474
ignoreExports: [
75-
'playwright/index.ts',
76-
'src/index.tsx',
77-
'src/**/*.d.ts',
78-
'src/**/*.{spec,test}.{ts,tsx}',
79-
'*.{js,ts}', // mostly configuration files
75+
"playwright/index.ts",
76+
"src/index.tsx",
77+
"src/**/*.d.ts",
78+
"src/**/*.{spec,test}.{ts,tsx}",
79+
"*.{js,ts}", // mostly configuration files
8080
],
8181
missingExports: true,
82-
src: ['.'],
82+
src: ["."],
8383
unusedExports: true,
8484
},
8585
],
86-
'import/order': [
87-
'error',
86+
"import/order": [
87+
"error",
8888
{
8989
alphabetize: {
9090
caseInsensitive: true,
91-
order: 'asc',
91+
order: "asc",
9292
},
93-
groups: ['builtin', 'external', 'internal'],
93+
groups: ["builtin", "external", "internal"],
9494
pathGroups: [
9595
{
96-
group: 'external',
97-
pattern: 'react',
98-
position: 'before',
96+
group: "external",
97+
pattern: "react",
98+
position: "before",
9999
},
100100
],
101-
pathGroupsExcludedImportTypes: ['react'],
101+
pathGroupsExcludedImportTypes: ["react"],
102102
},
103103
],
104-
'import/prefer-default-export': 'off',
105-
'no-console': ['warn', { allow: ['warn', 'error'] }],
106-
'prettier/prettier': 'error',
107-
'react/jsx-sort-default-props': 'error',
108-
'react/jsx-sort-props': [
109-
'error',
104+
"import/prefer-default-export": "off",
105+
"no-console": ["warn", { allow: ["warn", "error"] }],
106+
"prettier/prettier": "error",
107+
"react/jsx-sort-default-props": "error",
108+
"react/jsx-sort-props": [
109+
"error",
110110
{
111111
callbacksLast: true,
112112
ignoreCase: true,
@@ -116,34 +116,34 @@ module.exports = {
116116
shorthandLast: false,
117117
},
118118
],
119-
'react-hooks/exhaustive-deps': 'error',
120-
'react-hooks/rules-of-hooks': 'error',
121-
'sort-imports': [
122-
'error',
119+
"react-hooks/exhaustive-deps": "error",
120+
"react-hooks/rules-of-hooks": "error",
121+
"sort-imports": [
122+
"error",
123123
{
124124
ignoreCase: true,
125125
ignoreDeclarationSort: true,
126126
ignoreMemberSort: false,
127127
},
128128
],
129129
// Required to fix sort-keys automatically, since this is not done by default.
130-
'sort-keys-fix/sort-keys-fix': [
131-
'error',
132-
'asc',
130+
"sort-keys-fix/sort-keys-fix": [
131+
"error",
132+
"asc",
133133
{
134134
caseSensitive: false,
135135
natural: true,
136136
},
137137
],
138138
},
139139
settings: {
140-
'import/resolver': {
140+
"import/resolver": {
141141
typescript: {
142142
alwaysTryTypes: true,
143143
},
144144
},
145145
react: {
146-
version: 'detect',
146+
version: "detect",
147147
},
148148
},
149149
};

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.history/
22
build/
3+
dev-dist/
34
dist/
45
node_modules/
56
openshift/ods-deployments.json

capacitor.config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { CapacitorConfig } from '@capacitor/cli';
1+
import { CapacitorConfig } from "@capacitor/cli";
22

33
const config: CapacitorConfig = {
4-
appId: 'com.company.PROJECTID.COMPONENTID',
5-
appName: 'COMPONENTID',
4+
appId: "com.company.PROJECTID.COMPONENTID",
5+
appName: "COMPONENTID",
66
bundledWebRuntime: false,
7-
webDir: 'dist',
7+
webDir: "dist",
88
};
99

1010
export default config;

playwright-ct.config.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { devices, type PlaywrightTestConfig } from '@playwright/experimental-ct-react';
1+
import { devices, type PlaywrightTestConfig } from "@playwright/experimental-ct-react";
22

33
/**
44
* See https://playwright.dev/docs/test-configuration.
@@ -13,29 +13,29 @@ const config: PlaywrightTestConfig = {
1313
/* Configure projects for major browsers */
1414
projects: [
1515
{
16-
name: 'Desktop Chromium',
17-
use: devices['Desktop Chrome'],
16+
name: "Desktop Chromium",
17+
use: devices["Desktop Chrome"],
1818
},
1919
{
20-
name: 'Desktop Safari',
21-
use: devices['Desktop Safari'],
20+
name: "Desktop Safari",
21+
use: devices["Desktop Safari"],
2222
},
2323
{
24-
name: 'Desktop Firefox',
25-
use: devices['Desktop Firefox'],
24+
name: "Desktop Firefox",
25+
use: devices["Desktop Firefox"],
2626
},
2727
{
28-
name: 'Mobile Chrome',
29-
use: devices['Pixel 5'],
28+
name: "Mobile Chrome",
29+
use: devices["Pixel 5"],
3030
},
3131
{
32-
name: 'Mobile Safari',
33-
use: devices['iPhone 13 Pro'],
32+
name: "Mobile Safari",
33+
use: devices["iPhone 13 Pro"],
3434
},
3535
],
3636

3737
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
38-
reporter: process.env.CI ? [['junit', { outputFile: 'build/test-results/test/component-test-results.xml' }]] : 'list',
38+
reporter: process.env.CI ? [["junit", { outputFile: "build/test-results/test/component-test-results.xml" }]] : "list",
3939

4040
/**
4141
* Retry on CI only - Test that passes on a second retry is 'flaky'
@@ -44,9 +44,9 @@ const config: PlaywrightTestConfig = {
4444
retries: process.env.CI ? 2 : 0,
4545

4646
/* The base directory, relative to the config file, for snapshot files created with toMatchSnapshot and toHaveScreenshot. */
47-
snapshotDir: './__snapshots__',
47+
snapshotDir: "./__snapshots__",
4848

49-
testDir: './src',
49+
testDir: "./src",
5050

5151
/* Maximum time one test can run for (in milliseconds). */
5252
timeout: 20_000,
@@ -63,7 +63,7 @@ const config: PlaywrightTestConfig = {
6363
},
6464

6565
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
66-
trace: 'on-first-retry',
66+
trace: "on-first-retry",
6767
},
6868

6969
/* Opt out of parallel tests on CI. */

playwright/index.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
import { setupIonicReact } from '@ionic/react';
1+
import { setupIonicReact } from "@ionic/react";
22

33
/* Core CSS required for Ionic components to work properly */
4-
import '@ionic/react/css/core.css';
4+
import "@ionic/react/css/core.css";
55

66
/* Basic CSS for apps built with Ionic */
7-
import '@ionic/react/css/normalize.css';
8-
import '@ionic/react/css/structure.css';
9-
import '@ionic/react/css/typography.css';
7+
import "@ionic/react/css/normalize.css";
8+
import "@ionic/react/css/structure.css";
9+
import "@ionic/react/css/typography.css";
1010

1111
/* Optional CSS utils that can be commented out */
12-
import '@ionic/react/css/padding.css';
13-
import '@ionic/react/css/float-elements.css';
14-
import '@ionic/react/css/text-alignment.css';
15-
import '@ionic/react/css/text-transformation.css';
16-
import '@ionic/react/css/flex-utils.css';
17-
import '@ionic/react/css/display.css';
12+
import "@ionic/react/css/padding.css";
13+
import "@ionic/react/css/float-elements.css";
14+
import "@ionic/react/css/text-alignment.css";
15+
import "@ionic/react/css/text-transformation.css";
16+
import "@ionic/react/css/flex-utils.css";
17+
import "@ionic/react/css/display.css";
1818

1919
/* Styles */
20-
import '../src/theme/index.css';
20+
import "../src/theme/index.css";
2121

2222
setupIonicReact();

0 commit comments

Comments
 (0)