Skip to content

Commit

Permalink
update for latest wdio-electron-service
Browse files Browse the repository at this point in the history
  • Loading branch information
goosewobbler committed Feb 9, 2024
1 parent 3a40f8a commit e58e542
Show file tree
Hide file tree
Showing 9 changed files with 1,853 additions and 1,875 deletions.
72 changes: 0 additions & 72 deletions .eslintrc.json

This file was deleted.

106 changes: 106 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
const eslint = require('@eslint/js');
const ts = require('@typescript-eslint/eslint-plugin');
const tsParser = require('@typescript-eslint/parser');
const prettier = require('eslint-config-prettier');
const wdio = require('eslint-plugin-wdio');
const globals = require('globals');

module.exports = [
// Ignored dirs
{
ignores: ['**/dist/**/*'],
},
// All files
{
files: ['**/*.{js,mjs,ts}'],
languageOptions: {
ecmaVersion: 'latest',
globals: {
...globals.es2021,
},
},
rules: {
...eslint.configs.recommended.rules,
},
},
// Node & Electron main process files and scripts
{
files: ['**/*.{js,mjs,ts}'],
ignores: ['src/preload.ts', 'src/util.ts'],
languageOptions: {
globals: {
...globals.node,
},
},
},
// Electron renderer process files
{
files: ['example*/src/preload.ts', 'example*/src/util.ts'],
languageOptions: {
globals: {
...globals.browser,
},
},
},
// TS files
{
files: ['**/*.ts'],
languageOptions: {
parser: tsParser,
parserOptions: {
ecmaFeatures: { modules: true },
ecmaVersion: 'latest',
project: './tsconfig.json',
},
},
plugins: {
'@typescript-eslint': ts,
},
rules: {
...ts.configs['eslint-recommended'].rules,
...ts.configs.recommended.rules,
'no-undef': 'off', // redundant - TS will fail to compile with undefined vars
'no-redeclare': 'off', // redundant - TS will fail to compile with duplicate declarations
'@typescript-eslint/no-empty-interface': [
'error',
{
allowSingleExtends: true,
},
],
'@typescript-eslint/no-namespace': [
'error',
{
allowDeclarations: true,
},
],
'@typescript-eslint/no-unused-vars': [
'error',
{
args: 'after-used',
ignoreRestSiblings: true,
argsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
},
],
'@typescript-eslint/no-explicit-any': ['warn'],
},
},
// E2E TS files
{
files: ['test/*.spec.ts'],
languageOptions: {
globals: {
...wdio.configs.recommended.globals,
},
},
plugins: {
wdio,
},
rules: {
...wdio.configs.recommended.rules,
'@typescript-eslint/no-var-requires': 'off',
},
},
// ensure all rules work with prettier
prettier,
];
63 changes: 31 additions & 32 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,47 +10,46 @@
"format": "prettier --write \"**/*.{j,t}s\"",
"lint": "eslint \"**/*.{j,t}s\"",
"prepare": "husky install",
"test": "wdio run ./wdio.conf.js || (cat ./wdio-logs/wdio-0-0.log && cat ./wdio-logs/wdio-chromedriver.log && exit 1)"
"test": "wdio run ./wdio.conf.js"
},
"devDependencies": {
"@testing-library/dom": "^9.3.3",
"@testing-library/dom": "^9.3.4",
"@testing-library/webdriverio": "^3.2.1",
"@types/mocha": "^10.0.2",
"@types/node": "^20.8.0",
"@typescript-eslint/eslint-plugin": "^6.7.4",
"@typescript-eslint/parser": "^6.7.4",
"@wdio/cli": "^8.16.18",
"@wdio/local-runner": "^8.16.18",
"@wdio/mocha-framework": "^8.16.17",
"@types/mocha": "^10.0.6",
"@types/node": "^20.11.17",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"@wdio/cli": "^8.31.1",
"@wdio/globals": "^8.31.1",
"@wdio/local-runner": "^8.31.1",
"@wdio/mocha-framework": "^8.31.1",
"debug": "^4.3.4",
"electron": "^26.2.4",
"electron-builder": "^24.6.4",
"eslint": "^8.50.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-airbnb-typescript": "^17.1.0",
"eslint-config-prettier": "^9.0.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-jest": "^27.4.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-wdio": "^8.8.7",
"expect-webdriverio": "^4.4.0",
"global-jsdom": "^9.1.0",
"husky": "^8.0.3",
"jsdom": "^22.1.0",
"lint-staged": "^14.0.1",
"prettier": "^3.0.3",
"ts-node": "^10.9.1",
"typescript": "^5.2.2",
"wdio-electron-service": "file:../wdio-electron-service",
"webdriverio": "^8.16.18",
"webpack": "^5.88.2",
"electron": "^28.2.2",
"electron-builder": "^24.9.1",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-wdio": "^8.24.12",
"expect-webdriverio": "4.9.3",
"global-jsdom": "^24.0.0",
"husky": "^9.0.10",
"jsdom": "^24.0.0",
"lint-staged": "^15.2.2",
"prettier": "^3.2.5",
"ts-node": "^10.9.2",
"typescript": "^5.3.3",
"wdio-electron-service": "^6.2.0",
"webdriverio": "^8.31.1",
"webpack": "^5.90.1",
"webpack-cli": "^5.1.4"
},
"engines": {
"node": ">=16.0.0"
},
"pnpm": {
"overrides": {
"expect-webdriverio": "4.9.3"
}
},
"lint-staged": {
"**/*.{js,ts}": [
"eslint --fix"
Expand Down
Loading

0 comments on commit e58e542

Please sign in to comment.