Skip to content

Commit 0aedab1

Browse files
committed
Address lint warnings, create oxlint config file
1 parent 6b6f12c commit 0aedab1

6 files changed

Lines changed: 15 additions & 3 deletions

File tree

‎.oxlintrc.json‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "./node_modules/oxlint/configuration_schema.json",
3+
"ignorePatterns": ["packages/webpack-plugin/extracted.js"]
4+
}

‎packages/css/src/conditionalRulesets.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ export class ConditionalRuleset {
4646
}
4747

4848
getConditionalRulesetByPath(conditionPath: Array<Query>): ConditionalRuleset {
49-
let currRuleset: ConditionalRuleset = this;
49+
let currRuleset: ConditionalRuleset | undefined;
5050

5151
for (const query of conditionPath) {
52-
const condition = currRuleset.findOrCreateCondition(query);
52+
const condition = this.findOrCreateCondition(query);
5353

5454
currRuleset = condition.children;
5555
}
5656

57-
return currRuleset;
57+
return currRuleset || this;
5858
}
5959

6060
addRule(

‎test-helpers/src/startFixture/parcel.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ export const startParcelFixture = async (
3434
logLevel: 'verbose',
3535
});
3636

37+
// Not sure how to remove the `async` here
38+
// oxlint-disable-next-line no-async-promise-executor
3739
return new Promise(async (resolve, reject) => {
3840
const subscription = await bundler.watch((err, buildEvent) => {
3941
if (err) {

‎tests/e2e/fixture.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ type TestFixtures = {
77
let testCounter = 0;
88

99
const test = base.extend<TestFixtures>({
10+
// Playwright has to have a destructure as the first arg for some reason
11+
// oxlint-disable-next-line no-empty-pattern
1012
port: async ({}, use, workerInfo) => {
1113
const portRange = 100 * workerInfo.workerIndex;
1214
await use(9000 + portRange + testCounter++);

‎tests/recipes/recipes-type-tests.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const noop = (..._args: Array<any>) => {};
77

88
type AssertIsString<S> = S extends string ? true : never;
99

10+
// oxlint-disable-next-line no-unused-expressions
1011
() => {
1112
const textRecipes = recipe({
1213
variants: {

‎tests/sprinkles/sprinkles-type-tests.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919

2020
const noop = (..._args: Array<any>) => {};
2121

22+
// oxlint-disable-next-line no-unused-expressions
2223
() => {
2324
const sprinkles = createSprinkles(
2425
propertiesWithShorthands,
@@ -142,9 +143,11 @@ const noop = (..._args: Array<any>) => {};
142143
testGenericNormalizeValue('');
143144

144145
// @ts-expect-error - Strings shouldn't map to objects
146+
// oxlint-disable-next-line no-unused-expressions
145147
mapValue(alignProp, () => 'baz').mobile;
146148

147149
// @ts-expect-error - Numbers shouldn't map to objects
150+
// oxlint-disable-next-line no-unused-expressions
148151
mapValue(3, () => 4).mobile;
149152

150153
const mapValueWithoutDefaultCondition = createMapValueFn(

0 commit comments

Comments
 (0)