Skip to content

Commit

Permalink
fix: config improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
welingtonms committed Jun 20, 2022
1 parent 19b2ce2 commit e8690cd
Show file tree
Hide file tree
Showing 12 changed files with 6,263 additions and 22,686 deletions.
28 changes: 16 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,18 @@ name: Release

on:
push:
branches: [main]
branches: [main, beta]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x]
node-version: [16.x]

steps:
- uses: actions/checkout@v2
Expand All @@ -22,18 +25,19 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm ci

run: yarn install --immutable # based on https://circleci.com/docs/2.0/yarn/
- name: Running unit tests
run: yarn test
- name: Running code coverage
run: npm run coverage

# - name: Coveralls
# uses: coverallsapp/github-action@master
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}

run: yarn coverage
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build
run: yarn build
- name: Release
run: npm run release
run: yarn release || true
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
22 changes: 22 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module.exports = {
useTabs: true,
tabWidth: 4,
printWidth: 80,
singleQuote: true,
trailingComma: 'es5',
bracketSpacing: true,
parenSpacing: true,
jsxBracketSameLine: false,
semi: true,
arrowParens: 'always',
jsxBracketSameLine: false,
overrides: [
{
files: '*.{css,sass,scss}',
options: {
singleQuote: false,
parenSpacing: false,
},
},
],
};
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,34 @@

A custom React hook that wraps the existing useState to be used similarly to jQuery's [.val()](https://api.jquery.com/val/).


## Usage

```jsx
import { useValue } from '@cheesebit/use-value';
import { useValue } from '@welingtonms/use-value';

function CollapseSample() {
const collapsed = useValue(false)
const collapsed = useValue(false);

return (
<div>
{collapsed() ? 'ON' : 'OFF'}
<button
type="button"
onClick={() => {
collapsed(!collapsed())
collapsed(!collapsed());
}}
>
Toggle like this
</button>
<button
type="button"
onClick={() => {
collapsed(isCollapsed => !isCollapsed)
collapsed((isCollapsed) => !isCollapsed);
}}
>
Or like this
</button>
</div>
)
);
}
```
5 changes: 4 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
module.exports = {
presets: [["@babel/preset-env", { targets: { node: "current" } }], "@babel/preset-typescript"],
presets: [
[ '@babel/preset-env', { targets: { node: 'current' } } ],
'@babel/preset-typescript',
],
};
Loading

0 comments on commit e8690cd

Please sign in to comment.