Skip to content

Commit

Permalink
improved linter config
Browse files Browse the repository at this point in the history
  • Loading branch information
alex committed Mar 4, 2024
1 parent fa51c71 commit 5a17138
Show file tree
Hide file tree
Showing 69 changed files with 244 additions and 153 deletions.
30 changes: 19 additions & 11 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"prettier",
"plugin:@typescript-eslint/recommended"
"plugin:prettier/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:tailwindcss/recommended"
],
"parser": "@typescript-eslint/parser",
"ignorePatterns": ["**/lib/**", "**/node_modules/**"],
"ignorePatterns": [
"**/lib/**",
"**/node_modules/**",
"website/public/examples/**"
],
"root": true,
"plugins": ["react", "jest", "@typescript-eslint"],
"env": {
Expand All @@ -16,31 +21,34 @@
},
"parserOptions": {
"ecmaVersion": 2022,
"sourceType": "module"
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"settings": {
"react": {
"version": "detect"
}
},
"rules": {
"quotes": ["warn", "double"],
"semi": ["error", "always"],
"lodash/prefer-lodash-chain": [0],
"lodash/prefer-lodash-method": [0],
"no-restricted-syntax": ["error", "WithStatement"],
"no-bitwise": [0],
"no-underscore-dangle": [0],
"no-plusplus": [0],
"lines-between-class-members": [0],
"one-var": [0],
"no-param-reassign": [0],
"no-multi-assign": [0],
"no-nested-ternary": [0],
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/ban-ts-comment": 0,
"import/prefer-default-export": [0],
"no-cond-assign": [0],
"max-classes-per-file": [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]
"react/jsx-no-target-blank": [1],
"tailwindcss/no-custom-classname": "off"
}
}
2 changes: 1 addition & 1 deletion examples/global.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
declare module "*.module.css";
declare module "*.module.css";
2 changes: 1 addition & 1 deletion examples/src/scrollend-polyfill/react/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ export default defineConfig({
build: {
outDir: "./lib"
}
});
});
4 changes: 2 additions & 2 deletions examples/src/virtual/react/hook/custom-render/global.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
declare module "*.module.css" {
const classes: Record<string,string>;
const classes: Record<string, string>;
export default classes;
}
}
3 changes: 2 additions & 1 deletion examples/src/virtual/react/hook/custom-render/meta.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const metadata = {
description: "Use your own rendering strategy by subscribing to VirtualScroller events and update element styles manually"
description:
"Use your own rendering strategy by subscribing to VirtualScroller events and update element styles manually"
} as const;

export default metadata;
4 changes: 2 additions & 2 deletions examples/src/virtual/react/hook/custom-render/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import react from "@vitejs/plugin-react";

export default defineConfig({
plugins: [react()],
base: "",
base: "",
build: {
outDir: "./lib"
}
});
});
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
declare module "*.module.css" {
const classes: Record<string,string>;
const classes: Record<string, string>;
export default classes;
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const metadata = {
description: "You can use VirtualScroller.setContainer in case something is rendered \
description:
"You can use VirtualScroller.setContainer in case something is rendered \
before primary virtual scroller items. It may be also useful in window scroll scenario."
} as const;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import react from "@vitejs/plugin-react";

export default defineConfig({
plugins: [react()],
base: "",
base: "",
build: {
outDir: "./lib"
}
});
});
4 changes: 2 additions & 2 deletions examples/src/virtual/react/hook/grid/global.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
declare module "*.module.css" {
const classes: Record<string,string>;
const classes: Record<string, string>;
export default classes;
}
}
3 changes: 2 additions & 1 deletion examples/src/virtual/react/hook/grid/meta.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const metadata = {
description: "Virtualized dynamic-sized grids are supported, just call useVirtual two times for rows and columns."
description:
"Virtualized dynamic-sized grids are supported, just call useVirtual two times for rows and columns."
} as const;

export default metadata;
2 changes: 1 addition & 1 deletion examples/src/virtual/react/hook/grid/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ export default defineConfig({
build: {
outDir: "./lib"
}
});
});
4 changes: 2 additions & 2 deletions examples/src/virtual/react/hook/simple/global.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
declare module "*.module.css" {
const classes: Record<string,string>;
const classes: Record<string, string>;
export default classes;
}
}
2 changes: 1 addition & 1 deletion examples/src/virtual/react/hook/simple/meta.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const metadata = {
description:
"In simple cases like here List component is preferable. You will just end up writing less code. \
"In simple cases like here List component is preferable. You will just end up writing less code. \
But if you need custom render, window scroll or something similar - this example would be a nice starting point."
} as const;

Expand Down
2 changes: 1 addition & 1 deletion examples/src/virtual/react/hook/simple/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ export default defineConfig({
build: {
outDir: "./lib"
}
});
});
4 changes: 2 additions & 2 deletions examples/src/virtual/react/hook/window-scroll/global.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
declare module "*.module.css" {
const classes: Record<string,string>;
const classes: Record<string, string>;
export default classes;
}
}
3 changes: 2 additions & 1 deletion examples/src/virtual/react/hook/window-scroll/meta.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const metadata = {
description: "useScroller hook allows to set any element or window \
description:
"useScroller hook allows to set any element or window \
as scroller. It gives you more flexibility than ref. You can even use elements from outside of current component."
} as const;

Expand Down
4 changes: 2 additions & 2 deletions examples/src/virtual/react/hook/window-scroll/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import react from "@vitejs/plugin-react";

export default defineConfig({
plugins: [react()],
base: "",
base: "",
build: {
outDir: "./lib"
}
});
});
2 changes: 1 addition & 1 deletion examples/src/virtual/react/list/bootstrap/meta.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const metadata = {
description:
"Use your own rendering strategy by subscribing to VirtualScroller events and update element styles manually"
"Use your own rendering strategy by subscribing to VirtualScroller events and update element styles manually"
} as const;

export default metadata;
6 changes: 3 additions & 3 deletions examples/src/virtual/react/list/bootstrap/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import react from "@vitejs/plugin-react";

export default defineConfig({
plugins: [react()],
base: "",
base: "",
build: {
outDir: "./lib",
outDir: "./lib"
}
});
});
4 changes: 2 additions & 2 deletions examples/src/virtual/react/list/extra-events/global.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
declare module "*.module.css" {
const classes: Record<string,string>;
const classes: Record<string, string>;
export default classes;
}
}
3 changes: 2 additions & 1 deletion examples/src/virtual/react/list/extra-events/meta.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const metadata = {
description: "Subscription component can be used to subscribe to VirtualScroller events. \
description:
"Subscription component can be used to subscribe to VirtualScroller events. \
This helps to optimize performance, as only needed components are rerendered."
} as const;

Expand Down
4 changes: 2 additions & 2 deletions examples/src/virtual/react/list/extra-events/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import react from "@vitejs/plugin-react";

export default defineConfig({
plugins: [react()],
base: "",
base: "",
build: {
outDir: "./lib"
}
});
});
4 changes: 2 additions & 2 deletions examples/src/virtual/react/list/horizontal/global.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
declare module "*.module.css" {
const classes: Record<string,string>;
const classes: Record<string, string>;
export default classes;
}
}
3 changes: 2 additions & 1 deletion examples/src/virtual/react/list/horizontal/meta.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const metadata = {
description: "useVirtual hook supports horizontal param for virtualizing columns instead of rows. \
description:
"useVirtual hook supports horizontal param for virtualizing columns instead of rows. \
All necessary styles are applied to List component automatically."
} as const;

Expand Down
4 changes: 2 additions & 2 deletions examples/src/virtual/react/list/horizontal/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import react from "@vitejs/plugin-react";

export default defineConfig({
plugins: [react()],
base: "",
base: "",
build: {
outDir: "./lib"
}
});
});
4 changes: 2 additions & 2 deletions examples/src/virtual/react/list/load-on-demand/global.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
declare module "*.module.css" {
const classes: Record<string,string>;
const classes: Record<string, string>;
export default classes;
}
}
3 changes: 2 additions & 1 deletion examples/src/virtual/react/list/load-on-demand/meta.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const metadata = {
description: "Virtual scroll model can emit events, which is very convenient for loading something on demand. \
description:
"Virtual scroll model can emit events, which is very convenient for loading something on demand. \
Here new posts are loaded when list is scrolled till the end, but this behavior can be easily customized."
} as const;

Expand Down
4 changes: 2 additions & 2 deletions examples/src/virtual/react/list/load-on-demand/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import react from "@vitejs/plugin-react";

export default defineConfig({
plugins: [react()],
base: "",
base: "",
build: {
outDir: "./lib"
}
});
});
3 changes: 2 additions & 1 deletion examples/src/virtual/react/list/material-ui/meta.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const metadata = {
description: "Virtual List supports component prop, so it can be easily integrated with Material UI or Bootstrap. \
description:
"Virtual List supports component prop, so it can be easily integrated with Material UI or Bootstrap. \
Also disablePadding should be passed to MuiList, because scroll element offsets are not supported."
} as const;

Expand Down
2 changes: 1 addition & 1 deletion examples/src/virtual/react/list/material-ui/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ export default defineConfig({
build: {
outDir: "./lib"
}
});
});
4 changes: 2 additions & 2 deletions examples/src/virtual/react/list/prepend-items/global.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
declare module "*.module.css" {
const classes: Record<string,string>;
const classes: Record<string, string>;
export default classes;
}
}
3 changes: 2 additions & 1 deletion examples/src/virtual/react/list/prepend-items/meta.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const metadata = {
description: "Visible elements range must be persisted after new ones are prepended? \
description:
"Visible elements range must be persisted after new ones are prepended? \
VirtualScroller exposes visibleFrom, which allows to get the position of the first visible item and scroll to it."
} as const;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ export default defineConfig({
build: {
outDir: "./lib"
}
});
});
4 changes: 2 additions & 2 deletions examples/src/virtual/react/list/scroll-to-item/global.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
declare module "*.module.css" {
const classes: Record<string,string>;
const classes: Record<string, string>;
export default classes;
}
}
3 changes: 2 additions & 1 deletion examples/src/virtual/react/list/scroll-to-item/meta.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const metadata = {
description: "VirtualScroller.scrollToIndex method \
description:
"VirtualScroller.scrollToIndex method \
works with dynamic item sizes and performs scrolling until desired index is reached. Smooth scrolling is supported."
} as const;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ export default defineConfig({
build: {
outDir: "./lib"
}
});
});
2 changes: 1 addition & 1 deletion examples/src/virtual/react/list/simple/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ export default defineConfig({
build: {
outDir: "./lib"
}
});
});
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
declare module "*.module.css" {
const classes: Record<string,string>;
const classes: Record<string, string>;
export default classes;
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const metadata = {
description: "Virtual List header and footer can have sticky positioning. \
description:
"Virtual List header and footer can have sticky positioning. \
Connect them with setStickyHeader or setStickyFooter and add position: sticky style."
} as const;

Expand Down
Loading

0 comments on commit 5a17138

Please sign in to comment.