Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
500 changes: 86 additions & 414 deletions bun.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dprint.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
],
"plugins": [
"https://plugins.dprint.dev/typescript-0.95.15.wasm",
"https://plugins.dprint.dev/json-0.19.1.wasm"
"https://plugins.dprint.dev/json-0.21.3.wasm"
]
}
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@
},
"devDependencies": {
"typescript": "catalog:",
"dprint": "0.53.0",
"eslint": "9.39.1",
"eslint-config-codemask": "2.2.1",
"dprint": "0.54.0",
"oxlint": "1.61.0",
"oxlint-tsgolint": "0.21.1",
"husky": "9.1.7",
"turbo": "2.8.20"
"turbo": "2.9.6"
},
"packageManager": "bun@1.3.10",
"trustedDependencies": [
Expand Down
29 changes: 29 additions & 0 deletions packages/uniwind/.oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"options": {
"typeAware": true
},
"rules": {
"unicorn/no-empty-file": "off",
"typescript/strict-boolean-expressions": [
"error",
{
"allowAny": true,
"allowNullableBoolean": true,
"allowNullableEnum": true
}
],
"typescript/no-implied-eval": "off"
},
"ignorePatterns": [
"build.config.ts",
"types.d.ts",
"no-types.d.ts",
"src/metro/index.d.ts",
"src/vite/index.d.ts",
"dist",
"specs",
"jest.config.js",
"tests",
"babel.config.cjs"
]
}
43 changes: 0 additions & 43 deletions packages/uniwind/eslint.config.ts

This file was deleted.

4 changes: 2 additions & 2 deletions packages/uniwind/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"precommit": "bun lint",
"build": "unbuild",
"check:typescript": "tsc --noEmit",
"lint": "eslint src",
"lint:fix": "eslint src --fix",
"lint": "oxlint src",
"lint:fix": "oxlint src --fix",
"format": "dprint fmt",
"prepublishOnly": "bun run build",
"circular:check": "dpdm --no-warning --no-tree -T --exit-code circular:1 'src/**/*.ts' 'src/**/*.tsx'",
Expand Down
11 changes: 3 additions & 8 deletions packages/uniwind/src/core/config/config.common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { CSSVariables, GenerateStyleSheetsCallback, ThemeName } from '../types'

const SYSTEM_THEME = 'system' as const
// Platform.constants is not defined in RNW
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
const RN_VERSION = Platform.constants?.reactNativeVersion?.minor ?? 0
const UNSPECIFIED_THEME = RN_VERSION >= 82 ? 'unspecified' : undefined

Expand All @@ -18,7 +17,6 @@ export class UniwindConfigBuilder {
Appearance.addChangeListener(event => {
const colorScheme = event.colorScheme === 'unspecified'
? ColorScheme.Light
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
: event.colorScheme ?? ColorScheme.Light
const prevTheme = this.#currentTheme

Expand Down Expand Up @@ -52,7 +50,7 @@ export class UniwindConfigBuilder {
return colorScheme ?? ColorScheme.Light
}

// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
// oxlint-disable-next-line typescript/no-redundant-type-constituents
setTheme(theme: ThemeName | typeof SYSTEM_THEME) {
const prevTheme = this.#currentTheme
const prevHasAdaptiveThemes = this.#hasAdaptiveThemes
Expand Down Expand Up @@ -98,15 +96,12 @@ export class UniwindConfigBuilder {
}
}

updateCSSVariables(theme: ThemeName, variables: CSSVariables) {
updateCSSVariables(_: ThemeName, __: CSSVariables) {
// noop
theme
variables
}

updateInsets(insets: Insets) {
updateInsets(_: Insets) {
// noop
insets
}

protected __reinit(_: GenerateStyleSheetsCallback, themes: Array<string>) {
Expand Down
2 changes: 0 additions & 2 deletions packages/uniwind/src/core/logger.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable no-console */

export class Logger {
static log(message: string) {
console.log(`Uniwind - ${message}`)
Expand Down
1 change: 0 additions & 1 deletion packages/uniwind/src/core/native/parsers/transforms.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable max-depth */
const transforms = [
'translateX',
'translateY',
Expand Down
1 change: 0 additions & 1 deletion packages/uniwind/src/core/native/store.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable max-depth */
import { Dimensions, Platform } from 'react-native'
import { Platform as UniwindPlatform, UNIWIND_PLATFORM_VARIABLES, UNIWIND_THEME_VARIABLES } from '../../common/consts'
import { Orientation, StyleDependency } from '../../types'
Expand Down
3 changes: 1 addition & 2 deletions packages/uniwind/src/core/web/cssListener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ class CSSListenerBuilder {
const mediaQuery = this.classNameMediaQueryListeners.get(className)

if (!mediaQuery) {
// eslint-disable-next-line no-empty-function
return () => {}
}

Expand Down Expand Up @@ -129,7 +128,7 @@ class CSSListenerBuilder {
continue
}

// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, @typescript-eslint/strict-boolean-expressions
// oxlint-disable-next-line @typescript-eslint/strict-boolean-expressions
if (!rules) {
continue
}
Expand Down
1 change: 0 additions & 1 deletion packages/uniwind/src/hoc/withUniwind.native.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ const withManualUniwind = (Component: Component<AnyObject>, options: Record<Prop

const existingStyle = props[propName]

// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
if (existingStyle) {
acc.generatedProps[propName] = [styles, existingStyle]

Expand Down
3 changes: 1 addition & 2 deletions packages/uniwind/src/metro/addMetaToStylesTemplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ export const addMetaToStylesTemplate = (Processor: ProcessorBuilder, currentPlat
minWidth,
maxWidth,
colorScheme,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
important,
important: _,
importantProperties,
active,
focus,
Expand Down
2 changes: 0 additions & 2 deletions packages/uniwind/src/metro/logger.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable no-console */

const red = '\x1b[91m'
const yellow = '\x1b[33m'
const blue = '\x1b[36m'
Expand Down
3 changes: 1 addition & 2 deletions packages/uniwind/src/metro/metro-css-patches.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import path from 'path'

class FileStore<T> extends FileStoreBase<T> {
async set(key: Buffer, value: any): Promise<void> {
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
if (value?.output?.[0]?.data?.css?.skipCache) {
return
}
Expand All @@ -27,7 +26,7 @@ interface TraverseDependencies {
export const patchMetroGraphToSupportUncachedModules = () => {
const { Graph } = require('metro/private/DeltaBundler/Graph') as typeof import('metro/private/DeltaBundler/Graph')

// eslint-disable-next-line @typescript-eslint/unbound-method
// oxlint-disable-next-line @typescript-eslint/unbound-method
const original_traverseDependencies = Graph.prototype.traverseDependencies as unknown as TraverseDependencies

if (original_traverseDependencies.__patched) {
Expand Down
1 change: 0 additions & 1 deletion packages/uniwind/src/metro/processor/css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,6 @@ export class CSS {
return undefined
}

// eslint-disable-next-line @typescript-eslint/member-ordering
private static readonly TRANSFORM_TYPES = new Set([
'translate',
'translateX',
Expand Down
1 change: 0 additions & 1 deletion packages/uniwind/src/metro/processor/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ export class Functions {
.replace(/"/g, '')
.replace(new RegExp(unit, 'g'), '')

// eslint-disable-next-line @typescript-eslint/no-implied-eval, no-new-func
return new Function(`return ${numericValue} + '${unit}'`)()
} catch {
this.logger.error(`Invalid calc ${value}`)
Expand Down
1 change: 0 additions & 1 deletion packages/uniwind/src/metro/utils/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ export const uniq = <T>(arr: Array<T>) => Array.from(new Set(arr))

export const isValidJSValue = (jsValueString: string) => {
try {
// eslint-disable-next-line @typescript-eslint/no-implied-eval, no-new-func
new Function(`const test = ${jsValueString}`)

return true
Expand Down
1 change: 0 additions & 1 deletion packages/uniwind/src/metro/utils/serialize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ export const serializeJSObject = (obj: Record<string, any>, serializer: (key: st
serializedValues =>
serializedValues.filter(serializedValue => {
try {
// eslint-disable-next-line @typescript-eslint/no-implied-eval, no-new-func
new Function(`function validateJS() { const obj = ({ ${serializedValue} }) }`)

return true
Expand Down
1 change: 0 additions & 1 deletion packages/uniwind/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@ export const enum ColorScheme {
Dark = 'dark',
}

// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface UniwindConfig {}