Skip to content

Commit

Permalink
Prettier in CI (#1149)
Browse files Browse the repository at this point in the history
  • Loading branch information
amitdahan authored Aug 1, 2024
1 parent 1b50ad6 commit 6f7fdef
Show file tree
Hide file tree
Showing 185 changed files with 691 additions and 649 deletions.
6 changes: 3 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ CONTRIBUTING.md
Please fill the following form (leave what's relevant)
-->

| Q | A |
| ---------------- | --- |
| Q | A |
| ---------------- | ----- |
| Bug fix? | ✔/✖ |
| New feature? | ✔/✖ |
| Breaking change? | ✔/✖ |
| Deprecations? | ✔/✖ |
| Documentation? | ✔/✖ |
| Tests added? | ✔/✖ |
| Types added? | ✔/✖ |
| Related issues | |
| Related issues | |

<!-- Describe your changes below in detail. -->
2 changes: 2 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ jobs:
run: yarn build
- name: Test
run: yarn test
- name: Format
run: yarn format
- name: Lint
run: yarn lint
- name: Release
Expand Down
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules/
dist/
dist/
.yarn/
2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ nodeLinker: node-modules

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"
spec: '@yarnpkg/plugin-interactive-tools'

yarnPath: .yarn/releases/yarn-3.5.1.cjs
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"build": "vx build",
"test": "vx test",
"release": "vx release",
"format": "prettier -c .",
"lint": "eslint . --ignore-path .gitignore",
"prepare": "husky install",
"dev": "vx dev",
Expand Down Expand Up @@ -34,6 +35,7 @@
"eslint-plugin-jest": "^27.9.0",
"husky": "^8.0.3",
"lodash": "^4.17.21",
"prettier": "^3.3.1",
"pretty-quick": "^3.3.1",
"tsc": "^2.0.4",
"tslib": "^2.6.3",
Expand Down
16 changes: 8 additions & 8 deletions packages/anyone/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if (one(var1, var2, var3)) {
all(
validateInput1, // returns true
validateInput2, // returns false
validateInput3 // no need to run this, we already know our validation failed
validateInput3, // no need to run this, we already know our validation failed
);
```

Expand Down Expand Up @@ -60,7 +60,7 @@ import all from 'anyone/all';
any(
someFunction, // evaluates to false
1,
someVar // truthy
someVar, // truthy
);
// true

Expand All @@ -69,7 +69,7 @@ any(
any(
someFunction, // evaluates to false
0,
someVar // falsy
someVar, // falsy
);
// false

Expand All @@ -78,7 +78,7 @@ any(
one(
someFunction, // evaluates to false
0,
someVar // truthy
someVar, // truthy
);
// true

Expand All @@ -87,7 +87,7 @@ one(
none(
someFunction, // evaluates to false
1,
someVar // truthy
someVar, // truthy
);
// false

Expand All @@ -96,7 +96,7 @@ none(
none(
someFunction, // evaluates to false
0,
someVar // falsy
someVar, // falsy
);
// true

Expand All @@ -105,7 +105,7 @@ none(
all(
someFunction, // evaluates to false
0,
someVar // truthy
someVar, // truthy
);
// false

Expand All @@ -114,7 +114,7 @@ all(
all(
someFunction, // evaluates to true
1,
someVar // truthy
someVar, // truthy
);
// true
```
18 changes: 9 additions & 9 deletions packages/anyone/src/__tests__/all.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ describe('methods/all', () => {
expect(
all(
...Array.from({ length: random(1, 10) }, (_, i) =>
i % 2 === 0 ? sample(FALSY_VALUES) : sample(FALSY_VALUES)
)
)
i % 2 === 0 ? sample(FALSY_VALUES) : sample(FALSY_VALUES),
),
),
).toBe(false);
});
});
Expand All @@ -22,9 +22,9 @@ describe('methods/all', () => {
expect(
all(
...Array.from({ length: random(1, 10) }, (_, i) =>
i % 2 === 0 ? sample(TRUTHY_VALUES) : sample(TRUTHY_VALUES)
)
)
i % 2 === 0 ? sample(TRUTHY_VALUES) : sample(TRUTHY_VALUES),
),
),
).toBe(true);
});
});
Expand All @@ -34,12 +34,12 @@ describe('methods/all', () => {
expect(
all.apply(null, [
...Array.from({ length: random(1, 10) }, (_, i) =>
i % 2 === 0 ? sample(FALSY_VALUES) : sample(FALSY_VALUES)
i % 2 === 0 ? sample(FALSY_VALUES) : sample(FALSY_VALUES),
),
...Array.from({ length: random(1, 10) }, (_, i) =>
i % 2 === 0 ? sample(TRUTHY_VALUES) : sample(TRUTHY_VALUES)
i % 2 === 0 ? sample(TRUTHY_VALUES) : sample(TRUTHY_VALUES),
),
])
]),
).toBe(false);
});
});
Expand Down
22 changes: 11 additions & 11 deletions packages/anyone/src/__tests__/any.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ describe('methods/any', () => {
expect(
any(
...Array.from({ length: random(1, 10) }, (_, i) =>
i % 2 === 0 ? sample(FALSY_VALUES) : sample(FALSY_VALUES)
)
)
i % 2 === 0 ? sample(FALSY_VALUES) : sample(FALSY_VALUES),
),
),
).toBe(false);
});
});
Expand All @@ -22,9 +22,9 @@ describe('methods/any', () => {
expect(
any(
...Array.from({ length: random(1, 10) }, (_, i) =>
i % 2 === 0 ? sample(TRUTHY_VALUES) : sample(TRUTHY_VALUES)
)
)
i % 2 === 0 ? sample(TRUTHY_VALUES) : sample(TRUTHY_VALUES),
),
),
).toBe(true);
});
});
Expand All @@ -34,10 +34,10 @@ describe('methods/any', () => {
expect(
any.apply(null, [
...Array.from({ length: random(1, 10) }, (_, i) =>
i % 2 === 0 ? sample(FALSY_VALUES) : sample(FALSY_VALUES)
i % 2 === 0 ? sample(FALSY_VALUES) : sample(FALSY_VALUES),
),
sample(TRUTHY_VALUES),
])
]),
).toBe(true);
});
});
Expand All @@ -47,12 +47,12 @@ describe('methods/any', () => {
expect(
any.apply(null, [
...Array.from({ length: random(1, 10) }, (_, i) =>
i % 2 === 0 ? sample(FALSY_VALUES) : sample(FALSY_VALUES)
i % 2 === 0 ? sample(FALSY_VALUES) : sample(FALSY_VALUES),
),
...Array.from({ length: random(1, 10) }, (_, i) =>
i % 2 === 0 ? sample(TRUTHY_VALUES) : sample(TRUTHY_VALUES)
i % 2 === 0 ? sample(TRUTHY_VALUES) : sample(TRUTHY_VALUES),
),
])
]),
).toBe(true);
});
});
Expand Down
22 changes: 11 additions & 11 deletions packages/anyone/src/__tests__/none.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ describe('methods/none', () => {
expect(
none(
...Array.from({ length: random(1, 10) }, (_, i) =>
i % 2 === 0 ? sample(FALSY_VALUES) : sample(FALSY_VALUES)
)
)
i % 2 === 0 ? sample(FALSY_VALUES) : sample(FALSY_VALUES),
),
),
).toBe(true);
});
});
Expand All @@ -22,9 +22,9 @@ describe('methods/none', () => {
expect(
none(
...Array.from({ length: random(1, 10) }, (_, i) =>
i % 2 === 0 ? sample(TRUTHY_VALUES) : sample(TRUTHY_VALUES)
)
)
i % 2 === 0 ? sample(TRUTHY_VALUES) : sample(TRUTHY_VALUES),
),
),
).toBe(false);
});
});
Expand All @@ -34,10 +34,10 @@ describe('methods/none', () => {
expect(
none.apply(null, [
...Array.from({ length: random(1, 10) }, (_, i) =>
i % 2 === 0 ? sample(FALSY_VALUES) : sample(FALSY_VALUES)
i % 2 === 0 ? sample(FALSY_VALUES) : sample(FALSY_VALUES),
),
sample(TRUTHY_VALUES),
])
]),
).toBe(false);
});
});
Expand All @@ -47,12 +47,12 @@ describe('methods/none', () => {
expect(
none.apply(null, [
...Array.from({ length: random(1, 10) }, (_, i) =>
i % 2 === 0 ? sample(FALSY_VALUES) : sample(FALSY_VALUES)
i % 2 === 0 ? sample(FALSY_VALUES) : sample(FALSY_VALUES),
),
...Array.from({ length: random(1, 10) }, (_, i) =>
i % 2 === 0 ? sample(TRUTHY_VALUES) : sample(TRUTHY_VALUES)
i % 2 === 0 ? sample(TRUTHY_VALUES) : sample(TRUTHY_VALUES),
),
])
]),
).toBe(false);
});
});
Expand Down
22 changes: 11 additions & 11 deletions packages/anyone/src/__tests__/one.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ describe('methods/one', () => {
expect(
one(
...Array.from({ length: random(1, 10) }, (_, i) =>
i % 2 === 0 ? sample(FALSY_VALUES) : sample(FALSY_VALUES)
)
)
i % 2 === 0 ? sample(FALSY_VALUES) : sample(FALSY_VALUES),
),
),
).toBe(false);
});
});
Expand All @@ -22,9 +22,9 @@ describe('methods/one', () => {
expect(
one(
...Array.from({ length: random(2, 10) }, (_, i) =>
i % 2 === 0 ? sample(TRUTHY_VALUES) : sample(TRUTHY_VALUES)
)
)
i % 2 === 0 ? sample(TRUTHY_VALUES) : sample(TRUTHY_VALUES),
),
),
).toBe(false);
});
});
Expand All @@ -34,10 +34,10 @@ describe('methods/one', () => {
expect(
one(
...Array.from({ length: random(1, 10) }, (_, i) =>
i % 2 === 0 ? sample(FALSY_VALUES) : sample(FALSY_VALUES)
i % 2 === 0 ? sample(FALSY_VALUES) : sample(FALSY_VALUES),
),
sample(TRUTHY_VALUES)
)
sample(TRUTHY_VALUES),
),
).toBe(true);
});
});
Expand All @@ -47,8 +47,8 @@ describe('methods/one', () => {
expect(
one(
...Array.from({ length: random(2, 10) }, () => sample(TRUTHY_VALUES)),
...Array.from({ length: random(1, 10) }, () => sample(FALSY_VALUES))
)
...Array.from({ length: random(1, 10) }, () => sample(FALSY_VALUES)),
),
).toBe(false);
});
});
Expand Down
10 changes: 5 additions & 5 deletions packages/anyone/src/__tests__/runAnyoneMethods.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@ import run from 'runAnyoneMethods';
describe('lib/run', () => {
describe('When value is falsy', () => {
it.each([FALSY_VALUES])('Should return `false` ("%s")', value =>
expect(run(value)).toBe(false)
expect(run(value)).toBe(false),
);
});

describe('When value is truthy', () => {
it.each([TRUTHY_VALUES])('Should return `true` ("%s")', value =>
expect(run(value)).toBe(true)
expect(run(value)).toBe(true),
);
});

describe('When value is a function', () => {
describe('When value is falsy', () => {
it.each([FALSY_VALUES])('Should return `false` ("%s")', value =>
expect(run(() => value)).toBe(false)
expect(run(() => value)).toBe(false),
);
});

describe('When value is truthy', () => {
it.each([TRUTHY_VALUES])('Should return `true` ("%s")', value =>
expect(run(() => value)).toBe(true)
expect(run(() => value)).toBe(true),
);
});
});
Expand All @@ -34,7 +34,7 @@ describe('lib/run', () => {
expect(
run(() => {
throw new Error();
})
}),
).toBe(false);
});
});
Expand Down
2 changes: 1 addition & 1 deletion packages/context/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ import ctx from './ctx';

function handleCart() {
const context = ctx.useX(
'handleCart was called outside of a running context'
'handleCart was called outside of a running context',
); // { cart: { items: [ 'foo', 'bar' ] } }
// This throws an error if we're not within a `run` call.
// You should catch this error and handle it somewhere above this function.
Expand Down
Loading

0 comments on commit 6f7fdef

Please sign in to comment.