chore: Update eslint to v9 with flat config (#1412)

* chore: Update eslint to v9 with flat config

* disable eslint for that whole example file. v1 not worth it imo

* update ts-eslint

* lock versions

* ci: update pnpm
pull/1409/head
Fabian-Lars 1 year ago committed by GitHub
parent c26b5cb9fd
commit c52978d7ca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1,4 +0,0 @@
target
node_modules
dist
dist-js

@ -1,20 +0,0 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"prettier",
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:security/recommended-legacy"
],
"overrides": [],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["@typescript-eslint"],
"rules": {}
}

@ -39,10 +39,10 @@ jobs:
${{ runner.os }}-
- uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
- uses: pnpm/action-setup@v2
with:
version: 7.x.x
version: 9.x.x
run_install: true
- name: audit
run: pnpm audit

@ -26,7 +26,7 @@ jobs:
- uses: pnpm/action-setup@v2
with:
version: 7.x.x
version: 9.x.x
run_install: true
- name: install webkit2gtk and libudev for [authenticator]

@ -42,10 +42,10 @@ jobs:
${{ runner.os }}-
- uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
- uses: pnpm/action-setup@v2
with:
version: 7.x.x
version: 9.x.x
run_install: true
- name: eslint
run: pnpm lint
@ -62,10 +62,10 @@ jobs:
${{ runner.os }}-
- uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
- uses: pnpm/action-setup@v2
with:
version: 7.x.x
version: 9.x.x
run_install: true
- name: prettier check
run: pnpm format-check

@ -30,11 +30,11 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
- uses: pnpm/action-setup@v2
with:
version: 7.x.x
version: 9.x.x
run_install: true
- name: Build packages

@ -0,0 +1,26 @@
import eslint from "@eslint/js";
import eslintConfigPrettier from "eslint-config-prettier";
import tseslint from "typescript-eslint";
export default tseslint.config(
{
ignores: [
"**/target",
"**/node_modules",
"**/dist",
"**/dist-js",
"**/rollup.config.mjs",
"**/vite.config.ts",
".scripts",
"eslint.config.js",
],
},
eslint.configs.recommended,
eslintConfigPrettier,
...tseslint.configs.recommendedTypeChecked,
{
languageOptions: {
parserOptions: { project: true, tsconfigRootDir: import.meta.dirname },
},
},
);

@ -10,28 +10,24 @@
"format-check": "prettier --check ."
},
"devDependencies": {
"@eslint/js": "9.4.0",
"@rollup/plugin-node-resolve": "15.2.3",
"@rollup/plugin-terser": "0.4.4",
"@rollup/plugin-typescript": "11.1.6",
"@typescript-eslint/eslint-plugin": "7.6.0",
"@typescript-eslint/parser": "7.6.0",
"eslint": "8.57.0",
"@types/eslint__js": "8.42.3",
"eslint": "9.4.0",
"eslint-config-prettier": "9.1.0",
"eslint-config-standard-with-typescript": "43.0.1",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-n": "17.2.1",
"eslint-plugin-promise": "6.1.1",
"eslint-plugin-security": "3.0.0",
"prettier": "3.2.5",
"rollup": "4.14.3",
"typescript": "5.4.5"
"prettier": "3.3.0",
"rollup": "4.18.0",
"typescript": "5.4.5",
"typescript-eslint": "rc-v8"
},
"resolutions": {
"semver": ">=7.5.2",
"optionator": ">=0.9.3"
},
"engines": {
"pnpm": ">=7.33.1"
"pnpm": "^9.0.0"
},
"pnpm": {
"auditConfig": {

@ -200,7 +200,7 @@ export async function attachLogger(fn: LoggerFn): Promise<UnlistenFn> {
// Strip ANSI escape codes
message = message.replace(
// TODO: Investigate security/detect-unsafe-regex
// eslint-disable-next-line no-control-regex, security/detect-unsafe-regex
// eslint-disable-next-line no-control-regex
/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,
"",
);

@ -18,7 +18,7 @@ async function listenToEventIfNeeded(event: string): Promise<void> {
// We're not awaiting this Promise to prevent issues with Promise.all
// the listener will still be registered in time.
appWindow.listen<ProgressPayload>(event, ({ payload }) => {
void appWindow.listen<ProgressPayload>(event, ({ payload }) => {
const handler = handlers.get(payload.id);
if (handler != null) {
handler(payload.progress, payload.total);

@ -1,3 +1,4 @@
/* eslint-disable */
import WebSocket from "tauri-plugin-websocket-api";
import "./style.css";

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save