From 33904d783edcd023c2d65afcef7ca85f0589e120 Mon Sep 17 00:00:00 2001 From: wuls Date: Tue, 19 Nov 2024 14:09:26 +0800 Subject: [PATCH 01/20] feat: let eslint-plugin-qwink support Eslint 9 and 8 simultaneously --- packages/eslint-plugin-qwik/package.json | 10 +++--- packages/eslint-plugin-qwik/qwik.unit.ts | 32 ++++++++++--------- .../eslint-plugin-qwik/tests/tsconfig.json | 6 ++-- .../invalid-capture-class.tsx | 2 +- .../invalid-capture-function-event.tsx | 2 +- .../invalid-capture-function.tsx | 4 +-- .../invalid-capture-symbol.tsx | 2 +- .../valid-lexical-scope/invalid-mutable.tsx | 2 +- .../invalid-use-method-factory.tsx | 2 +- .../invalid-use-method-inline.tsx | 4 +-- .../valid-capture-jsxoutput.tsx | 2 +- .../valid-lexical-scope/valid-constant.tsx | 2 +- .../valid-no-serialize.tsx | 2 +- .../valid-use-method-factory.tsx | 2 +- .../valid-use-task-getter.tsx | 2 +- .../valid-lexical-scope/valid-use-task.tsx | 2 +- 16 files changed, 40 insertions(+), 38 deletions(-) diff --git a/packages/eslint-plugin-qwik/package.json b/packages/eslint-plugin-qwik/package.json index 263fe1a99f9..a253f9f2e6a 100644 --- a/packages/eslint-plugin-qwik/package.json +++ b/packages/eslint-plugin-qwik/package.json @@ -5,15 +5,15 @@ "author": "Builder Team", "bugs": "https://github.com/QwikDev/qwik/issues", "dependencies": { - "jsx-ast-utils": "^3.3.5", - "@typescript-eslint/utils": "^8.12.2" + "@typescript-eslint/utils": "^8.12.2", + "jsx-ast-utils": "^3.3.5" }, "devDependencies": { "@builder.io/qwik": "workspace:^", "@builder.io/qwik-city": "workspace:^", - "@types/eslint": "8.56.10", + "@types/eslint": "9.6.1", "@types/estree": "1.0.5", - "@typescript-eslint/rule-tester": "7.8.0", + "@typescript-eslint/rule-tester": "8.14.0", "redent": "4.0.0" }, "engines": { @@ -32,7 +32,7 @@ "license": "MIT", "main": "dist/index.js", "peerDependencies": { - "eslint": "^8.57.0" + "eslint": "9.15.0" }, "repository": { "type": "git", diff --git a/packages/eslint-plugin-qwik/qwik.unit.ts b/packages/eslint-plugin-qwik/qwik.unit.ts index c411512174a..d2609dc6411 100644 --- a/packages/eslint-plugin-qwik/qwik.unit.ts +++ b/packages/eslint-plugin-qwik/qwik.unit.ts @@ -1,11 +1,11 @@ import * as vitest from 'vitest'; // @ts-ignore -import { RuleTester } from '@typescript-eslint/rule-tester'; - +import { RuleTester, type RuleTesterConfig } from '@typescript-eslint/rule-tester'; import { fileURLToPath } from 'node:url'; import { rules } from './index'; import { readdir, readFile, stat } from 'node:fs/promises'; import { join, dirname } from 'path'; +// import {plugin, parser} from 'typescript-eslint' // https://typescript-eslint.io/packages/rule-tester/#vitest RuleTester.afterAll = vitest.afterAll; @@ -14,22 +14,24 @@ RuleTester.itOnly = vitest.it.only; RuleTester.describe = vitest.describe; const testConfig = { - parser: '@typescript-eslint/parser', - env: { - es6: true, - }, - parserOptions: { - tsconfigRootDir: fileURLToPath(new URL('.', import.meta.url)), - project: ['./tests/tsconfig.json'], - ecmaFeatures: { - jsx: true, + languageOptions: { + parserOptions: { + projectService: { + allowDefaultProject: ['*.ts*'], + }, + sourceType: 'module', + ecmaFeatures: { + jsx: true, + }, + + ecmaVersion: 2024, + project: ['./tests/tsconfig.json'], + tsconfigRootDir: fileURLToPath(new URL('.', import.meta.url)), }, - ecmaVersion: 2020, - sourceType: 'module', }, -}; +} as RuleTesterConfig; -const ruleTester = new RuleTester(testConfig as any); +const ruleTester = new RuleTester(testConfig); interface TestCase { name: string; filename: string; diff --git a/packages/eslint-plugin-qwik/tests/tsconfig.json b/packages/eslint-plugin-qwik/tests/tsconfig.json index 8982e2d060b..2198df838b3 100644 --- a/packages/eslint-plugin-qwik/tests/tsconfig.json +++ b/packages/eslint-plugin-qwik/tests/tsconfig.json @@ -1,9 +1,9 @@ { "compilerOptions": { "incremental": true, - "target": "ES2020", - "module": "ES2020", - "lib": ["es2020", "DOM"], + "target": "ESNext", + "module": "ESNext", + "lib": ["ESNext", "DOM"], "resolveJsonModule": true, "jsx": "react-jsx", "jsxImportSource": "@builder.io/qwik", diff --git a/packages/eslint-plugin-qwik/tests/valid-lexical-scope/invalid-capture-class.tsx b/packages/eslint-plugin-qwik/tests/valid-lexical-scope/invalid-capture-class.tsx index 6f67d31fe43..5d5af6e8a7f 100644 --- a/packages/eslint-plugin-qwik/tests/valid-lexical-scope/invalid-capture-class.tsx +++ b/packages/eslint-plugin-qwik/tests/valid-lexical-scope/invalid-capture-class.tsx @@ -5,7 +5,7 @@ export const HelloWorld = component$(() => { class Stuff {} const stuff = new Stuff(); useTask$(() => { - // eslint-disable-next-line no-console + /* eslint no-console: [, { allow: ["log"] }] */ console.log(stuff); }); return
; diff --git a/packages/eslint-plugin-qwik/tests/valid-lexical-scope/invalid-capture-function-event.tsx b/packages/eslint-plugin-qwik/tests/valid-lexical-scope/invalid-capture-function-event.tsx index 340be012372..1be3e26ab2d 100644 --- a/packages/eslint-plugin-qwik/tests/valid-lexical-scope/invalid-capture-function-event.tsx +++ b/packages/eslint-plugin-qwik/tests/valid-lexical-scope/invalid-capture-function-event.tsx @@ -1,7 +1,7 @@ // Expect error: { "messageId": "invalidJsxDollar" } import { component$, useTask$ } from '@builder.io/qwik'; export const HelloWorld = component$(() => { - // eslint-disable-next-line no-console + /* eslint no-console: [, { allow: ["log"] }] */ const click = () => console.log(); return ; }); diff --git a/packages/eslint-plugin-qwik/tests/valid-lexical-scope/invalid-capture-function.tsx b/packages/eslint-plugin-qwik/tests/valid-lexical-scope/invalid-capture-function.tsx index 0e9b23bd7ad..5571d9509d8 100644 --- a/packages/eslint-plugin-qwik/tests/valid-lexical-scope/invalid-capture-function.tsx +++ b/packages/eslint-plugin-qwik/tests/valid-lexical-scope/invalid-capture-function.tsx @@ -6,14 +6,14 @@ export const HelloWorld = component$(() => { return 'string'; } else { return () => { - // eslint-disable-next-line no-console + /* eslint no-console: [, { allow: ["log"] }] */ console.log(); }; } } const a = getValue(); useTask$(() => { - // eslint-disable-next-line no-console + /* eslint no-console: [, { allow: ["log"] }] */ console.log(a); }); return
; diff --git a/packages/eslint-plugin-qwik/tests/valid-lexical-scope/invalid-capture-symbol.tsx b/packages/eslint-plugin-qwik/tests/valid-lexical-scope/invalid-capture-symbol.tsx index 77701b1afc9..f4399b57c05 100644 --- a/packages/eslint-plugin-qwik/tests/valid-lexical-scope/invalid-capture-symbol.tsx +++ b/packages/eslint-plugin-qwik/tests/valid-lexical-scope/invalid-capture-symbol.tsx @@ -4,7 +4,7 @@ import { component$, useTask$ } from '@builder.io/qwik'; export const HelloWorld = component$(() => { const a = Symbol(); useTask$(() => { - // eslint-disable-next-line no-console + /* eslint no-console: [, { allow: ["log"] }] */ console.log(a); }); return
; diff --git a/packages/eslint-plugin-qwik/tests/valid-lexical-scope/invalid-mutable.tsx b/packages/eslint-plugin-qwik/tests/valid-lexical-scope/invalid-mutable.tsx index 9d0ec62670b..ab19d294c47 100644 --- a/packages/eslint-plugin-qwik/tests/valid-lexical-scope/invalid-mutable.tsx +++ b/packages/eslint-plugin-qwik/tests/valid-lexical-scope/invalid-mutable.tsx @@ -6,7 +6,7 @@ export const HelloWorld = component$(() => { const divRef = useSignal<{ offsetLeft: number }>(); const handleMouseDown = $((e: MouseEvent) => { - // eslint-disable-next-line no-console + /* eslint no-console: [, { allow: ["log"] }] */ console.log('working'); startX = e.pageX - divRef.value!.offsetLeft; }); diff --git a/packages/eslint-plugin-qwik/tests/valid-lexical-scope/invalid-use-method-factory.tsx b/packages/eslint-plugin-qwik/tests/valid-lexical-scope/invalid-use-method-factory.tsx index be80bb381a9..d81fbeceb12 100644 --- a/packages/eslint-plugin-qwik/tests/valid-lexical-scope/invalid-use-method-factory.tsx +++ b/packages/eslint-plugin-qwik/tests/valid-lexical-scope/invalid-use-method-factory.tsx @@ -7,7 +7,7 @@ export const HelloWorld = component$(() => { }; const useMethod = getMethod(); useTask$(() => { - // eslint-disable-next-line no-console + /* eslint no-console: [, { allow: ["log"] }] */ console.log(useMethod); }); return
; diff --git a/packages/eslint-plugin-qwik/tests/valid-lexical-scope/invalid-use-method-inline.tsx b/packages/eslint-plugin-qwik/tests/valid-lexical-scope/invalid-use-method-inline.tsx index 549e3bcc8d8..38f7a7015b1 100644 --- a/packages/eslint-plugin-qwik/tests/valid-lexical-scope/invalid-use-method-inline.tsx +++ b/packages/eslint-plugin-qwik/tests/valid-lexical-scope/invalid-use-method-inline.tsx @@ -3,11 +3,11 @@ import { component$, useTask$ } from '@builder.io/qwik'; export const HelloWorld = component$(() => { function useMethod() { - // eslint-disable-next-line no-console + /* eslint no-console: [, { allow: ["log"] }] */ console.log('stuff'); } useTask$(() => { - // eslint-disable-next-line no-console + /* eslint no-console: [, { allow: ["log"] }] */ console.log(useMethod); }); return
; diff --git a/packages/eslint-plugin-qwik/tests/valid-lexical-scope/valid-capture-jsxoutput.tsx b/packages/eslint-plugin-qwik/tests/valid-lexical-scope/valid-capture-jsxoutput.tsx index f7bccc4c7f0..6fa20dbd74b 100644 --- a/packages/eslint-plugin-qwik/tests/valid-lexical-scope/valid-capture-jsxoutput.tsx +++ b/packages/eslint-plugin-qwik/tests/valid-lexical-scope/valid-capture-jsxoutput.tsx @@ -9,7 +9,7 @@ export default component$(() => { state.foo =
Foo
; useTask$(() => { - // eslint-disable-next-line no-console + /* eslint no-console: [, { allow: ["log"] }] */ console.log(state.foo); }); return <>; diff --git a/packages/eslint-plugin-qwik/tests/valid-lexical-scope/valid-constant.tsx b/packages/eslint-plugin-qwik/tests/valid-lexical-scope/valid-constant.tsx index b0a1d65f975..d582d61e0fc 100644 --- a/packages/eslint-plugin-qwik/tests/valid-lexical-scope/valid-constant.tsx +++ b/packages/eslint-plugin-qwik/tests/valid-lexical-scope/valid-constant.tsx @@ -7,7 +7,7 @@ export const HelloWorld = component$(() => { return (
{ - // eslint-disable-next-line no-console + /* eslint no-console: [, { allow: ["log"] }] */ console.log(a); }} >
diff --git a/packages/eslint-plugin-qwik/tests/valid-lexical-scope/valid-no-serialize.tsx b/packages/eslint-plugin-qwik/tests/valid-lexical-scope/valid-no-serialize.tsx index e595fe1d800..61f5d8f5483 100644 --- a/packages/eslint-plugin-qwik/tests/valid-lexical-scope/valid-no-serialize.tsx +++ b/packages/eslint-plugin-qwik/tests/valid-lexical-scope/valid-no-serialize.tsx @@ -10,7 +10,7 @@ export function getFn(): NoSerialize<() => void> { export const HelloWorld = component$(() => { const state: Value = { value: 12, fn: getFn() }; useTask$(() => { - // eslint-disable-next-line no-console + /* eslint no-console: [, { allow: ["log"] }] */ console.log(state.value); }); return
; diff --git a/packages/eslint-plugin-qwik/tests/valid-lexical-scope/valid-use-method-factory.tsx b/packages/eslint-plugin-qwik/tests/valid-lexical-scope/valid-use-method-factory.tsx index c01a5ec4957..9e13c458bbd 100644 --- a/packages/eslint-plugin-qwik/tests/valid-lexical-scope/valid-use-method-factory.tsx +++ b/packages/eslint-plugin-qwik/tests/valid-lexical-scope/valid-use-method-factory.tsx @@ -19,7 +19,7 @@ export const HelloWorld = component$(() => { }, }; useTask$(() => { - // eslint-disable-next-line no-console + /* eslint no-console: [, { allow: ["log"] }] */ console.log(useMethod, obj); }); return
; diff --git a/packages/eslint-plugin-qwik/tests/valid-lexical-scope/valid-use-task-getter.tsx b/packages/eslint-plugin-qwik/tests/valid-lexical-scope/valid-use-task-getter.tsx index f1cff2f4413..8407bd36f3c 100644 --- a/packages/eslint-plugin-qwik/tests/valid-lexical-scope/valid-use-task-getter.tsx +++ b/packages/eslint-plugin-qwik/tests/valid-lexical-scope/valid-use-task-getter.tsx @@ -5,7 +5,7 @@ export const HelloWorld = component$(() => { } const a = getValue(); useTask$(() => { - // eslint-disable-next-line no-console + /* eslint no-console: [, { allow: ["log"] }] */ console.log(a); }); return
; diff --git a/packages/eslint-plugin-qwik/tests/valid-lexical-scope/valid-use-task.tsx b/packages/eslint-plugin-qwik/tests/valid-lexical-scope/valid-use-task.tsx index 1449e707e7b..ff7aa58e94d 100644 --- a/packages/eslint-plugin-qwik/tests/valid-lexical-scope/valid-use-task.tsx +++ b/packages/eslint-plugin-qwik/tests/valid-lexical-scope/valid-use-task.tsx @@ -6,7 +6,7 @@ export const HelloWorld = component$(() => { }; const useMethod = getMethod(); useTask$(() => { - // eslint-disable-next-line no-console + /* eslint no-console: [, { allow: ["log"] }] */ console.log(useMethod); }); return
; From 93f850eb05662ccf202ff278a03647efbd1c0042 Mon Sep 17 00:00:00 2001 From: wuls Date: Tue, 19 Nov 2024 14:10:15 +0800 Subject: [PATCH 02/20] feat: let eslint-plugin-qwink support Eslint 9 and 8 simultaneously --- .changeset/breezy-toes-help.md | 5 + pnpm-lock.yaml | 164 +++++++++++++++++++-------------- 2 files changed, 102 insertions(+), 67 deletions(-) create mode 100644 .changeset/breezy-toes-help.md diff --git a/.changeset/breezy-toes-help.md b/.changeset/breezy-toes-help.md new file mode 100644 index 00000000000..8c456168014 --- /dev/null +++ b/.changeset/breezy-toes-help.md @@ -0,0 +1,5 @@ +--- +'eslint-plugin-qwik': major +--- + +let eslint-plugin-qwink support Eslint 9 and 8 simultaneously diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f4c828f5ec1..00e6c503722 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -438,14 +438,14 @@ importers: specifier: workspace:^ version: link:../qwik-city '@types/eslint': - specifier: 8.56.10 - version: 8.56.10 + specifier: 9.6.1 + version: 9.6.1 '@types/estree': specifier: 1.0.5 version: 1.0.5 '@typescript-eslint/rule-tester': - specifier: 7.8.0 - version: 7.8.0(@eslint/eslintrc@3.1.0)(eslint@8.57.0)(typescript@5.4.5) + specifier: 8.14.0 + version: 8.14.0(eslint@8.57.0)(typescript@5.4.5) redent: specifier: 4.0.0 version: 4.0.0 @@ -2419,67 +2419,79 @@ packages: resolution: {integrity: sha512-9B+taZ8DlyyqzZQnoeIvDVR/2F4EbMepXMc/NdVbkzsJbzkUjhXv/70GQJ7tdLA4YJgNP25zukcxpX2/SueNrA==} cpu: [arm64] os: [linux] + libc: [glibc] '@img/sharp-libvips-linux-arm@1.0.5': resolution: {integrity: sha512-gvcC4ACAOPRNATg/ov8/MnbxFDJqf/pDePbBnuBDcjsI8PssmjoKMAz4LtLaVi+OnSb5FK/yIOamqDwGmXW32g==} cpu: [arm] os: [linux] + libc: [glibc] '@img/sharp-libvips-linux-s390x@1.0.4': resolution: {integrity: sha512-u7Wz6ntiSSgGSGcjZ55im6uvTrOxSIS8/dgoVMoiGE9I6JAfU50yH5BoDlYA1tcuGS7g/QNtetJnxA6QEsCVTA==} cpu: [s390x] os: [linux] + libc: [glibc] '@img/sharp-libvips-linux-x64@1.0.4': resolution: {integrity: sha512-MmWmQ3iPFZr0Iev+BAgVMb3ZyC4KeFc3jFxnNbEPas60e1cIfevbtuyf9nDGIzOaW9PdnDciJm+wFFaTlj5xYw==} cpu: [x64] os: [linux] + libc: [glibc] '@img/sharp-libvips-linuxmusl-arm64@1.0.4': resolution: {integrity: sha512-9Ti+BbTYDcsbp4wfYib8Ctm1ilkugkA/uscUn6UXK1ldpC1JjiXbLfFZtRlBhjPZ5o1NCLiDbg8fhUPKStHoTA==} cpu: [arm64] os: [linux] + libc: [musl] '@img/sharp-libvips-linuxmusl-x64@1.0.4': resolution: {integrity: sha512-viYN1KX9m+/hGkJtvYYp+CCLgnJXwiQB39damAO7WMdKWlIhmYTfHjwSbQeUK/20vY154mwezd9HflVFM1wVSw==} cpu: [x64] os: [linux] + libc: [musl] '@img/sharp-linux-arm64@0.33.5': resolution: {integrity: sha512-JMVv+AMRyGOHtO1RFBiJy/MBsgz0x4AWrT6QoEVVTyh1E39TrCUpTRI7mx9VksGX4awWASxqCYLCV4wBZHAYxA==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [arm64] os: [linux] + libc: [glibc] '@img/sharp-linux-arm@0.33.5': resolution: {integrity: sha512-JTS1eldqZbJxjvKaAkxhZmBqPRGmxgu+qFKSInv8moZ2AmT5Yib3EQ1c6gp493HvrvV8QgdOXdyaIBrhvFhBMQ==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [arm] os: [linux] + libc: [glibc] '@img/sharp-linux-s390x@0.33.5': resolution: {integrity: sha512-y/5PCd+mP4CA/sPDKl2961b+C9d+vPAveS33s6Z3zfASk2j5upL6fXVPZi7ztePZ5CuH+1kW8JtvxgbuXHRa4Q==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [s390x] os: [linux] + libc: [glibc] '@img/sharp-linux-x64@0.33.5': resolution: {integrity: sha512-opC+Ok5pRNAzuvq1AG0ar+1owsu842/Ab+4qvU879ippJBHvyY5n2mxF1izXqkPYlGuP/M556uh53jRLJmzTWA==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [x64] os: [linux] + libc: [glibc] '@img/sharp-linuxmusl-arm64@0.33.5': resolution: {integrity: sha512-XrHMZwGQGvJg2V/oRSUfSAfjfPxO+4DkiRh6p2AFjLQztWUuY/o8Mq0eMQVIY7HJ1CDQUJlxGGZRw1a5bqmd1g==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [arm64] os: [linux] + libc: [musl] '@img/sharp-linuxmusl-x64@0.33.5': resolution: {integrity: sha512-WT+d/cgqKkkKySYmqoZ8y3pxx7lx9vVejxW/W4DOFMYVSkErR+w7mf2u8m/y4+xHe7yY9DAXQMWQhpnMuFfScw==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [x64] os: [linux] + libc: [musl] '@img/sharp-wasm32@0.33.5': resolution: {integrity: sha512-ykUW4LVGaMcU9lu9thv85CbRMAwfeadCJHRsg2GmeRa/cJxsVY9Rbd57JcMxBkKHag5U/x7TSBpScF4U8ElVzg==} @@ -3049,30 +3061,35 @@ packages: engines: {node: '>= 10.0.0'} cpu: [arm] os: [linux] + libc: [glibc] '@parcel/watcher-linux-arm64-glibc@2.4.1': resolution: {integrity: sha512-BJ7mH985OADVLpbrzCLgrJ3TOpiZggE9FMblfO65PlOCdG++xJpKUJ0Aol74ZUIYfb8WsRlUdgrZxKkz3zXWYA==} engines: {node: '>= 10.0.0'} cpu: [arm64] os: [linux] + libc: [glibc] '@parcel/watcher-linux-arm64-musl@2.4.1': resolution: {integrity: sha512-p4Xb7JGq3MLgAfYhslU2SjoV9G0kI0Xry0kuxeG/41UfpjHGOhv7UoUDAz/jb1u2elbhazy4rRBL8PegPJFBhA==} engines: {node: '>= 10.0.0'} cpu: [arm64] os: [linux] + libc: [musl] '@parcel/watcher-linux-x64-glibc@2.4.1': resolution: {integrity: sha512-s9O3fByZ/2pyYDPoLM6zt92yu6P4E39a03zvO0qCHOTjxmt3GHRMLuRZEWhWLASTMSrrnVNWdVI/+pUElJBBBg==} engines: {node: '>= 10.0.0'} cpu: [x64] os: [linux] + libc: [glibc] '@parcel/watcher-linux-x64-musl@2.4.1': resolution: {integrity: sha512-L2nZTYR1myLNST0O632g0Dx9LyMNHrn6TOt76sYxWLdff3cB22/GZX2UPtJnaqQPdCRoszoY5rcOj4oMTtp5fQ==} engines: {node: '>= 10.0.0'} cpu: [x64] os: [linux] + libc: [musl] '@parcel/watcher-wasm@2.4.0': resolution: {integrity: sha512-MNgQ4WCbBybqQ97KwR/hqJGYTg3+s8qHpgIyFWB2qJOBvoJWbXuJGmm4ZkPLq2bMaANqCZqrXwmKYagZTkMKZA==} @@ -3177,46 +3194,55 @@ packages: resolution: {integrity: sha512-2Rn36Ubxdv32NUcfm0wB1tgKqkQuft00PtM23VqLuCUR4N5jcNWDoV5iBC9jeGdgS38WK66ElncprqgMUOyomw==} cpu: [arm] os: [linux] + libc: [glibc] '@rollup/rollup-linux-arm-musleabihf@4.19.0': resolution: {integrity: sha512-gJuzIVdq/X1ZA2bHeCGCISe0VWqCoNT8BvkQ+BfsixXwTOndhtLUpOg0A1Fcx/+eA6ei6rMBzlOz4JzmiDw7JQ==} cpu: [arm] os: [linux] + libc: [musl] '@rollup/rollup-linux-arm64-gnu@4.19.0': resolution: {integrity: sha512-0EkX2HYPkSADo9cfeGFoQ7R0/wTKb7q6DdwI4Yn/ULFE1wuRRCHybxpl2goQrx4c/yzK3I8OlgtBu4xvted0ug==} cpu: [arm64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-arm64-musl@4.19.0': resolution: {integrity: sha512-GlIQRj9px52ISomIOEUq/IojLZqzkvRpdP3cLgIE1wUWaiU5Takwlzpz002q0Nxxr1y2ZgxC2obWxjr13lvxNQ==} cpu: [arm64] os: [linux] + libc: [musl] '@rollup/rollup-linux-powerpc64le-gnu@4.19.0': resolution: {integrity: sha512-N6cFJzssruDLUOKfEKeovCKiHcdwVYOT1Hs6dovDQ61+Y9n3Ek4zXvtghPPelt6U0AH4aDGnDLb83uiJMkWYzQ==} cpu: [ppc64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-riscv64-gnu@4.19.0': resolution: {integrity: sha512-2DnD3mkS2uuam/alF+I7M84koGwvn3ZVD7uG+LEWpyzo/bq8+kKnus2EVCkcvh6PlNB8QPNFOz6fWd5N8o1CYg==} cpu: [riscv64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-s390x-gnu@4.19.0': resolution: {integrity: sha512-D6pkaF7OpE7lzlTOFCB2m3Ngzu2ykw40Nka9WmKGUOTS3xcIieHe82slQlNq69sVB04ch73thKYIWz/Ian8DUA==} cpu: [s390x] os: [linux] + libc: [glibc] '@rollup/rollup-linux-x64-gnu@4.19.0': resolution: {integrity: sha512-HBndjQLP8OsdJNSxpNIN0einbDmRFg9+UQeZV1eiYupIRuZsDEoeGU43NQsS34Pp166DtwQOnpcbV/zQxM+rWA==} cpu: [x64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-x64-musl@4.19.0': resolution: {integrity: sha512-HxfbvfCKJe/RMYJJn0a12eiOI9OOtAUF4G6ozrFUK95BNyoJaSiBjIOHjZskTUffUrB84IPKkFG9H9nEvJGW6A==} cpu: [x64] os: [linux] + libc: [musl] '@rollup/rollup-win32-arm64-msvc@4.19.0': resolution: {integrity: sha512-HxDMKIhmcguGTiP5TsLNolwBUK3nGGUEoV/BO9ldUBoMLBssvh4J0X8pf11i1fTV7WShWItB1bKAKjX4RQeYmg==} @@ -3391,6 +3417,9 @@ packages: '@types/eslint@8.56.10': resolution: {integrity: sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ==} + '@types/eslint@9.6.1': + resolution: {integrity: sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==} + '@types/estree-jsx@1.0.5': resolution: {integrity: sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg==} @@ -3571,25 +3600,24 @@ packages: typescript: optional: true - '@typescript-eslint/rule-tester@7.8.0': - resolution: {integrity: sha512-f1wXWeZx8XJB/z9Oyjx0ZLmhvcFelSJ0CVvOurCkrISOZhre+imIj5FQQz1rBy/Ips0dCbVl5G4MWTuzlzj5QQ==} - engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/rule-tester@8.14.0': + resolution: {integrity: sha512-q5Gi0CMFLojXZMvdWTIjOcBtV3qUg2xtUJocBxkd6PZ5YfHw9bd/Q+P5vtBu1Mrjs8OhId5WpOaMqjbUXLLBYA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - '@eslint/eslintrc': '>=2' - eslint: ^8.56.0 + eslint: ^8.57.0 || ^9.0.0 '@typescript-eslint/scope-manager@7.16.1': resolution: {integrity: sha512-nYpyv6ALte18gbMz323RM+vpFpTjfNdyakbf3nsLvF43uF9KeNC289SUEW3QLZ1xPtyINJ1dIsZOuWuSRIWygw==} engines: {node: ^18.18.0 || >=20.0.0} - '@typescript-eslint/scope-manager@7.8.0': - resolution: {integrity: sha512-viEmZ1LmwsGcnr85gIq+FCYI7nO90DVbE37/ll51hjv9aG+YZMb4WDE2fyWpUR4O/UrhGRpYXK/XajcGTk2B8g==} - engines: {node: ^18.18.0 || >=20.0.0} - '@typescript-eslint/scope-manager@8.12.2': resolution: {integrity: sha512-gPLpLtrj9aMHOvxJkSbDBmbRuYdtiEbnvO25bCMza3DhMjTQw0u7Y1M+YR5JPbMsXXnSPuCf5hfq0nEkQDL/JQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@typescript-eslint/scope-manager@8.14.0': + resolution: {integrity: sha512-aBbBrnW9ARIDn92Zbo7rguLnqQ/pOrUguVpbUwzOhkFg2npFDwTgPGqFqE0H5feXcOoJOfX3SxlJaKEVtq54dw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@typescript-eslint/type-utils@7.16.1': resolution: {integrity: sha512-rbu/H2MWXN4SkjIIyWcmYBjlp55VT+1G3duFOIukTNFxr9PI35pLc2ydwAfejCEitCv4uztA07q0QWanOHC7dA==} engines: {node: ^18.18.0 || >=20.0.0} @@ -3608,14 +3636,14 @@ packages: resolution: {integrity: sha512-AQn9XqCzUXd4bAVEsAXM/Izk11Wx2u4H3BAfQVhSfzfDOm/wAON9nP7J5rpkCxts7E5TELmN845xTUCQrD1xIQ==} engines: {node: ^18.18.0 || >=20.0.0} - '@typescript-eslint/types@7.8.0': - resolution: {integrity: sha512-wf0peJ+ZGlcH+2ZS23aJbOv+ztjeeP8uQ9GgwMJGVLx/Nj9CJt17GWgWWoSmoRVKAX2X+7fzEnAjxdvK2gqCLw==} - engines: {node: ^18.18.0 || >=20.0.0} - '@typescript-eslint/types@8.12.2': resolution: {integrity: sha512-VwDwMF1SZ7wPBUZwmMdnDJ6sIFk4K4s+ALKLP6aIQsISkPv8jhiw65sAK6SuWODN/ix+m+HgbYDkH+zLjrzvOA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@typescript-eslint/types@8.14.0': + resolution: {integrity: sha512-yjeB9fnO/opvLJFAsPNYlKPnEM8+z4og09Pk504dkqonT02AyL5Z9SSqlE0XqezS93v6CXn49VHvB2G7XSsl0g==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@typescript-eslint/typescript-estree@5.62.0': resolution: {integrity: sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -3634,17 +3662,17 @@ packages: typescript: optional: true - '@typescript-eslint/typescript-estree@7.8.0': - resolution: {integrity: sha512-5pfUCOwK5yjPaJQNy44prjCwtr981dO8Qo9J9PwYXZ0MosgAbfEMB008dJ5sNo3+/BN6ytBPuSvXUg9SAqB0dg==} - engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/typescript-estree@8.12.2': + resolution: {integrity: sha512-mME5MDwGe30Pq9zKPvyduyU86PH7aixwqYR2grTglAdB+AN8xXQ1vFGpYaUSJ5o5P/5znsSBeNcs5g5/2aQwow==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '*' peerDependenciesMeta: typescript: optional: true - '@typescript-eslint/typescript-estree@8.12.2': - resolution: {integrity: sha512-mME5MDwGe30Pq9zKPvyduyU86PH7aixwqYR2grTglAdB+AN8xXQ1vFGpYaUSJ5o5P/5znsSBeNcs5g5/2aQwow==} + '@typescript-eslint/typescript-estree@8.14.0': + resolution: {integrity: sha512-OPXPLYKGZi9XS/49rdaCbR5j/S14HazviBlUQFvSKz3npr3NikF+mrgK7CFVur6XEt95DZp/cmke9d5i3vtVnQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '*' @@ -3658,18 +3686,18 @@ packages: peerDependencies: eslint: ^8.56.0 - '@typescript-eslint/utils@7.8.0': - resolution: {integrity: sha512-L0yFqOCflVqXxiZyXrDr80lnahQfSOfc9ELAAZ75sqicqp2i36kEZZGuUymHNFoYOqxRT05up760b4iGsl02nQ==} - engines: {node: ^18.18.0 || >=20.0.0} - peerDependencies: - eslint: ^8.56.0 - '@typescript-eslint/utils@8.12.2': resolution: {integrity: sha512-UTTuDIX3fkfAz6iSVa5rTuSfWIYZ6ATtEocQ/umkRSyC9O919lbZ8dcH7mysshrCdrAM03skJOEYaBugxN+M6A==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 + '@typescript-eslint/utils@8.14.0': + resolution: {integrity: sha512-OGqj6uB8THhrHj0Fk27DcHPojW7zKwKkPmHXHvQ58pLYp4hy8CSUdTKykKeh+5vFqTTVmjz0zCOOPKRovdsgHA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 + '@typescript-eslint/visitor-keys@5.62.0': resolution: {integrity: sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -3678,14 +3706,14 @@ packages: resolution: {integrity: sha512-Qlzzx4sE4u3FsHTPQAAQFJFNOuqtuY0LFrZHwQ8IHK705XxBiWOFkfKRWu6niB7hwfgnwIpO4jTC75ozW1PHWg==} engines: {node: ^18.18.0 || >=20.0.0} - '@typescript-eslint/visitor-keys@7.8.0': - resolution: {integrity: sha512-q4/gibTNBQNA0lGyYQCmWRS5D15n8rXh4QjK3KV+MBPlTYHpfBUT3D3PaPR/HeNiI9W6R7FvlkcGhNyAoP+caA==} - engines: {node: ^18.18.0 || >=20.0.0} - '@typescript-eslint/visitor-keys@8.12.2': resolution: {integrity: sha512-PChz8UaKQAVNHghsHcPyx1OMHoFRUEA7rJSK/mDhdq85bk+PLsUHUBqTQTFt18VJZbmxBovM65fezlheQRsSDA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@typescript-eslint/visitor-keys@8.14.0': + resolution: {integrity: sha512-vG0XZo8AdTH9OE6VFRwAZldNc7qtJ/6NLGWak+BtENuEUXGZgFpihILPiBvKXvJ2nFu27XNGC6rKiwuaoMbYzQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@typescript/analyze-trace@0.10.1': resolution: {integrity: sha512-RnlSOPh14QbopGCApgkSx5UBgGda5MX1cHqp2fsqfiDyCwGL/m1jaeB9fzu7didVS81LQqGZZuxFBcg8YU8EVw==} hasBin: true @@ -12543,6 +12571,11 @@ snapshots: '@types/estree': 1.0.5 '@types/json-schema': 7.0.15 + '@types/eslint@9.6.1': + dependencies: + '@types/estree': 1.0.5 + '@types/json-schema': 7.0.15 + '@types/estree-jsx@1.0.5': dependencies: '@types/estree': 1.0.5 @@ -12747,13 +12780,13 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/rule-tester@7.8.0(@eslint/eslintrc@3.1.0)(eslint@8.57.0)(typescript@5.4.5)': + '@typescript-eslint/rule-tester@8.14.0(eslint@8.57.0)(typescript@5.4.5)': dependencies: - '@eslint/eslintrc': 3.1.0 - '@typescript-eslint/typescript-estree': 7.8.0(typescript@5.4.5) - '@typescript-eslint/utils': 7.8.0(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/typescript-estree': 8.14.0(typescript@5.4.5) + '@typescript-eslint/utils': 8.14.0(eslint@8.57.0)(typescript@5.4.5) ajv: 6.12.6 eslint: 8.57.0 + json-stable-stringify-without-jsonify: 1.0.1 lodash.merge: 4.6.2 semver: 7.6.3 transitivePeerDependencies: @@ -12765,16 +12798,16 @@ snapshots: '@typescript-eslint/types': 7.16.1 '@typescript-eslint/visitor-keys': 7.16.1 - '@typescript-eslint/scope-manager@7.8.0': - dependencies: - '@typescript-eslint/types': 7.8.0 - '@typescript-eslint/visitor-keys': 7.8.0 - '@typescript-eslint/scope-manager@8.12.2': dependencies: '@typescript-eslint/types': 8.12.2 '@typescript-eslint/visitor-keys': 8.12.2 + '@typescript-eslint/scope-manager@8.14.0': + dependencies: + '@typescript-eslint/types': 8.14.0 + '@typescript-eslint/visitor-keys': 8.14.0 + '@typescript-eslint/type-utils@7.16.1(eslint@8.57.0)(typescript@5.4.5)': dependencies: '@typescript-eslint/typescript-estree': 7.16.1(typescript@5.4.5) @@ -12791,10 +12824,10 @@ snapshots: '@typescript-eslint/types@7.16.1': {} - '@typescript-eslint/types@7.8.0': {} - '@typescript-eslint/types@8.12.2': {} + '@typescript-eslint/types@8.14.0': {} + '@typescript-eslint/typescript-estree@5.62.0(supports-color@9.4.0)(typescript@5.4.5)': dependencies: '@typescript-eslint/types': 5.62.0 @@ -12816,20 +12849,20 @@ snapshots: debug: 4.3.7(supports-color@9.4.0) globby: 11.1.0 is-glob: 4.0.3 - minimatch: 9.0.4 + minimatch: 9.0.5 semver: 7.6.3 - ts-api-utils: 1.3.0(typescript@5.4.5) + ts-api-utils: 1.4.0(typescript@5.4.5) optionalDependencies: typescript: 5.4.5 transitivePeerDependencies: - supports-color - '@typescript-eslint/typescript-estree@7.8.0(typescript@5.4.5)': + '@typescript-eslint/typescript-estree@8.12.2(typescript@5.4.5)': dependencies: - '@typescript-eslint/types': 7.8.0 - '@typescript-eslint/visitor-keys': 7.8.0 + '@typescript-eslint/types': 8.12.2 + '@typescript-eslint/visitor-keys': 8.12.2 debug: 4.3.7(supports-color@9.4.0) - globby: 11.1.0 + fast-glob: 3.3.2 is-glob: 4.0.3 minimatch: 9.0.5 semver: 7.6.3 @@ -12839,10 +12872,10 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/typescript-estree@8.12.2(typescript@5.4.5)': + '@typescript-eslint/typescript-estree@8.14.0(typescript@5.4.5)': dependencies: - '@typescript-eslint/types': 8.12.2 - '@typescript-eslint/visitor-keys': 8.12.2 + '@typescript-eslint/types': 8.14.0 + '@typescript-eslint/visitor-keys': 8.14.0 debug: 4.3.7(supports-color@9.4.0) fast-glob: 3.3.2 is-glob: 4.0.3 @@ -12865,26 +12898,23 @@ snapshots: - supports-color - typescript - '@typescript-eslint/utils@7.8.0(eslint@8.57.0)(typescript@5.4.5)': + '@typescript-eslint/utils@8.12.2(eslint@8.57.0)(typescript@5.4.5)': dependencies: '@eslint-community/eslint-utils': 4.4.1(eslint@8.57.0) - '@types/json-schema': 7.0.15 - '@types/semver': 7.5.8 - '@typescript-eslint/scope-manager': 7.8.0 - '@typescript-eslint/types': 7.8.0 - '@typescript-eslint/typescript-estree': 7.8.0(typescript@5.4.5) + '@typescript-eslint/scope-manager': 8.12.2 + '@typescript-eslint/types': 8.12.2 + '@typescript-eslint/typescript-estree': 8.12.2(typescript@5.4.5) eslint: 8.57.0 - semver: 7.6.3 transitivePeerDependencies: - supports-color - typescript - '@typescript-eslint/utils@8.12.2(eslint@8.57.0)(typescript@5.4.5)': + '@typescript-eslint/utils@8.14.0(eslint@8.57.0)(typescript@5.4.5)': dependencies: '@eslint-community/eslint-utils': 4.4.1(eslint@8.57.0) - '@typescript-eslint/scope-manager': 8.12.2 - '@typescript-eslint/types': 8.12.2 - '@typescript-eslint/typescript-estree': 8.12.2(typescript@5.4.5) + '@typescript-eslint/scope-manager': 8.14.0 + '@typescript-eslint/types': 8.14.0 + '@typescript-eslint/typescript-estree': 8.14.0(typescript@5.4.5) eslint: 8.57.0 transitivePeerDependencies: - supports-color @@ -12900,14 +12930,14 @@ snapshots: '@typescript-eslint/types': 7.16.1 eslint-visitor-keys: 3.4.3 - '@typescript-eslint/visitor-keys@7.8.0': + '@typescript-eslint/visitor-keys@8.12.2': dependencies: - '@typescript-eslint/types': 7.8.0 + '@typescript-eslint/types': 8.12.2 eslint-visitor-keys: 3.4.3 - '@typescript-eslint/visitor-keys@8.12.2': + '@typescript-eslint/visitor-keys@8.14.0': dependencies: - '@typescript-eslint/types': 8.12.2 + '@typescript-eslint/types': 8.14.0 eslint-visitor-keys: 3.4.3 '@typescript/analyze-trace@0.10.1': From efb017d3b4e34b87142bd4991e2a47f1d7910cb6 Mon Sep 17 00:00:00 2001 From: wuls Date: Fri, 22 Nov 2024 13:56:00 +0800 Subject: [PATCH 03/20] support 8 and 9 --- package.json | 2 +- packages/eslint-plugin-qwik/index.ts | 89 +++++++++++++++++++--------- packages/qwik-labs/package.json | 4 +- packages/qwik/package.json | 2 +- 4 files changed, 66 insertions(+), 31 deletions(-) diff --git a/package.json b/package.json index b7cb4027e30..9b50675e322 100644 --- a/package.json +++ b/package.json @@ -242,10 +242,10 @@ "start": "concurrently \"npm:build.watch\" \"npm:tsc.watch\" -n build,tsc -c green,cyan", "test": "pnpm build.full && pnpm test.unit && pnpm test.e2e", "test.e2e": "pnpm test.e2e.chromium && pnpm test.e2e.webkit", - "test.e2e.cli": "pnpm --filter qwik-cli-e2e e2e", "test.e2e.chromium": "playwright test starters --browser=chromium --config starters/playwright.config.ts", "test.e2e.chromium.debug": "PWDEBUG=1 playwright test starters --browser=chromium --config starters/playwright.config.ts", "test.e2e.city": "playwright test starters/e2e/qwikcity --browser=chromium --config starters/playwright.config.ts", + "test.e2e.cli": "pnpm --filter qwik-cli-e2e e2e", "test.e2e.firefox": "playwright test starters --browser=firefox --config starters/playwright.config.ts", "test.e2e.webkit": "playwright test starters --browser=webkit --config starters/playwright.config.ts", "test.rust": "make test", diff --git a/packages/eslint-plugin-qwik/index.ts b/packages/eslint-plugin-qwik/index.ts index 158da4a1315..b7ef964f241 100644 --- a/packages/eslint-plugin-qwik/index.ts +++ b/packages/eslint-plugin-qwik/index.ts @@ -9,6 +9,7 @@ import { preferClasslist } from './src/preferClasslist'; import { unusedServer } from './src/unusedServer'; import { useMethodUsage } from './src/useMethodUsage'; import { validLexicalScope } from './src/validLexicalScope'; +import fs from 'fs'; export const rules = { 'use-method-usage': useMethodUsage, @@ -24,37 +25,71 @@ export const rules = { 'no-use-visible-task': noUseVisibleTask, }; -export const configs = { +const recommendedRules = { + 'qwik/use-method-usage': 'error', + 'qwik/valid-lexical-scope': 'error', + 'qwik/no-react-props': 'error', + 'qwik/prefer-classlist': 'warn', + 'qwik/jsx-no-script-url': 'warn', + 'qwik/loader-location': 'warn', + 'qwik/jsx-key': 'warn', + 'qwik/unused-server': 'error', + 'qwik/jsx-img': 'warn', + 'qwik/jsx-a': 'warn', + 'qwik/no-use-visible-task': 'warn', +}; +const strictRules = { + 'qwik/valid-lexical-scope': 'error', + 'qwik/use-method-usage': 'error', + 'qwik/loader-location': 'error', + 'qwik/no-react-props': 'error', + 'qwik/prefer-classlist': 'error', + 'qwik/jsx-no-script-url': 'error', + 'qwik/jsx-key': 'error', + 'qwik/unused-server': 'error', + 'qwik/jsx-img': 'error', + 'qwik/jsx-a': 'error', + 'qwik/no-use-visible-task': 'warn', +}; +const configs = { recommended: { plugins: ['qwik'], - rules: { - 'qwik/use-method-usage': 'error', - 'qwik/valid-lexical-scope': 'error', - 'qwik/no-react-props': 'error', - 'qwik/prefer-classlist': 'warn', - 'qwik/jsx-no-script-url': 'warn', - 'qwik/loader-location': 'warn', - 'qwik/jsx-key': 'warn', - 'qwik/unused-server': 'error', - 'qwik/jsx-img': 'warn', - 'qwik/jsx-a': 'warn', - 'qwik/no-use-visible-task': 'warn', - }, + rules: recommendedRules, }, strict: { plugins: ['qwik'], - rules: { - 'qwik/valid-lexical-scope': 'error', - 'qwik/use-method-usage': 'error', - 'qwik/loader-location': 'error', - 'qwik/no-react-props': 'error', - 'qwik/prefer-classlist': 'error', - 'qwik/jsx-no-script-url': 'error', - 'qwik/jsx-key': 'error', - 'qwik/unused-server': 'error', - 'qwik/jsx-img': 'error', - 'qwik/jsx-a': 'error', - 'qwik/no-use-visible-task': 'warn', - }, + rules: strictRules, + }, +}; + +const pkg = JSON.parse(fs.readFileSync(new URL('./package.json', import.meta.url), 'utf8')); + +const qwikEslintPlugin = { + configs: {}, + meta: { + name: pkg.name, + version: pkg.version, }, + rules, }; + +Object.assign(qwikEslintPlugin.configs, { + recommended: [ + { + plugins: { + qwik: qwikEslintPlugin, + }, + rules: recommendedRules, + }, + ], + strict: [ + { + plugins: { + qwik: qwikEslintPlugin, + }, + rules: strictRules, + }, + ], +}); + +export { configs, qwikEslintPlugin as default }; diff --git a/packages/qwik-labs/package.json b/packages/qwik-labs/package.json index c66608d5148..a303bac3504 100644 --- a/packages/qwik-labs/package.json +++ b/packages/qwik-labs/package.json @@ -38,8 +38,8 @@ ], "main": "./lib/index.qwik.mjs", "peerDependencies": { - "zod": "3.22.4", - "vite": "^5" + "vite": "^5", + "zod": "3.22.4" }, "private": true, "qwik": "./lib/index.qwik.mjs", diff --git a/packages/qwik/package.json b/packages/qwik/package.json index 13514913ce6..2c4a473afff 100644 --- a/packages/qwik/package.json +++ b/packages/qwik/package.json @@ -30,9 +30,9 @@ "devDependencies": { "@builder.io/qwik": "workspace:^", "@builder.io/qwik-dom": "workspace:^", + "ignore": "5.3.1", "image-size": "1.1.1", "kleur": "4.1.5", - "ignore": "5.3.1", "ts-morph": "23.0.0" }, "engines": { From 5c0723e78265427a74e2a44624f3ed8d54ac9307 Mon Sep 17 00:00:00 2001 From: wuls Date: Fri, 22 Nov 2024 14:04:05 +0800 Subject: [PATCH 04/20] upgrade --- package.json | 2 +- packages/insights/package.json | 2 +- packages/qwik-labs/package.json | 2 +- pnpm-lock.yaml | 20 ++++++-------------- 4 files changed, 9 insertions(+), 17 deletions(-) diff --git a/package.json b/package.json index cfa7e05465d..d5468c5c298 100644 --- a/package.json +++ b/package.json @@ -114,7 +114,7 @@ "@types/brotli": "1.3.4", "@types/bun": "1.1.6", "@types/cross-spawn": "6.0.6", - "@types/eslint": "8.56.10", + "@types/eslint": "9.6.1", "@types/express": "4.17.21", "@types/node": "20.14.11", "@types/path-browserify": "1.0.2", diff --git a/packages/insights/package.json b/packages/insights/package.json index f8fcc3b11dd..359638442f5 100644 --- a/packages/insights/package.json +++ b/packages/insights/package.json @@ -20,7 +20,7 @@ "@builder.io/vite-plugin-macro": "0.0.7", "@netlify/edge-functions": "2.10.0", "@types/density-clustering": "1.3.3", - "@types/eslint": "8.56.10", + "@types/eslint": "9.6.1", "@types/node": "20.14.11", "@typescript-eslint/eslint-plugin": "7.16.1", "@typescript-eslint/parser": "7.16.1", diff --git a/packages/qwik-labs/package.json b/packages/qwik-labs/package.json index a303bac3504..1c9d7dd6f91 100644 --- a/packages/qwik-labs/package.json +++ b/packages/qwik-labs/package.json @@ -4,7 +4,7 @@ "version": "0.0.1", "devDependencies": { "@builder.io/qwik": "workspace:^", - "@types/eslint": "8.56.10", + "@types/eslint": "9.6.1", "@types/node": "20.14.11", "@typescript-eslint/eslint-plugin": "7.16.1", "@typescript-eslint/parser": "7.16.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 00e6c503722..82e47cb88cb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -80,8 +80,8 @@ importers: specifier: 6.0.6 version: 6.0.6 '@types/eslint': - specifier: 8.56.10 - version: 8.56.10 + specifier: 9.6.1 + version: 9.6.1 '@types/express': specifier: 4.17.21 version: 4.17.21 @@ -499,8 +499,8 @@ importers: specifier: 1.3.3 version: 1.3.3 '@types/eslint': - specifier: 8.56.10 - version: 8.56.10 + specifier: 9.6.1 + version: 9.6.1 '@types/node': specifier: 20.14.11 version: 20.14.11 @@ -720,8 +720,8 @@ importers: specifier: workspace:^ version: link:../qwik '@types/eslint': - specifier: 8.56.10 - version: 8.56.10 + specifier: 9.6.1 + version: 9.6.1 '@types/node': specifier: 20.14.11 version: 20.14.11 @@ -3414,9 +3414,6 @@ packages: '@types/density-clustering@1.3.3': resolution: {integrity: sha512-p2zEz57kHxWVg39XZ9QQVW6ity4rC3/1cCeLqm2eqqomvOrf8CFYaw7jO8gdYuchO4532ak0Z0f/vBr9irwG/w==} - '@types/eslint@8.56.10': - resolution: {integrity: sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ==} - '@types/eslint@9.6.1': resolution: {integrity: sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==} @@ -12566,11 +12563,6 @@ snapshots: '@types/density-clustering@1.3.3': {} - '@types/eslint@8.56.10': - dependencies: - '@types/estree': 1.0.5 - '@types/json-schema': 7.0.15 - '@types/eslint@9.6.1': dependencies: '@types/estree': 1.0.5 From 0738804b6d9c57323bff38a090697ad8457eda3e Mon Sep 17 00:00:00 2001 From: wuls Date: Fri, 22 Nov 2024 14:26:18 +0800 Subject: [PATCH 05/20] upgrade --- packages/eslint-plugin-qwik/index.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/eslint-plugin-qwik/index.ts b/packages/eslint-plugin-qwik/index.ts index b7ef964f241..3f0a7d37ebf 100644 --- a/packages/eslint-plugin-qwik/index.ts +++ b/packages/eslint-plugin-qwik/index.ts @@ -1,3 +1,4 @@ +import path from 'path'; import { jsxAtag } from './src/jsxAtag'; import { jsxImg } from './src/jsxImg'; import { jsxKey } from './src/jsxKey'; @@ -9,7 +10,7 @@ import { preferClasslist } from './src/preferClasslist'; import { unusedServer } from './src/unusedServer'; import { useMethodUsage } from './src/useMethodUsage'; import { validLexicalScope } from './src/validLexicalScope'; -import fs from 'fs'; +import pkg from './package.json'; export const rules = { 'use-method-usage': useMethodUsage, @@ -51,7 +52,7 @@ const strictRules = { 'qwik/jsx-a': 'error', 'qwik/no-use-visible-task': 'warn', }; -const configs = { +export const configs = { recommended: { plugins: ['qwik'], rules: recommendedRules, @@ -62,8 +63,6 @@ const configs = { }, }; -const pkg = JSON.parse(fs.readFileSync(new URL('./package.json', import.meta.url), 'utf8')); - const qwikEslintPlugin = { configs: {}, meta: { @@ -92,4 +91,4 @@ Object.assign(qwikEslintPlugin.configs, { ], }); -export { configs, qwikEslintPlugin as default }; +// export { configs, qwikEslintPlugin as default }; From 5ed62c5e467c25f75e18a5482ce5b346572efdf9 Mon Sep 17 00:00:00 2001 From: wuls Date: Fri, 22 Nov 2024 14:40:44 +0800 Subject: [PATCH 06/20] upgrade --- package.json | 2 +- packages/eslint-plugin-qwik/index.ts | 8 +++--- packages/eslint-plugin-qwik/package.json | 4 +-- packages/insights/package.json | 2 +- packages/qwik-labs/package.json | 2 +- .../src/optimizer/src/qwik-binding-map.ts | 28 ------------------- pnpm-lock.yaml | 21 ++++++-------- 7 files changed, 18 insertions(+), 49 deletions(-) diff --git a/package.json b/package.json index d5468c5c298..cfa7e05465d 100644 --- a/package.json +++ b/package.json @@ -114,7 +114,7 @@ "@types/brotli": "1.3.4", "@types/bun": "1.1.6", "@types/cross-spawn": "6.0.6", - "@types/eslint": "9.6.1", + "@types/eslint": "8.56.10", "@types/express": "4.17.21", "@types/node": "20.14.11", "@types/path-browserify": "1.0.2", diff --git a/packages/eslint-plugin-qwik/index.ts b/packages/eslint-plugin-qwik/index.ts index 3f0a7d37ebf..d9d3882077f 100644 --- a/packages/eslint-plugin-qwik/index.ts +++ b/packages/eslint-plugin-qwik/index.ts @@ -1,4 +1,3 @@ -import path from 'path'; import { jsxAtag } from './src/jsxAtag'; import { jsxImg } from './src/jsxImg'; import { jsxKey } from './src/jsxKey'; @@ -12,7 +11,7 @@ import { useMethodUsage } from './src/useMethodUsage'; import { validLexicalScope } from './src/validLexicalScope'; import pkg from './package.json'; -export const rules = { +const rules = { 'use-method-usage': useMethodUsage, 'valid-lexical-scope': validLexicalScope, 'loader-location': loaderLocation, @@ -52,7 +51,8 @@ const strictRules = { 'qwik/jsx-a': 'error', 'qwik/no-use-visible-task': 'warn', }; -export const configs = { + +const configs = { recommended: { plugins: ['qwik'], rules: recommendedRules, @@ -91,4 +91,4 @@ Object.assign(qwikEslintPlugin.configs, { ], }); -// export { configs, qwikEslintPlugin as default }; +export { configs, qwikEslintPlugin as default }; diff --git a/packages/eslint-plugin-qwik/package.json b/packages/eslint-plugin-qwik/package.json index a253f9f2e6a..f2ad42672e5 100644 --- a/packages/eslint-plugin-qwik/package.json +++ b/packages/eslint-plugin-qwik/package.json @@ -11,7 +11,6 @@ "devDependencies": { "@builder.io/qwik": "workspace:^", "@builder.io/qwik-city": "workspace:^", - "@types/eslint": "9.6.1", "@types/estree": "1.0.5", "@typescript-eslint/rule-tester": "8.14.0", "redent": "4.0.0" @@ -32,7 +31,8 @@ "license": "MIT", "main": "dist/index.js", "peerDependencies": { - "eslint": "9.15.0" + "eslint": "9.15.0", + "@types/eslint": "9.6.1" }, "repository": { "type": "git", diff --git a/packages/insights/package.json b/packages/insights/package.json index 359638442f5..f8fcc3b11dd 100644 --- a/packages/insights/package.json +++ b/packages/insights/package.json @@ -20,7 +20,7 @@ "@builder.io/vite-plugin-macro": "0.0.7", "@netlify/edge-functions": "2.10.0", "@types/density-clustering": "1.3.3", - "@types/eslint": "9.6.1", + "@types/eslint": "8.56.10", "@types/node": "20.14.11", "@typescript-eslint/eslint-plugin": "7.16.1", "@typescript-eslint/parser": "7.16.1", diff --git a/packages/qwik-labs/package.json b/packages/qwik-labs/package.json index 1c9d7dd6f91..a303bac3504 100644 --- a/packages/qwik-labs/package.json +++ b/packages/qwik-labs/package.json @@ -4,7 +4,7 @@ "version": "0.0.1", "devDependencies": { "@builder.io/qwik": "workspace:^", - "@types/eslint": "9.6.1", + "@types/eslint": "8.56.10", "@types/node": "20.14.11", "@typescript-eslint/eslint-plugin": "7.16.1", "@typescript-eslint/parser": "7.16.1", diff --git a/packages/qwik/src/optimizer/src/qwik-binding-map.ts b/packages/qwik/src/optimizer/src/qwik-binding-map.ts index cceeb273668..6fd723f7147 100644 --- a/packages/qwik/src/optimizer/src/qwik-binding-map.ts +++ b/packages/qwik/src/optimizer/src/qwik-binding-map.ts @@ -4,14 +4,6 @@ // prettier-ignore export const QWIK_BINDING_MAP = { "darwin": { - "arm64": [ - { - "platform": "darwin", - "arch": "arm64", - "abi": null, - "platformArchABI": "qwik.darwin-arm64.node" - } - ], "x64": [ { "platform": "darwin", @@ -20,25 +12,5 @@ export const QWIK_BINDING_MAP = { "platformArchABI": "qwik.darwin-x64.node" } ] - }, - "win32": { - "x64": [ - { - "platform": "win32", - "arch": "x64", - "abi": "msvc", - "platformArchABI": "qwik.win32-x64-msvc.node" - } - ] - }, - "linux": { - "x64": [ - { - "platform": "linux", - "arch": "x64", - "abi": "gnu", - "platformArchABI": "qwik.linux-x64-gnu.node" - } - ] } }; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 82e47cb88cb..01c014b0a9a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -80,8 +80,8 @@ importers: specifier: 6.0.6 version: 6.0.6 '@types/eslint': - specifier: 9.6.1 - version: 9.6.1 + specifier: 8.56.10 + version: 8.56.10 '@types/express': specifier: 4.17.21 version: 4.17.21 @@ -437,9 +437,6 @@ importers: '@builder.io/qwik-city': specifier: workspace:^ version: link:../qwik-city - '@types/eslint': - specifier: 9.6.1 - version: 9.6.1 '@types/estree': specifier: 1.0.5 version: 1.0.5 @@ -499,8 +496,8 @@ importers: specifier: 1.3.3 version: 1.3.3 '@types/eslint': - specifier: 9.6.1 - version: 9.6.1 + specifier: 8.56.10 + version: 8.56.10 '@types/node': specifier: 20.14.11 version: 20.14.11 @@ -720,8 +717,8 @@ importers: specifier: workspace:^ version: link:../qwik '@types/eslint': - specifier: 9.6.1 - version: 9.6.1 + specifier: 8.56.10 + version: 8.56.10 '@types/node': specifier: 20.14.11 version: 20.14.11 @@ -3414,8 +3411,8 @@ packages: '@types/density-clustering@1.3.3': resolution: {integrity: sha512-p2zEz57kHxWVg39XZ9QQVW6ity4rC3/1cCeLqm2eqqomvOrf8CFYaw7jO8gdYuchO4532ak0Z0f/vBr9irwG/w==} - '@types/eslint@9.6.1': - resolution: {integrity: sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==} + '@types/eslint@8.56.10': + resolution: {integrity: sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ==} '@types/estree-jsx@1.0.5': resolution: {integrity: sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg==} @@ -12563,7 +12560,7 @@ snapshots: '@types/density-clustering@1.3.3': {} - '@types/eslint@9.6.1': + '@types/eslint@8.56.10': dependencies: '@types/estree': 1.0.5 '@types/json-schema': 7.0.15 From 35ccf8398e3aced7407a22862cd67352afed4d18 Mon Sep 17 00:00:00 2001 From: wuls Date: Fri, 22 Nov 2024 14:42:23 +0800 Subject: [PATCH 07/20] upgrade --- package.json | 2 +- packages/eslint-plugin-qwik/index.ts | 8 ++++---- packages/eslint-plugin-qwik/package.json | 4 ++-- packages/insights/package.json | 2 +- packages/qwik-labs/package.json | 2 +- pnpm-lock.yaml | 21 +++++++++------------ 6 files changed, 18 insertions(+), 21 deletions(-) diff --git a/package.json b/package.json index d5468c5c298..cfa7e05465d 100644 --- a/package.json +++ b/package.json @@ -114,7 +114,7 @@ "@types/brotli": "1.3.4", "@types/bun": "1.1.6", "@types/cross-spawn": "6.0.6", - "@types/eslint": "9.6.1", + "@types/eslint": "8.56.10", "@types/express": "4.17.21", "@types/node": "20.14.11", "@types/path-browserify": "1.0.2", diff --git a/packages/eslint-plugin-qwik/index.ts b/packages/eslint-plugin-qwik/index.ts index 3f0a7d37ebf..d9d3882077f 100644 --- a/packages/eslint-plugin-qwik/index.ts +++ b/packages/eslint-plugin-qwik/index.ts @@ -1,4 +1,3 @@ -import path from 'path'; import { jsxAtag } from './src/jsxAtag'; import { jsxImg } from './src/jsxImg'; import { jsxKey } from './src/jsxKey'; @@ -12,7 +11,7 @@ import { useMethodUsage } from './src/useMethodUsage'; import { validLexicalScope } from './src/validLexicalScope'; import pkg from './package.json'; -export const rules = { +const rules = { 'use-method-usage': useMethodUsage, 'valid-lexical-scope': validLexicalScope, 'loader-location': loaderLocation, @@ -52,7 +51,8 @@ const strictRules = { 'qwik/jsx-a': 'error', 'qwik/no-use-visible-task': 'warn', }; -export const configs = { + +const configs = { recommended: { plugins: ['qwik'], rules: recommendedRules, @@ -91,4 +91,4 @@ Object.assign(qwikEslintPlugin.configs, { ], }); -// export { configs, qwikEslintPlugin as default }; +export { configs, qwikEslintPlugin as default }; diff --git a/packages/eslint-plugin-qwik/package.json b/packages/eslint-plugin-qwik/package.json index a253f9f2e6a..f2ad42672e5 100644 --- a/packages/eslint-plugin-qwik/package.json +++ b/packages/eslint-plugin-qwik/package.json @@ -11,7 +11,6 @@ "devDependencies": { "@builder.io/qwik": "workspace:^", "@builder.io/qwik-city": "workspace:^", - "@types/eslint": "9.6.1", "@types/estree": "1.0.5", "@typescript-eslint/rule-tester": "8.14.0", "redent": "4.0.0" @@ -32,7 +31,8 @@ "license": "MIT", "main": "dist/index.js", "peerDependencies": { - "eslint": "9.15.0" + "eslint": "9.15.0", + "@types/eslint": "9.6.1" }, "repository": { "type": "git", diff --git a/packages/insights/package.json b/packages/insights/package.json index 359638442f5..f8fcc3b11dd 100644 --- a/packages/insights/package.json +++ b/packages/insights/package.json @@ -20,7 +20,7 @@ "@builder.io/vite-plugin-macro": "0.0.7", "@netlify/edge-functions": "2.10.0", "@types/density-clustering": "1.3.3", - "@types/eslint": "9.6.1", + "@types/eslint": "8.56.10", "@types/node": "20.14.11", "@typescript-eslint/eslint-plugin": "7.16.1", "@typescript-eslint/parser": "7.16.1", diff --git a/packages/qwik-labs/package.json b/packages/qwik-labs/package.json index 1c9d7dd6f91..a303bac3504 100644 --- a/packages/qwik-labs/package.json +++ b/packages/qwik-labs/package.json @@ -4,7 +4,7 @@ "version": "0.0.1", "devDependencies": { "@builder.io/qwik": "workspace:^", - "@types/eslint": "9.6.1", + "@types/eslint": "8.56.10", "@types/node": "20.14.11", "@typescript-eslint/eslint-plugin": "7.16.1", "@typescript-eslint/parser": "7.16.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 82e47cb88cb..01c014b0a9a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -80,8 +80,8 @@ importers: specifier: 6.0.6 version: 6.0.6 '@types/eslint': - specifier: 9.6.1 - version: 9.6.1 + specifier: 8.56.10 + version: 8.56.10 '@types/express': specifier: 4.17.21 version: 4.17.21 @@ -437,9 +437,6 @@ importers: '@builder.io/qwik-city': specifier: workspace:^ version: link:../qwik-city - '@types/eslint': - specifier: 9.6.1 - version: 9.6.1 '@types/estree': specifier: 1.0.5 version: 1.0.5 @@ -499,8 +496,8 @@ importers: specifier: 1.3.3 version: 1.3.3 '@types/eslint': - specifier: 9.6.1 - version: 9.6.1 + specifier: 8.56.10 + version: 8.56.10 '@types/node': specifier: 20.14.11 version: 20.14.11 @@ -720,8 +717,8 @@ importers: specifier: workspace:^ version: link:../qwik '@types/eslint': - specifier: 9.6.1 - version: 9.6.1 + specifier: 8.56.10 + version: 8.56.10 '@types/node': specifier: 20.14.11 version: 20.14.11 @@ -3414,8 +3411,8 @@ packages: '@types/density-clustering@1.3.3': resolution: {integrity: sha512-p2zEz57kHxWVg39XZ9QQVW6ity4rC3/1cCeLqm2eqqomvOrf8CFYaw7jO8gdYuchO4532ak0Z0f/vBr9irwG/w==} - '@types/eslint@9.6.1': - resolution: {integrity: sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==} + '@types/eslint@8.56.10': + resolution: {integrity: sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ==} '@types/estree-jsx@1.0.5': resolution: {integrity: sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg==} @@ -12563,7 +12560,7 @@ snapshots: '@types/density-clustering@1.3.3': {} - '@types/eslint@9.6.1': + '@types/eslint@8.56.10': dependencies: '@types/estree': 1.0.5 '@types/json-schema': 7.0.15 From fc3aa5330f9c86d9861eb5d7324aa47a05047b07 Mon Sep 17 00:00:00 2001 From: Jerry_wu <409187100@qq.com> Date: Fri, 22 Nov 2024 14:48:03 +0800 Subject: [PATCH 08/20] Update qwik-binding-map.ts --- .../src/optimizer/src/qwik-binding-map.ts | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/packages/qwik/src/optimizer/src/qwik-binding-map.ts b/packages/qwik/src/optimizer/src/qwik-binding-map.ts index 6fd723f7147..cceeb273668 100644 --- a/packages/qwik/src/optimizer/src/qwik-binding-map.ts +++ b/packages/qwik/src/optimizer/src/qwik-binding-map.ts @@ -4,6 +4,14 @@ // prettier-ignore export const QWIK_BINDING_MAP = { "darwin": { + "arm64": [ + { + "platform": "darwin", + "arch": "arm64", + "abi": null, + "platformArchABI": "qwik.darwin-arm64.node" + } + ], "x64": [ { "platform": "darwin", @@ -12,5 +20,25 @@ export const QWIK_BINDING_MAP = { "platformArchABI": "qwik.darwin-x64.node" } ] + }, + "win32": { + "x64": [ + { + "platform": "win32", + "arch": "x64", + "abi": "msvc", + "platformArchABI": "qwik.win32-x64-msvc.node" + } + ] + }, + "linux": { + "x64": [ + { + "platform": "linux", + "arch": "x64", + "abi": "gnu", + "platformArchABI": "qwik.linux-x64-gnu.node" + } + ] } }; From f6d7862156aa6350bf931ca193803d1acb861519 Mon Sep 17 00:00:00 2001 From: wuls Date: Fri, 22 Nov 2024 14:54:59 +0800 Subject: [PATCH 09/20] upgrade --- packages/eslint-plugin-qwik/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/eslint-plugin-qwik/index.ts b/packages/eslint-plugin-qwik/index.ts index d9d3882077f..a7022f5d477 100644 --- a/packages/eslint-plugin-qwik/index.ts +++ b/packages/eslint-plugin-qwik/index.ts @@ -52,7 +52,7 @@ const strictRules = { 'qwik/no-use-visible-task': 'warn', }; -const configs = { +export const configs = { recommended: { plugins: ['qwik'], rules: recommendedRules, @@ -91,4 +91,4 @@ Object.assign(qwikEslintPlugin.configs, { ], }); -export { configs, qwikEslintPlugin as default }; +// export { configs, qwikEslintPlugin as default }; From af55f94827c0ca60813cac4517a76ac5d262e91d Mon Sep 17 00:00:00 2001 From: wuls Date: Fri, 22 Nov 2024 14:56:45 +0800 Subject: [PATCH 10/20] upgrade --- packages/eslint-plugin-qwik/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/eslint-plugin-qwik/index.ts b/packages/eslint-plugin-qwik/index.ts index a7022f5d477..d9d3882077f 100644 --- a/packages/eslint-plugin-qwik/index.ts +++ b/packages/eslint-plugin-qwik/index.ts @@ -52,7 +52,7 @@ const strictRules = { 'qwik/no-use-visible-task': 'warn', }; -export const configs = { +const configs = { recommended: { plugins: ['qwik'], rules: recommendedRules, @@ -91,4 +91,4 @@ Object.assign(qwikEslintPlugin.configs, { ], }); -// export { configs, qwikEslintPlugin as default }; +export { configs, qwikEslintPlugin as default }; From 64b5c11329dd5d415e6bafed9f0879b0a6b0c28f Mon Sep 17 00:00:00 2001 From: wuls Date: Fri, 22 Nov 2024 15:17:00 +0800 Subject: [PATCH 11/20] upgrade --- packages/eslint-plugin-qwik/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/eslint-plugin-qwik/index.ts b/packages/eslint-plugin-qwik/index.ts index d9d3882077f..453d03f2685 100644 --- a/packages/eslint-plugin-qwik/index.ts +++ b/packages/eslint-plugin-qwik/index.ts @@ -91,4 +91,4 @@ Object.assign(qwikEslintPlugin.configs, { ], }); -export { configs, qwikEslintPlugin as default }; +export { configs, qwikEslintPlugin as default, rules }; From cce51f089e5bd24fc1ea271f9d48e9f0af4b11a5 Mon Sep 17 00:00:00 2001 From: wuls Date: Fri, 22 Nov 2024 16:01:01 +0800 Subject: [PATCH 12/20] upgrade --- e2e/qwik-cli-e2e/tests/serve.spec.ts | 2 +- e2e/qwik-cli-e2e/utils/index.ts | 2 +- starters/features/playwright/playwright.config.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/e2e/qwik-cli-e2e/tests/serve.spec.ts b/e2e/qwik-cli-e2e/tests/serve.spec.ts index c30d8aa30a9..2ca7ce07700 100644 --- a/e2e/qwik-cli-e2e/tests/serve.spec.ts +++ b/e2e/qwik-cli-e2e/tests/serve.spec.ts @@ -29,7 +29,7 @@ test( const host = `http://localhost:${SERVE_PORT}/`; await assertHostUnused(host); const p = await runCommandUntil( - `npm run dev -- --port ${SERVE_PORT}`, + `pnpm run dev -- --port ${SERVE_PORT}`, global.tmpDir, (output) => { return output.includes(host); diff --git a/e2e/qwik-cli-e2e/utils/index.ts b/e2e/qwik-cli-e2e/utils/index.ts index c67a7636897..cabbfa3cc6d 100644 --- a/e2e/qwik-cli-e2e/utils/index.ts +++ b/e2e/qwik-cli-e2e/utils/index.ts @@ -67,7 +67,7 @@ function replacePackagesWithLocalOnes(tmpDir: string) { for (const { name, absolutePath } of tarballConfig) { patchPackageJsonForPlugin(tmpDir, name, absolutePath); } - execSync('npm i', { + execSync('pnpm i', { cwd: tmpDir, // only output errors stdio: ['ignore', 'ignore', 'inherit'], diff --git a/starters/features/playwright/playwright.config.ts b/starters/features/playwright/playwright.config.ts index 6571b00a469..7f80cd73ec9 100644 --- a/starters/features/playwright/playwright.config.ts +++ b/starters/features/playwright/playwright.config.ts @@ -32,7 +32,7 @@ const config: PlaywrightTestConfig = { ], webServer: { - command: "npm run preview", + command: "pnpm run preview", port: 4173, }, }; From 20a6fd49579fa7fbc98dc7e77f94fa8572bfd285 Mon Sep 17 00:00:00 2001 From: wuls Date: Fri, 22 Nov 2024 16:10:37 +0800 Subject: [PATCH 13/20] upgrade --- e2e/qwik-cli-e2e/tests/serve.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/qwik-cli-e2e/tests/serve.spec.ts b/e2e/qwik-cli-e2e/tests/serve.spec.ts index 2ca7ce07700..c30d8aa30a9 100644 --- a/e2e/qwik-cli-e2e/tests/serve.spec.ts +++ b/e2e/qwik-cli-e2e/tests/serve.spec.ts @@ -29,7 +29,7 @@ test( const host = `http://localhost:${SERVE_PORT}/`; await assertHostUnused(host); const p = await runCommandUntil( - `pnpm run dev -- --port ${SERVE_PORT}`, + `npm run dev -- --port ${SERVE_PORT}`, global.tmpDir, (output) => { return output.includes(host); From 0bda5461eb8152f43b5351a6ca6d1f60cf04f872 Mon Sep 17 00:00:00 2001 From: wuls Date: Fri, 22 Nov 2024 16:11:46 +0800 Subject: [PATCH 14/20] upgrade --- starters/features/playwright/playwright.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/starters/features/playwright/playwright.config.ts b/starters/features/playwright/playwright.config.ts index 7f80cd73ec9..6571b00a469 100644 --- a/starters/features/playwright/playwright.config.ts +++ b/starters/features/playwright/playwright.config.ts @@ -32,7 +32,7 @@ const config: PlaywrightTestConfig = { ], webServer: { - command: "pnpm run preview", + command: "npm run preview", port: 4173, }, }; From 02cba46b60b40e3b9d72497a57b615605f57a244 Mon Sep 17 00:00:00 2001 From: wuls Date: Fri, 22 Nov 2024 16:23:54 +0800 Subject: [PATCH 15/20] fix --- .changeset/breezy-toes-help.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/breezy-toes-help.md b/.changeset/breezy-toes-help.md index 8c456168014..4dcc47d055c 100644 --- a/.changeset/breezy-toes-help.md +++ b/.changeset/breezy-toes-help.md @@ -2,4 +2,4 @@ 'eslint-plugin-qwik': major --- -let eslint-plugin-qwink support Eslint 9 and 8 simultaneously +let eslint-plugin-qwik support Eslint 9 and 8 simultaneously From 2458862c594b9f64813e9fefb34c2422452e81b8 Mon Sep 17 00:00:00 2001 From: wuls Date: Thu, 28 Nov 2024 09:21:36 +0800 Subject: [PATCH 16/20] fix --- packages/eslint-plugin-qwik/qwik.unit.ts | 2 -- packages/eslint-plugin-qwik/tests/tsconfig.json | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/eslint-plugin-qwik/qwik.unit.ts b/packages/eslint-plugin-qwik/qwik.unit.ts index d2609dc6411..1401012fc94 100644 --- a/packages/eslint-plugin-qwik/qwik.unit.ts +++ b/packages/eslint-plugin-qwik/qwik.unit.ts @@ -1,11 +1,9 @@ import * as vitest from 'vitest'; -// @ts-ignore import { RuleTester, type RuleTesterConfig } from '@typescript-eslint/rule-tester'; import { fileURLToPath } from 'node:url'; import { rules } from './index'; import { readdir, readFile, stat } from 'node:fs/promises'; import { join, dirname } from 'path'; -// import {plugin, parser} from 'typescript-eslint' // https://typescript-eslint.io/packages/rule-tester/#vitest RuleTester.afterAll = vitest.afterAll; diff --git a/packages/eslint-plugin-qwik/tests/tsconfig.json b/packages/eslint-plugin-qwik/tests/tsconfig.json index 2198df838b3..8982e2d060b 100644 --- a/packages/eslint-plugin-qwik/tests/tsconfig.json +++ b/packages/eslint-plugin-qwik/tests/tsconfig.json @@ -1,9 +1,9 @@ { "compilerOptions": { "incremental": true, - "target": "ESNext", - "module": "ESNext", - "lib": ["ESNext", "DOM"], + "target": "ES2020", + "module": "ES2020", + "lib": ["es2020", "DOM"], "resolveJsonModule": true, "jsx": "react-jsx", "jsxImportSource": "@builder.io/qwik", From fc93083bbafc007c18f2ba7b93ad1c843432c23a Mon Sep 17 00:00:00 2001 From: JerryWu <409187100@qq.com> Date: Wed, 11 Dec 2024 18:48:05 +0800 Subject: [PATCH 17/20] fix --- packages/eslint-plugin-qwik/package.json | 7 ++----- pnpm-lock.yaml | 11 +++++++++++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/packages/eslint-plugin-qwik/package.json b/packages/eslint-plugin-qwik/package.json index d6a0b0b43a0..e8e8c6a6192 100644 --- a/packages/eslint-plugin-qwik/package.json +++ b/packages/eslint-plugin-qwik/package.json @@ -13,7 +13,8 @@ "@builder.io/qwik-city": "workspace:^", "@types/estree": "1.0.5", "@typescript-eslint/rule-tester": "8.14.0", - "redent": "4.0.0" + "redent": "4.0.0", + "@types/eslint": "9.6.1" }, "engines": { "node": ">=16.8.0 <18.0.0 || >=18.11" @@ -30,10 +31,6 @@ ], "license": "MIT", "main": "dist/index.js", - "peerDependencies": { - "eslint": "9.15.0", - "@types/eslint": "9.6.1" - }, "repository": { "type": "git", "url": "https://github.com/QwikDev/qwik.git", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 53f5e296b4d..a4bb3fb6988 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -437,6 +437,9 @@ importers: '@builder.io/qwik-city': specifier: workspace:^ version: link:../qwik-city + '@types/eslint': + specifier: 9.6.1 + version: 9.6.1 '@types/estree': specifier: 1.0.5 version: 1.0.5 @@ -3404,6 +3407,9 @@ packages: '@types/eslint@8.56.10': resolution: {integrity: sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ==} + '@types/eslint@9.6.1': + resolution: {integrity: sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==} + '@types/estree-jsx@1.0.5': resolution: {integrity: sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg==} @@ -12503,6 +12509,11 @@ snapshots: '@types/estree': 1.0.5 '@types/json-schema': 7.0.15 + '@types/eslint@9.6.1': + dependencies: + '@types/estree': 1.0.5 + '@types/json-schema': 7.0.15 + '@types/estree-jsx@1.0.5': dependencies: '@types/estree': 1.0.5 From 13efa82832a573d2cba0b5c481a2fa7c3c53b2fd Mon Sep 17 00:00:00 2001 From: JerryWu <409187100@qq.com> Date: Wed, 11 Dec 2024 18:53:07 +0800 Subject: [PATCH 18/20] fix --- packages/eslint-plugin-qwik/package.json | 6 ++++-- pnpm-lock.yaml | 11 ----------- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/packages/eslint-plugin-qwik/package.json b/packages/eslint-plugin-qwik/package.json index e8e8c6a6192..16bcfe1be7c 100644 --- a/packages/eslint-plugin-qwik/package.json +++ b/packages/eslint-plugin-qwik/package.json @@ -13,8 +13,7 @@ "@builder.io/qwik-city": "workspace:^", "@types/estree": "1.0.5", "@typescript-eslint/rule-tester": "8.14.0", - "redent": "4.0.0", - "@types/eslint": "9.6.1" + "redent": "4.0.0" }, "engines": { "node": ">=16.8.0 <18.0.0 || >=18.11" @@ -31,6 +30,9 @@ ], "license": "MIT", "main": "dist/index.js", + "peerDependencies": { + "@types/eslint": "9.6.1" + }, "repository": { "type": "git", "url": "https://github.com/QwikDev/qwik.git", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a4bb3fb6988..53f5e296b4d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -437,9 +437,6 @@ importers: '@builder.io/qwik-city': specifier: workspace:^ version: link:../qwik-city - '@types/eslint': - specifier: 9.6.1 - version: 9.6.1 '@types/estree': specifier: 1.0.5 version: 1.0.5 @@ -3407,9 +3404,6 @@ packages: '@types/eslint@8.56.10': resolution: {integrity: sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ==} - '@types/eslint@9.6.1': - resolution: {integrity: sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==} - '@types/estree-jsx@1.0.5': resolution: {integrity: sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg==} @@ -12509,11 +12503,6 @@ snapshots: '@types/estree': 1.0.5 '@types/json-schema': 7.0.15 - '@types/eslint@9.6.1': - dependencies: - '@types/estree': 1.0.5 - '@types/json-schema': 7.0.15 - '@types/estree-jsx@1.0.5': dependencies: '@types/estree': 1.0.5 From 13421f32a7cf587ae694bb57df576ac8a0b4f928 Mon Sep 17 00:00:00 2001 From: JerryWu <409187100@qq.com> Date: Thu, 12 Dec 2024 09:58:44 +0800 Subject: [PATCH 19/20] fix --- e2e/qwik-cli-e2e/utils/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/qwik-cli-e2e/utils/index.ts b/e2e/qwik-cli-e2e/utils/index.ts index cabbfa3cc6d..c67a7636897 100644 --- a/e2e/qwik-cli-e2e/utils/index.ts +++ b/e2e/qwik-cli-e2e/utils/index.ts @@ -67,7 +67,7 @@ function replacePackagesWithLocalOnes(tmpDir: string) { for (const { name, absolutePath } of tarballConfig) { patchPackageJsonForPlugin(tmpDir, name, absolutePath); } - execSync('pnpm i', { + execSync('npm i', { cwd: tmpDir, // only output errors stdio: ['ignore', 'ignore', 'inherit'], From aa1d5fb6404b8c1d19ef11cb4f608f2d3244e128 Mon Sep 17 00:00:00 2001 From: wuls Date: Tue, 31 Dec 2024 16:13:01 +0800 Subject: [PATCH 20/20] fix --- e2e/qwik-cli-e2e/utils/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/qwik-cli-e2e/utils/index.ts b/e2e/qwik-cli-e2e/utils/index.ts index c67a7636897..cabbfa3cc6d 100644 --- a/e2e/qwik-cli-e2e/utils/index.ts +++ b/e2e/qwik-cli-e2e/utils/index.ts @@ -67,7 +67,7 @@ function replacePackagesWithLocalOnes(tmpDir: string) { for (const { name, absolutePath } of tarballConfig) { patchPackageJsonForPlugin(tmpDir, name, absolutePath); } - execSync('npm i', { + execSync('pnpm i', { cwd: tmpDir, // only output errors stdio: ['ignore', 'ignore', 'inherit'],