Skip to content

Commit

Permalink
further linter improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
alex committed Mar 4, 2024
1 parent c59e6a3 commit 09111f8
Show file tree
Hide file tree
Showing 9 changed files with 103 additions and 30 deletions.
31 changes: 10 additions & 21 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"plugin:prettier/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/strict",
"plugin:@typescript-eslint/stylistic",
"plugin:tailwindcss/recommended"
],
"parser": "@typescript-eslint/parser",
Expand All @@ -13,14 +14,14 @@
"website/public/examples/**"
],
"root": true,
"plugins": ["react", "jest", "@typescript-eslint"],
"plugins": ["react", "jest", "@typescript-eslint", "tailwindcss"],
"env": {
"browser": true,
"node": true,
"es6": true
"es2024": true
},
"parserOptions": {
"ecmaVersion": 2022,
"ecmaVersion": "latest",
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
Expand All @@ -32,23 +33,11 @@
}
},
"rules": {
"quotes": ["warn", "double"],
"quotes": ["error", "double"],
"semi": ["error", "always"],
"no-restricted-syntax": ["error", "WithStatement"],
"no-bitwise": [0],
"no-plusplus": [0],
"lines-between-class-members": [0],
"one-var": [0],
"no-param-reassign": [0],
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/ban-ts-comment": 0,
"import/prefer-default-export": [0],
"no-cond-assign": [0],
"react/prop-types": "off",
"react/display-name": "off",
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off",
"react/jsx-no-target-blank": [1],
"no-plusplus": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"tailwindcss/no-custom-classname": "off"
}
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"jest-environment-jsdom": "^29.7.0",
"next": "^14.1.0",
"prettier": "^3.2.5",
"publint": "^0.2.7",
"ts-node": "^10.9.2",
"tsc-alias": "^1.8.8",
"typescript": "^5.3.3"
Expand Down
8 changes: 6 additions & 2 deletions packages/virtual/core/src/__mocks__/ResizeObserver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,12 @@ class TestResizeObserver implements ResizeObserver {
this.flushTimer = setTimeout(() => this.flush(), 0);
}

unobserve() {}
disconnect() {}
unobserve() {
// do nothing.
}
disconnect() {
// do nothing.
}
}

export default TestResizeObserver;
4 changes: 3 additions & 1 deletion packages/virtual/core/src/models/VirtualScroller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,9 @@ class VirtualScroller {
}
}

private _unobserveResize = () => {};
private _unobserveResize = () => {
// do nothing.
};

constructor(params?: VirtualScrollerInitialParams) {
if (params) {
Expand Down
73 changes: 73 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion website/app/virtual/reference/[...reference]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import type { Metadata } from "next";
import glob from "fast-glob";
import Link from "next/link";

type Params = { params: { reference: string[] } };
interface Params {
params: { reference: string[] };
}

export async function generateStaticParams() {
const result = glob
Expand Down
4 changes: 2 additions & 2 deletions website/components/Menu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import { VscGithub, VscMenu, VscClose } from "react-icons/vsc";
import { SiDiscord, SiReact } from "react-icons/si";
import NavLink from "components/NavLink";

export type MenuItem = {
export interface MenuItem {
name: string;
path: string;
exact?: boolean;
comparePath?: string;
children?: readonly MenuItem[] | MenuItem[];
};
}

const H = ["h2", "h3", "h4", "h4"] as const;

Expand Down
4 changes: 2 additions & 2 deletions website/components/SizesTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import prettyBytes from "pretty-bytes";

const sizeColumns = ["raw", "min", "minGz", "minBrotli"] as const;

type SizesTableProps = {
interface SizesTableProps {
items: [
{ raw: number; min: number; minGz: number; minBrotli: number },
name: string
][];
};
}

const SizesTable = ({ items }: SizesTableProps) => {
switch (items.length) {
Expand Down
4 changes: 3 additions & 1 deletion website/utils/examples/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import { execSync } from "node:child_process";
import type { MenuItem } from "components/Menu";
import type { Metadata } from "next";

export type Params = { params: { example: string[] } };
export interface Params {
params: { example: string[] };
}

function walkMenu(
obj: Record<string, any> | null,
Expand Down

0 comments on commit 09111f8

Please sign in to comment.