Skip to content

Commit

Permalink
🎨 update eslint and migrate to ts
Browse files Browse the repository at this point in the history
  • Loading branch information
CubeSugarCheese committed Dec 2, 2024
1 parent 9f67c25 commit a7ddf17
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 14 deletions.
17 changes: 16 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@ module.exports = {
extends: ['@react-native', 'expo', 'prettier', 'plugin:react/jsx-runtime'],
plugins: ['prettier'],
rules: {
'prettier/prettier': 'warn',
'prettier/prettier': [
'warn',
{
endOfLine: 'auto',
},
],
'comma-dangle': [
'warn',
{
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
functions: 'only-multiline',
},
],
},
};
11 changes: 0 additions & 11 deletions metro.config.js

This file was deleted.

10 changes: 10 additions & 0 deletions metro.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Learn more https://docs.expo.io/guides/customizing-metro
import { getDefaultConfig } from 'expo/metro-config';
import { withNativeWind } from 'nativewind/metro';

const config = getDefaultConfig(__dirname);

export default withNativeWind(config, {
input: './global.css',
inlineRem: false,
} as any); // getCSSForPlatform 被错误标记为必需,但实际不需要
7 changes: 5 additions & 2 deletions tailwind.config.js → tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
import { type Config } from 'tailwindcss';

const config: Config = {
content: ['./{app,components,constants,hooks}/**/*.{js,jsx,ts,tsx}'],
presets: [require('nativewind/preset')],
theme: {
Expand All @@ -11,3 +12,5 @@ module.exports = {
require('@tailwindcss/forms'),
],
};

export default config;

0 comments on commit a7ddf17

Please sign in to comment.