Skip to content

Commit

Permalink
chore: update yarn and eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
spawnia authored Dec 8, 2023
1 parent d20801a commit a80b0fb
Show file tree
Hide file tree
Showing 9 changed files with 12,044 additions and 8,356 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ jobs:
eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- uses: actions/setup-node@v2
- uses: actions/setup-node@v4
- run: corepack enable
- run: yarn install
- run: yarn run format
- run: yarn run fix
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "refactor: Apply eslint fix"
7 changes: 5 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@ on:
push:
branches:
- master
- alpha

jobs:
# https://docs.github.com/en/actions/guides/publishing-nodejs-packages#publishing-packages-using-yarn
# https://github.com/semantic-release/semantic-release/blob/master/docs/recipes/github-actions.md
package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- run: corepack enable
- run: yarn install
- run: yarn run build
- run: npx semantic-release
Expand Down
20 changes: 12 additions & 8 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,35 @@ jobs:
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- run: corepack enable
- run: yarn install
- run: yarn run typecheck

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- run: corepack enable
- run: yarn install
- run: yarn run lint

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- run: corepack enable
- run: yarn install
- run: yarn run test

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- run: corepack enable
- run: yarn install
- run: yarn run build
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,12 @@ dist/
storybook-static/
*.log
.idea

# https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
16 changes: 11 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"test:watch": "jest --watch",
"typecheck": "tsc --noEmit",
"lint": "eslint --ignore-path .gitignore --ext .ts .",
"format": "yarn run lint --fix",
"fix": "yarn run lint --fix",
"release": "standard-version"
},
"repository": {
Expand Down Expand Up @@ -47,8 +47,8 @@
"@babel/plugin-transform-runtime": "^7.13.6",
"@babel/preset-env": "^7.13.0",
"@babel/runtime": "^7.13.6",
"@mll-lab/eslint-config": "^1.19.0",
"@mll-lab/eslint-plugin": "^1.3.1",
"@mll-lab/eslint-config": "^3.1.0",
"@mll-lab/eslint-plugin": "^1.3.4",
"@mll-lab/prettier-config": "^1.0.0",
"@mll-lab/tsconfig": "^1.1.0",
"@rollup/plugin-babel": "^5.3.0",
Expand All @@ -60,17 +60,23 @@
"@types/jest": "^26.0.20",
"@types/lodash": "4.14.136",
"@types/node": "^14.14.31",
"@typescript-eslint/eslint-plugin": "^6.13.2",
"@typescript-eslint/parser": "^6.13.2",
"babel-jest": "^26.6.3",
"babel-loader": "^8.2.2",
"babel-plugin-require-context-hook": "^1.0.0",
"eslint": "^8.55.0",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-unused-imports": "^3.0.0",
"jest": "^26.6.3",
"prettier": "^2.2.1",
"prettier": "^3.1.0",
"rollup": "^2.45.2",
"rollup-plugin-peer-deps-external": "^2.2.4",
"semantic-release": "^17.4.0",
"ts-jest": "^26.5.1",
"ts-loader": "^8.0.17",
"ts-node": "^9.1.1",
"typescript": "^4.8.2"
}
},
"packageManager": "yarn@4.0.2"
}
4 changes: 2 additions & 2 deletions src/device.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('isMobileDevice', () => {
() =>
({
userAgent: 'Android',
} as Navigator & typeof global),
}) as Navigator & typeof global,
);
expect(isMobileDevice()).toBeTruthy();
});
Expand All @@ -16,7 +16,7 @@ describe('isMobileDevice', () => {
() =>
({
userAgent: 'Firefox',
} as Navigator & typeof global),
}) as Navigator & typeof global,
);
expect(isMobileDevice()).toBeFalsy();
});
Expand Down
8 changes: 5 additions & 3 deletions src/promise.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ describe('mapSequentially', () => {
});

it('throws and aborts if callback throws', async () => {
const callback = jest.fn().mockImplementation((value) => {
throw new Error(value);
});
const callback = jest
.fn()
.mockImplementation((value: string | undefined) => {
throw new Error(value);
});

const foo = 'foo';
await expect(async () => {
Expand Down
Loading

0 comments on commit a80b0fb

Please sign in to comment.