Skip to content

Commit

Permalink
fix: linter in examples (pmndrs#277)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
3 people authored Jun 8, 2023
1 parent 93d0e4c commit b3f466d
Show file tree
Hide file tree
Showing 4 changed files with 3,547 additions and 3,546 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"parserOptions": {
"ecmaFeatures": { "jsx": true },
"ecmaVersion": 2018,
"project": "./tsconfig.json",
"project": ["./tsconfig.json", "./examples/tsconfig.json"],
"sourceType": "module"
},
"extends": ["plugin:@typescript-eslint/recommended", "plugin:@typescript-eslint/eslint-recommended", "prettier"],
Expand Down
4 changes: 2 additions & 2 deletions examples/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { demoDots, demoName, demoPanel, dot, error, loadingContainer, loadingMes
import { Link, Redirect, Route, useRoute } from 'wouter'

import * as demos from './demos'
import useErrorBoundary from 'use-error-boundary'
import { useErrorBoundary } from 'use-error-boundary'

const DEFAULT_COMPONENT_NAME = 'Interactive'
const visibleComponents = Object.entries(demos).reduce(
Expand Down Expand Up @@ -49,7 +49,7 @@ function Dots() {
return (
<div className={demoPanel}>
<div className={demoDots}>
{Object.entries(visibleComponents).map(function mapper([name, item]) {
{Object.entries(visibleComponents).map(function mapper([name, _item]) {
const background = params.name === name ? 'salmon' : '#fff'
return <Link className={dot} key={name} to={`/demo/${name}`} style={{ background }} />
})}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"scripts": {
"dev": "vite",
"build": "vite build && tsc",
"lint": "eslint src/**/*.{ts,tsx}",
"lint": "eslint src/**/*.{ts,tsx} && eslint examples/src/**/*.{ts,tsx}",
"test": "vitest",
"coverage": "vitest run --coverage"
}
Expand Down
Loading

0 comments on commit b3f466d

Please sign in to comment.