Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion e2e/adapters-e2e/src/routes/loaders/subpage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { component$ } from '@qwik.dev/core';
import { routeLoader$ } from '@qwik.dev/router';

export const useTest = routeLoader$(async () => {
return 42;
// eslint-disable-next-line @typescript-eslint/await-thenable
return await 42;
});

export default component$(() => {
Expand Down
4 changes: 2 additions & 2 deletions e2e/qwik-react-e2e/src/components/counter/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { useEffect, useState } from 'react';
import { qwikify$ } from '@qwik.dev/react';

interface IProps {
onMount(): void;
onUnmount(): void;
onMount(this: void): void;
onUnmount(this: void): void;
}

function Counter({ onMount, onUnmount }: IProps) {
Expand Down
160 changes: 160 additions & 0 deletions eslint.config-no-ts.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
import globals from 'globals';
import js from '@eslint/js';
import tseslint from 'typescript-eslint';
import noOnlyTests from 'eslint-plugin-no-only-tests';
import { globalIgnores } from 'eslint/config';
// import { qwikEslint9Plugin } from 'eslint-plugin-qwik';

const ignores = [
'**/.history',
'**/.vscode',
'**/dist',
'**/dist-dev',
'**/lib',
'**/node_modules',
'**/tsc-out',
'**/external',
'**/*.',
'**/*.log',
'**/etc',
'**/target',
'**/temp',
'**/tsdoc-metadata.json',
'**/.DS_Store',
'**/*.mp4',
'scripts',
'**/server/**/*.js',
'**/*.tsbuildinfo',
'packages/docs/api',
'packages/docs/public/repl/repl-sw.js*',
'packages/docs/src/routes/examples/apps',
'packages/docs/src/routes/playground/app',
'packages/docs/src/routes/tutorial',
'packages/qwik/src/optimizer/core/src/fixtures',
'packages/qwik/bindings',
'packages/qwik-labs/lib',
'packages/qwik-labs/lib-types',
'packages/qwik-labs/vite',
'packages/insights/drizzle.config.ts',
'packages/insights/panda.config.ts',
'packages/qwik/src/napi',
'starters/apps/base',
'starters/apps/library',
'starters/templates',
'**/vite.config.ts',
// packages with eslint.config.mjs
'packages/qwik-labs',
'packages/insights',
// eslint.config.*
'**/eslint.config.mjs',
'**/eslint.config.js',
'.changeset',
'packages/docs/public/builder',
];

export default tseslint.config(
globalIgnores(ignores),
js.configs.recommended,
tseslint.configs.recommended,
// qwikEslint9Plugin.configs.recommended,
{
languageOptions: {
globals: {
...globals.browser,
...globals.node,
...globals.es2021,
},
parserOptions: {
// Needed when using the qwik plugin
// projectService: true,
// tsconfigRootDir: import.meta.dirname,
},
},
},
{
plugins: {
'no-only-tests': noOnlyTests,
},
rules: {
'no-only-tests/no-only-tests': 'error',
},
name: 'no-only-tests',
},
{
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-this-alias': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'prefer-spread': 'off',
'no-case-declarations': 'off',
'no-console': ['error', { allow: ['warn', 'error'] }],
'no-only-tests/no-only-tests': 'error',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-var-requires': 'off',
curly: 'error',
'no-new-func': 'error',
'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-unsafe-function-type': 'off',
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-wrapper-object-types': 'off',
},
},
{
files: ['packages/docs/**/*.{ts,tsx}'],
rules: {
'no-console': 'off',
},
},
{
files: ['packages/qwik/src/server/**/*.ts'],
ignores: ['packages/qwik/src/server/qwik-copy.ts'],
rules: {
'@typescript-eslint/no-restricted-imports': [
'error',
{
patterns: [
{
group: ['packages/*'],
message: 'Absolute imports are not allowed.',
},
{
group: ['../**'],
message: 'Relative imports are not allowed.',
},
],
},
],
'no-duplicate-imports': 'error',
},
},
{
files: ['packages/qwik/src/server/qwik-types.ts'],
rules: {
'@typescript-eslint/no-restricted-imports': [
'error',
{
patterns: [
{
group: ['packages/*'],
message: 'Absolute imports are not allowed.',
allowTypeImports: true,
},
{
group: ['../**'],
message: 'Relative imports are not allowed.',
allowTypeImports: true,
},
],
},
],
},
}
);
158 changes: 12 additions & 146 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,160 +1,26 @@
import globals from 'globals';
import js from '@eslint/js';
import tseslint from 'typescript-eslint';
import noOnlyTests from 'eslint-plugin-no-only-tests';
import { globalIgnores } from 'eslint/config';
// import { qwikEslint9Plugin } from 'eslint-plugin-qwik';

const ignores = [
'**/.history',
'**/.vscode',
'**/dist',
'**/dist-dev',
'**/lib',
'**/node_modules',
'**/tsc-out',
'**/external',
'**/*.',
'**/*.log',
'**/etc',
'**/target',
'**/temp',
'**/tsdoc-metadata.json',
'**/.DS_Store',
'**/*.mp4',
'scripts',
'**/server/**/*.js',
'**/*.tsbuildinfo',
'packages/docs/api',
'packages/docs/public/repl/repl-sw.js*',
'packages/docs/src/routes/examples/apps',
'packages/docs/src/routes/playground/app',
'packages/docs/src/routes/tutorial',
'packages/qwik/src/optimizer/core/src/fixtures',
'packages/qwik/bindings',
'packages/qwik-labs/lib',
'packages/qwik-labs/lib-types',
'packages/qwik-labs/vite',
'packages/insights/drizzle.config.ts',
'packages/insights/panda.config.ts',
'packages/qwik/src/napi',
'starters/apps/base',
'starters/apps/library',
'starters/templates',
'**/vite.config.ts',
// packages with eslint.config.mjs
'packages/qwik-labs',
'packages/insights',
// eslint.config.*
'**/eslint.config.mjs',
'**/eslint.config.js',
'.changeset',
'packages/docs/public/builder',
];
import baseConfig from './eslint.config-no-ts.mjs';

// We enable TS processing here, which will run in the IDE.
export default tseslint.config(
globalIgnores(ignores),
js.configs.recommended,
tseslint.configs.recommended,
// qwikEslint9Plugin.configs.recommended,
baseConfig,
{
languageOptions: {
globals: {
...globals.browser,
...globals.node,
...globals.es2021,
},
parserOptions: {
// Needed when using the qwik plugin
// projectService: true,
// tsconfigRootDir: import.meta.dirname,
// Enables TS processing, uses lots of memory and CPU
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
tseslint.configs.recommendedTypeChecked,
{
plugins: {
'no-only-tests': noOnlyTests,
},
rules: {
'no-only-tests/no-only-tests': 'error',
},
name: 'no-only-tests',
},
{
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-this-alias': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'prefer-spread': 'off',
'no-case-declarations': 'off',
'no-console': ['error', { allow: ['warn', 'error'] }],
'no-only-tests/no-only-tests': 'error',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-var-requires': 'off',
curly: 'error',
'no-new-func': 'error',
'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-unsafe-function-type': 'off',
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-wrapper-object-types': 'off',
},
},
{
files: ['packages/docs/**/*.{ts,tsx}'],
rules: {
'no-console': 'off',
},
},
{
files: ['packages/qwik/src/server/**/*.ts'],
ignores: ['packages/qwik/src/server/qwik-copy.ts'],
rules: {
'@typescript-eslint/no-restricted-imports': [
'error',
{
patterns: [
{
group: ['packages/*'],
message: 'Absolute imports are not allowed.',
},
{
group: ['../**'],
message: 'Relative imports are not allowed.',
},
],
},
],
'no-duplicate-imports': 'error',
},
},
{
files: ['packages/qwik/src/server/qwik-types.ts'],
rules: {
'@typescript-eslint/no-restricted-imports': [
'error',
{
patterns: [
{
group: ['packages/*'],
message: 'Absolute imports are not allowed.',
allowTypeImports: true,
},
{
group: ['../**'],
message: 'Relative imports are not allowed.',
allowTypeImports: true,
},
],
},
],
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unsafe-return': 'warn',
'@typescript-eslint/no-unsafe-argument': 'warn',
'@typescript-eslint/no-unsafe-member-access': 'warn',
'@typescript-eslint/no-unsafe-assignment': 'off',
},
}
);
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,8 @@
"link.dist.npm": "cd packages/qwik && npm link && cd ../qwik-router && npm link && cd ../eslint-plugin-qwik && npm link && cd ../qwik-react && npm link",
"link.dist.yarn": "cd packages/qwik && yarn link && cd ../qwik-router && yarn link && cd ../eslint-plugin-qwik && yarn link && cd ../qwik-react && yarn link",
"lint": "pnpm lint.eslint && pnpm lint.prettier && pnpm lint.rust",
"lint.eslint": "eslint --cache \"**/*.ts*\" && pnpm -r --parallel lint",
"lint.fix": "eslint --fix \"**/*.ts*\" && pnpm -r --parallel lint.fix && pnpm prettier.fix",
"lint.eslint": "eslint -c eslint.config-no-ts.mjs && pnpm -r --parallel lint",
"lint.fix": "eslint --fix -c eslint.config-no-ts.mjs && pnpm -r --parallel lint.fix && pnpm prettier.fix",
"lint.prettier": "prettier --cache --check .",
"lint.rust": "make lint",
"lint.syncpack": "syncpack list-mismatches",
Expand Down
6 changes: 3 additions & 3 deletions packages/qwik-react/src/react/qwikify.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import { renderFromServer } from './server-render';
import { getHostProps, main, mainExactProps, useWakeupSignal } from './slot';
import type { Internal, QwikifyOptions, QwikifyProps } from './types';

export function qwikifyQrl<PROPS extends Record<any, any>>(
reactCmp$: QRL<ReactFC<PROPS & { children?: any }>>,
export function qwikifyQrl<PROPS extends Record<string, unknown>>(
reactCmp$: QRL<ReactFC<PROPS & { children?: unknown }>>,
opts?: QwikifyOptions
) {
return component$((props: QwikifyProps<PROPS>) => {
Expand All @@ -35,7 +35,7 @@ export function qwikifyQrl<PROPS extends Record<any, any>>(
const internalState = useSignal<NoSerialize<Internal<PROPS>>>();
const [signal, isClientOnly] = useWakeupSignal(props, opts);
const hydrationKeys = useStore({});
const TagName = opts?.tagName ?? ('qwik-react' as any);
const TagName = opts?.tagName ?? 'qwik-react';

// Task takes cares of updates and partial hydration
useTask$(async ({ track }) => {
Expand Down
Loading
Loading