diff --git a/.gitattributes b/.gitattributes index 030ef144..e27f70fa 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,3 @@ *.pbxproj -text # specific for windows script files -*.bat text eol=crlf \ No newline at end of file +*.bat text eol=crlf diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..baf5d986 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,3 @@ +scripts/**/* +CODE_OF_CONDUCT.md +.eslintrc.js diff --git a/.yarnrc.yml b/.yarnrc.yml index d95b48b9..bdab70a5 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -4,8 +4,8 @@ nmHoistingLimits: workspaces plugins: - path: scripts/pod-install.cjs - path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs - spec: "@yarnpkg/plugin-interactive-tools" + spec: '@yarnpkg/plugin-interactive-tools' - path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs - spec: "@yarnpkg/plugin-workspace-tools" + spec: '@yarnpkg/plugin-workspace-tools' yarnPath: .yarn/releases/yarn-3.6.1.cjs diff --git a/README.md b/README.md index 917f912d..375df4e3 100644 --- a/README.md +++ b/README.md @@ -33,13 +33,18 @@ The library includes native code so you will need to re-build the native app. ## Usage ```tsx -import { MarkdownTextInput } from '@expensify/react-native-live-markdown'; +import {MarkdownTextInput} from '@expensify/react-native-live-markdown'; import React from 'react'; export default function App() { const [text, setText] = React.useState('Hello, *world*!'); - return ; + return ( + + ); } ``` @@ -50,7 +55,7 @@ export default function App() { It is also possible to customize the styling of the formatted contents of `MarkdownTextInput` component. The style object supports all color representations from React Native including `PlatformColor` and `DynamicColorIOS` according to the [color reference](https://reactnative.dev/docs/colors). Currently, a limited set of styles is customizable but this is subject to change in the future. ```tsx -import type { MarkdownStyle } from '@expensify/react-native-live-markdown'; +import type {MarkdownStyle} from '@expensify/react-native-live-markdown'; const markdownStyle: MarkdownStyle = { syntax: { diff --git a/example/README.md b/example/README.md index 12470c30..8bd066df 100644 --- a/example/README.md +++ b/example/README.md @@ -2,7 +2,7 @@ This is a new [**React Native**](https://reactnative.dev) project, bootstrapped # Getting Started ->**Note**: Make sure you have completed the [React Native - Environment Setup](https://reactnative.dev/docs/environment-setup) instructions till "Creating a new application" step, before proceeding. +> **Note**: Make sure you have completed the [React Native - Environment Setup](https://reactnative.dev/docs/environment-setup) instructions till "Creating a new application" step, before proceeding. ## Step 1: Start the Metro Server diff --git a/example/metro.config.js b/example/metro.config.js index b8232145..0030c6d1 100644 --- a/example/metro.config.js +++ b/example/metro.config.js @@ -1,11 +1,11 @@ -const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config'); +const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config'); const path = require('path'); const escape = require('escape-string-regexp'); const exclusionList = require('metro-config/src/defaults/exclusionList'); const pak = require('../package.json'); const root = path.resolve(__dirname, '..'); -const modules = Object.keys({ ...pak.peerDependencies }); +const modules = Object.keys({...pak.peerDependencies}); /** * Metro configuration @@ -19,12 +19,7 @@ const config = { // We need to make sure that only one version is loaded for peerDependencies // So we block them at the root, and alias them to the versions in example's node_modules resolver: { - blacklistRE: exclusionList( - modules.map( - (m) => - new RegExp(`^${escape(path.join(root, 'node_modules', m))}\\/.*$`) - ) - ), + blacklistRE: exclusionList(modules.map((m) => new RegExp(`^${escape(path.join(root, 'node_modules', m))}\\/.*$`))), extraNodeModules: modules.reduce((acc, name) => { acc[name] = path.join(__dirname, 'node_modules', name); diff --git a/lefthook.yml b/lefthook.yml index b003bb6b..949a694b 100644 --- a/lefthook.yml +++ b/lefthook.yml @@ -2,7 +2,7 @@ pre-commit: parallel: true commands: lint: - glob: "*.{js,ts,jsx,tsx}" + glob: '*.{js,ts,jsx,tsx}' run: npx eslint {staged_files} types_root: run: npx tsc --project tsconfig.json --noEmit