Skip to content

Commit b3f466d

Browse files
fix: linter in examples (#277)
* fix: configured .eslintrc to parse ./examples * feat: added examples dir linting to lint script * fix: fixed 2 lint problems in examples/src/App.tsx --------- Co-authored-by: Michael Bashurov <[email protected]> Co-authored-by: Soham <[email protected]>
1 parent 93d0e4c commit b3f466d

File tree

4 files changed

+3547
-3546
lines changed

4 files changed

+3547
-3546
lines changed

.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"parserOptions": {
3838
"ecmaFeatures": { "jsx": true },
3939
"ecmaVersion": 2018,
40-
"project": "./tsconfig.json",
40+
"project": ["./tsconfig.json", "./examples/tsconfig.json"],
4141
"sourceType": "module"
4242
},
4343
"extends": ["plugin:@typescript-eslint/recommended", "plugin:@typescript-eslint/eslint-recommended", "prettier"],

examples/src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { demoDots, demoName, demoPanel, dot, error, loadingContainer, loadingMes
55
import { Link, Redirect, Route, useRoute } from 'wouter'
66

77
import * as demos from './demos'
8-
import useErrorBoundary from 'use-error-boundary'
8+
import { useErrorBoundary } from 'use-error-boundary'
99

1010
const DEFAULT_COMPONENT_NAME = 'Interactive'
1111
const visibleComponents = Object.entries(demos).reduce(
@@ -49,7 +49,7 @@ function Dots() {
4949
return (
5050
<div className={demoPanel}>
5151
<div className={demoDots}>
52-
{Object.entries(visibleComponents).map(function mapper([name, item]) {
52+
{Object.entries(visibleComponents).map(function mapper([name, _item]) {
5353
const background = params.name === name ? 'salmon' : '#fff'
5454
return <Link className={dot} key={name} to={`/demo/${name}`} style={{ background }} />
5555
})}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"scripts": {
7474
"dev": "vite",
7575
"build": "vite build && tsc",
76-
"lint": "eslint src/**/*.{ts,tsx}",
76+
"lint": "eslint src/**/*.{ts,tsx} && eslint examples/src/**/*.{ts,tsx}",
7777
"test": "vitest",
7878
"coverage": "vitest run --coverage"
7979
}

0 commit comments

Comments
 (0)