Skip to content

Commit 7355a9b

Browse files
committed
refactor: migrate from nativewind to uniwind
1 parent 829da2f commit 7355a9b

32 files changed

Lines changed: 947 additions & 660 deletions

babel.config.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ module.exports = function (api) {
22
api.cache(true);
33
return {
44
presets: [
5-
['babel-preset-expo', { jsxImportSource: 'nativewind' }],
6-
'nativewind/babel',
5+
'babel-preset-expo',
76
],
87
plugins: [
98
[

eslint.config.mjs

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import path from 'node:path';
22
import { fileURLToPath } from 'node:url';
33

44
import antfu from '@antfu/eslint-config';
5+
import betterTailwindcss from 'eslint-plugin-better-tailwindcss';
56
import i18nJsonPlugin from 'eslint-plugin-i18n-json';
67
import reactCompiler from 'eslint-plugin-react-compiler';
7-
import tailwind from 'eslint-plugin-tailwindcss';
88
import testingLibrary from 'eslint-plugin-testing-library';
99

1010
const __dirname = path.dirname(fileURLToPath(import.meta.url));
@@ -82,6 +82,7 @@ export default antfu(
8282
files: ['**/*.ts', '**/*.tsx'],
8383
rules: {
8484
'ts/consistent-type-definitions': ['error', 'type'], // Prefer type over interface
85+
'react-hooks/refs': 'off', // Allow useRef without exhaustive-deps
8586
'ts/consistent-type-imports': [
8687
'warn',
8788
{
@@ -93,15 +94,22 @@ export default antfu(
9394
},
9495
},
9596

96-
// TailwindCSS plugin
97-
...tailwind.configs['flat/recommended'].map(config => ({
98-
...config,
97+
// Better TailwindCSS plugin
98+
{
99+
files: ['**/*.{js,jsx,ts,tsx}'],
100+
...betterTailwindcss.configs.recommended,
101+
settings: {
102+
'better-tailwindcss': {
103+
entryPoint: path.resolve(__dirname, './src/global.css'),
104+
},
105+
},
99106
rules: {
100-
...config.rules,
101-
'tailwindcss/classnames-order': ['warn', { officialSorting: true }],
102-
'tailwindcss/no-custom-classname': 'off',
107+
...betterTailwindcss.configs.recommended.rules,
108+
'better-tailwindcss/no-unnecessary-whitespace': 'warn',
109+
'better-tailwindcss/no-unknown-classes': 'warn',
110+
'better-tailwindcss/enforce-consistent-line-wrapping': 'off', // Can be too strict for some cases
103111
},
104-
})),
112+
},
105113

106114
// React Compiler plugin
107115
{

global.css

Lines changed: 0 additions & 3 deletions
This file was deleted.

metro.config.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
/* eslint-env node */
22

33
const { getDefaultConfig } = require('expo/metro-config');
4-
const { withNativeWind } = require('nativewind/metro');
4+
const { withUniwindConfig } = require('uniwind/metro');
55

66
const config = getDefaultConfig(__dirname);
77

8-
module.exports = withNativeWind(config, { input: './global.css' });
8+
module.exports = withUniwindConfig(config, {
9+
cssEntryFile: './src/global.css',
10+
});

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@
6969
"i18next": "^25.8.0",
7070
"lodash.memoize": "^4.1.2",
7171
"moti": "^0.30.0",
72-
"nativewind": "^4.2.1",
7372
"react": "19.1.0",
7473
"react-dom": "19.1.0",
7574
"react-error-boundary": "^6.1.0",
@@ -93,6 +92,7 @@
9392
"react-query-kit": "^3.3.2",
9493
"tailwind-merge": "^3.4.0",
9594
"tailwind-variants": "^3.2.2",
95+
"uniwind": "^1.2.4",
9696
"zod": "^4.3.5",
9797
"zustand": "^5.0.10"
9898
},
@@ -104,6 +104,7 @@
104104
"@dev-plugins/react-query": "^0.4.0",
105105
"@eslint-react/eslint-plugin": "^2.7.2",
106106
"@expo/config": "~12.0.13",
107+
"@tailwindcss/cli": "^4.0.0",
107108
"@testing-library/jest-dom": "^6.9.1",
108109
"@testing-library/react-native": "^13.3.3",
109110
"@types/i18n-js": "^4.0.1",
@@ -116,12 +117,12 @@
116117
"dotenv": "^17.2.3",
117118
"eslint": "^9.39.2",
118119
"eslint-import-resolver-typescript": "^4.4.4",
120+
"eslint-plugin-better-tailwindcss": "^4.0.1",
119121
"eslint-plugin-i18n-json": "^4.0.1",
120122
"eslint-plugin-import": "^2.32.0",
121123
"eslint-plugin-react-compiler": "19.1.0-rc.2",
122124
"eslint-plugin-react-hooks": "^7.0.1",
123125
"eslint-plugin-react-refresh": "^0.4.26",
124-
"eslint-plugin-tailwindcss": "^3.18.2",
125126
"eslint-plugin-testing-library": "^7.15.4",
126127
"eslint-plugin-unicorn": "^62.0.0",
127128
"husky": "^9.1.7",
@@ -131,7 +132,7 @@
131132
"jest-junit": "^16.0.0",
132133
"lint-staged": "^16.2.7",
133134
"np": "^10.3.0",
134-
"tailwindcss": "3.4.19",
135+
"tailwindcss": "4.1.18",
135136
"ts-jest": "^29.4.6",
136137
"typescript": "^5.9.3"
137138
},

0 commit comments

Comments
 (0)