Skip to content

Commit

Permalink
Add build and lint workflow (#2)
Browse files Browse the repository at this point in the history
* update .gitignore

* add eslint

* add workflow

* update workflow

* update version

* fix issues

* ignore eslint file

* update ignores

* add local dependency on `example` to fix lint

* rename workflow
  • Loading branch information
VirtualParticle authored Nov 18, 2024
1 parent 6e4e75d commit dae1557
Show file tree
Hide file tree
Showing 7 changed files with 12,639 additions and 73 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/build-and-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Build and Lint
on:
pull_request:
push:
branches:
- 'master'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '22.11.0'
registry-url: 'https://registry.npmjs.org'
- run: |
yarn
yarn build
yarn lint
File renamed without changes.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -196,3 +196,5 @@ dist
lib/
example/node_modules
example/build

.idea
25 changes: 25 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// @ts-check

import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';

export default tseslint.config(
{
ignores: [
'eslint.config.mjs',
'lib/**/*',
'node_modules/**/*',
],
},
eslint.configs.recommended,
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
);
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,18 @@
"build": "yarn build:esm && yarn build:cjs",
"build:esm": "tsc",
"build:cjs": "tsc --module commonjs --outDir lib/cjs",
"dev": "tsc-watch"
"dev": "tsc-watch",
"lint": "yarn eslint ."
},
"devDependencies": {
"@eslint/js": "9.14.0",
"@types/eslint__js": "8.42.3",
"@types/react": "^17.0.11",
"@types/react-dom": "^17.0.7",
"typescript": "^4.3.2"
"eslint": "9.14.0",
"example": "file:example",
"typescript": "^5.6.3",
"typescript-eslint": "8.14.0"
},
"peerDependencies": {
"react": ">=17.0.2",
Expand Down
8 changes: 2 additions & 6 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ function ToggleSliderHandle(props: ToggleSliderHandleProps) {
)
}

interface ToggleSliderBarProps extends CSSProperties {

}

function ToggleSliderBar(props: ToggleSliderBarProps) {
function ToggleSliderBar(props: CSSProperties) {
return (
<div style={props}/>
)
Expand Down Expand Up @@ -126,7 +122,7 @@ function ToggleSlider({

const [down, setDown] = useState(false);

function onPointerDown(e: React.PointerEvent) {
function onPointerDown() {
setDown(true);
}

Expand Down
Loading

0 comments on commit dae1557

Please sign in to comment.