Skip to content

Commit

Permalink
Fix linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
alexk111 committed Jun 27, 2024
1 parent 5bff7be commit 827cb35
Show file tree
Hide file tree
Showing 7 changed files with 107 additions and 70 deletions.
5 changes: 0 additions & 5 deletions .eslintignore

This file was deleted.

53 changes: 0 additions & 53 deletions .eslintrc

This file was deleted.

82 changes: 82 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
// @ts-check

import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';

export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended,
{
ignores: [
'node_modules/*',
'build/*',
'webpack.main.config.js',
'webpack.preload.config.js',
'webpack.renderer.config.js',
],
rules: {
quotes: ['error', 'single', {
avoidEscape: true,
}],

'no-unused-vars': 'off',

'@typescript-eslint/no-unused-vars': ['error', {
vars: 'all',
args: 'after-used',
ignoreRestSiblings: true,
argsIgnorePattern: '^_',
}],

'max-len': ['error', {
code: 160,
tabWidth: 2,
ignoreUrls: true,
ignoreComments: false,
ignoreRegExpLiterals: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
}],

'function-paren-newline': ['error', 'multiline-arguments'],

'comma-dangle': ['error', {
arrays: 'only-multiline',
objects: 'only-multiline',
imports: 'only-multiline',
exports: 'only-multiline',
functions: 'ignore',
}],

'comma-spacing': ['error', {
before: false,
after: true,
}],

'consistent-return': 'error',

'no-use-before-define': ['error', {
functions: true,
classes: true,
variables: true,
}],

'no-multi-spaces': 'error',

'new-cap': ['error', {
newIsCap: true,
newIsCapExceptions: [],
capIsNew: false,
capIsNewExceptions: [],
}],

'arrow-body-style': ['error', 'as-needed', {
requireReturnForObjectLiteral: false,
}],

curly: 'error',
'no-var': 'error',
eqeqeq: 'error',
},
}
);
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@
"draft-release": "yarn version && git push && git push --tags"
},
"devDependencies": {
"@eslint/js": "^9.5.0",
"@swc/core": "^1.6.5",
"@swc/jest": "^0.2.36",
"@testing-library/dom": "^10.2.0",
"@testing-library/jest-dom": "^6.4.6",
"@testing-library/react": "^16.0.0",
"@testing-library/user-event": "^14.5.2",
"@types/eslint__js": "^8.42.3",
"@types/jest": "^29.5.12",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@types/uuid": "^10.0.0",
"@typescript-eslint/eslint-plugin": "^7.14.1",
"@typescript-eslint/parser": "^7.14.1",
"concurrently": "^8.2.2",
"copyfiles": "^2.4.1",
"cross-env": "^7.0.3",
Expand Down Expand Up @@ -75,6 +75,7 @@
"tsconfig-paths-webpack-plugin": "^4.1.0",
"type-fest": "^4.20.1",
"typescript": "^5.5.2",
"typescript-eslint": "^7.14.1",
"typescript-plugin-css-modules": "^5.1.0",
"webpack": "^5.92.1",
"webpack-cli": "^5.1.4",
Expand Down
1 change: 0 additions & 1 deletion src/renderer/base/entityCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ export function mapEntityCollection<T extends Entity, Y extends Entity>(
): EntityCollection<Y> {
return Object.fromEntries(
Object.values(collection).map(entity => {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const newEntity = callbackFn(entity!);
return [newEntity.id, newEntity];
})
Expand Down
3 changes: 0 additions & 3 deletions src/renderer/widgets/webpage/widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,8 @@ function Webview({settings, widgetApi, onRequireRestart, env, id}: WebviewProps)
return <>
<webview
ref={webviewRef}
// eslint-disable-next-line react/no-unknown-property
allowpopups={'' as unknown as boolean}
// eslint-disable-next-line react/no-unknown-property
partition={initPartition.current}
// eslint-disable-next-line react/no-unknown-property
useragent={userAgent}
className={styles['webview']}
tabIndex={0} // this enables the tab-navigation to widget action bar
Expand Down
28 changes: 22 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@
minimatch "^3.1.2"
strip-json-comments "^3.1.1"

"@eslint/[email protected]":
"@eslint/[email protected]", "@eslint/js@^9.5.0":
version "9.5.0"
resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.5.0.tgz#0e9c24a670b8a5c86bff97b40be13d8d8f238045"
integrity sha512-A7+AOT2ICkodvtsWnxZP4Xxk3NbZ3VMHd8oihydLRGrJgqqdEz1qSeEgXYyT/Cu8h1TWWsQRejIx48mtjZ5y1w==
Expand Down Expand Up @@ -1057,6 +1057,13 @@
"@types/estree" "*"
"@types/json-schema" "*"

"@types/eslint__js@^8.42.3":
version "8.42.3"
resolved "https://registry.yarnpkg.com/@types/eslint__js/-/eslint__js-8.42.3.tgz#d1fa13e5c1be63a10b4e3afe992779f81c1179a0"
integrity sha512-alfG737uhmPdnvkrLdZLcEKJ/B8s9Y4hrZ+YAdzUeoArBlSUERA2E87ROfOaS4jd/C45fzOoZzidLc1IPwLqOw==
dependencies:
"@types/eslint" "*"

"@types/estree@*", "@types/estree@^1.0.5":
version "1.0.5"
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.5.tgz#a6ce3e556e00fd9895dd872dd172ad0d4bd687f4"
Expand Down Expand Up @@ -1336,7 +1343,7 @@
dependencies:
"@types/node" "*"

"@typescript-eslint/eslint-plugin@^7.14.1":
"@typescript-eslint/[email protected]":
version "7.14.1"
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.14.1.tgz#90e2f76a5930d553ede124e1f541a39b4417465e"
integrity sha512-aAJd6bIf2vvQRjUG3ZkNXkmBpN+J7Wd0mfQiiVCJMu9Z5GcZZdcc0j8XwN/BM97Fl7e3SkTXODSk4VehUv7CGw==
Expand All @@ -1351,7 +1358,7 @@
natural-compare "^1.4.0"
ts-api-utils "^1.3.0"

"@typescript-eslint/parser@^7.14.1":
"@typescript-eslint/[email protected]":
version "7.14.1"
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-7.14.1.tgz#13d97f357aed3c5719f259a6cc3d1a1f065d3692"
integrity sha512-8lKUOebNLcR0D7RvlcloOacTOWzOqemWEWkKSVpMZVF/XVcwjPR+3MD08QzbW9TCGJ+DwIc6zUSGZ9vd8cO1IA==
Expand Down Expand Up @@ -2311,9 +2318,9 @@ camelcase@^6.2.0:
integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==

caniuse-lite@^1.0.30001629:
version "1.0.30001637"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001637.tgz#d9fab531493d9ef46a8ff305e9812190ac463f21"
integrity sha512-1x0qRI1mD1o9e+7mBI7XtzFAP4XszbHaVWsMiGbSPLYekKTJF7K+FNk6AsXH4sUpc+qrsI3pVgf1Jdl/uGkuSQ==
version "1.0.30001638"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001638.tgz#598e1f0c2ac36f37ebc3f5b8887a32ca558e5d56"
integrity sha512-5SuJUJ7cZnhPpeLHaH0c/HPAnAHZvS6ElWyHK9GSIbVOQABLzowiI2pjmpvZ1WEbkyz46iFd4UXlOHR5SqgfMQ==

capture-stack-trace@^1.0.0:
version "1.0.2"
Expand Down Expand Up @@ -8518,6 +8525,15 @@ typedarray.prototype.slice@^1.0.3:
typed-array-buffer "^1.0.2"
typed-array-byte-offset "^1.0.2"

typescript-eslint@^7.14.1:
version "7.14.1"
resolved "https://registry.yarnpkg.com/typescript-eslint/-/typescript-eslint-7.14.1.tgz#5c1a7d758527321a120adbe9588baef8e5074300"
integrity sha512-Eo1X+Y0JgGPspcANKjeR6nIqXl4VL5ldXLc15k4m9upq+eY5fhU2IueiEZL6jmHrKH8aCfbIvM/v3IrX5Hg99w==
dependencies:
"@typescript-eslint/eslint-plugin" "7.14.1"
"@typescript-eslint/parser" "7.14.1"
"@typescript-eslint/utils" "7.14.1"

typescript-plugin-css-modules@^5.1.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/typescript-plugin-css-modules/-/typescript-plugin-css-modules-5.1.0.tgz#faa0ceffe8a8ffcbbc2f77ed637a64464195044a"
Expand Down

0 comments on commit 827cb35

Please sign in to comment.