-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update for latest wdio-electron-service
- Loading branch information
1 parent
3a40f8a
commit e58e542
Showing
9 changed files
with
1,853 additions
and
1,875 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.