Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ceceppa committed Jan 5, 2024
1 parent a508443 commit 6ffa996
Show file tree
Hide file tree
Showing 23 changed files with 30 additions and 36 deletions.
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,7 @@ module.exports = {
'**/website/**/*',
'**/coverage/**/*',
'**/__mocks__/**/*',
'packages/**/**/*.js',
'packages/**/**/*.d.ts',
],
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"doc": "cd website && yarn start",
"ts:check": "tsc --noEmit",
"lint": "eslint --ext .ts,.tsx ./packages",
"lint:fix": "yarn lint --fix",
"build": "yarn build:animations && yarn build:core && yarn build:extras && yarn build:forms && yarn build:internal && yarn build:lists && yarn build:react-native",
"test": "yarn --cwd packages/core test"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/animations/src/hooks/useAnimation.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useAMAContext } from '@react-native-ama/core';
import { interpolateAnimationStates } from '~internal';
import * as React from 'react';
import type { ViewStyle } from 'react-native';
import { Animated } from 'react-native';
import { interpolateAnimationStates } from '~internal';

type UseAnimation = {
from: ViewStyle;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { useAMAContext } from '@react-native-ama/core';
import { MOTION_ANIMATIONS } from '~internal';
import type { ViewProps, ViewStyle } from 'react-native';
import {
EntryAnimationsValues,
Expand All @@ -8,6 +7,7 @@ import {
StyleProps,
withTiming,
} from 'react-native-reanimated';
import { MOTION_ANIMATIONS } from '~internal';

export type ToAnimation = ViewProps['style'];

Expand Down
2 changes: 1 addition & 1 deletion packages/animations/src/hooks/useReanimatedTiming.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as AMAProvider from '@react-native-ama/core';
import { MOTION_ANIMATIONS } from '~internal';
import { renderHook } from '@testing-library/react-native';
import { MOTION_ANIMATIONS } from '~internal';

import { useReanimatedTiming } from './useReanimatedTiming';

Expand Down
2 changes: 1 addition & 1 deletion packages/animations/src/hooks/useReanimatedTiming.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { useAMAContext } from '@react-native-ama/core';
import type { MotionAnimationKey } from '~internal';
import React from 'react';
import {
AnimationCallback,
Expand All @@ -8,6 +7,7 @@ import {
WithSpringConfig,
WithTimingConfig,
} from 'react-native-reanimated';
import type { MotionAnimationKey } from '~internal';

import { isMotionAnimation } from '../utils/isMotionAnimation';

Expand Down
5 changes: 1 addition & 4 deletions packages/animations/src/utils/isMotionAnimation.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import {
MOTION_ANIMATIONS,
type MotionAnimationKey,
} from '~internal';
import { MOTION_ANIMATIONS, type MotionAnimationKey } from '~internal';

export const isMotionAnimation = (key: MotionAnimationKey) => {
return MOTION_ANIMATIONS.includes(key);
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/components/AMAProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* eslint-disable react-native/no-inline-styles */

import { RED } from '~internal';
import * as React from 'react';
import {
AccessibilityChangeEventName,
Expand All @@ -9,6 +8,7 @@ import {
Text,
View,
} from 'react-native';
import { RED } from '~internal';

type AMAProviderProps = {
children: React.ReactNode;
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/hooks/useButtonChecks.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { applyStyle } from '~internal';
import type React from 'react';
import type { PressableStateCallbackType } from 'react-native';
import { applyStyle } from '~internal';

import { useChecks } from './useChecks';

Expand Down
12 changes: 6 additions & 6 deletions packages/core/src/hooks/useChecks.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
import * as React from 'react';
import {
AccessibilityRole,
InteractionManager,
LayoutChangeEvent,
} from 'react-native';
import {
ERROR_STYLE,
LogParams,
Expand All @@ -18,12 +24,6 @@ import {
type UppercaseChecker,
type UppercaseStringChecker,
} from '~internal';
import * as React from 'react';
import {
AccessibilityRole,
InteractionManager,
LayoutChangeEvent,
} from 'react-native';

import { isDevContextValue, useAMAContext } from '../components/AMAProvider';

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/hooks/useFocus.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SHELL_COLORS } from '~internal';
import { renderHook } from '@testing-library/react-native';
import { SHELL_COLORS } from '~internal';

import { useFocus } from './useFocus';

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/hooks/useFocus.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { SHELL_COLORS } from '~internal';
import * as React from 'react';
import { AccessibilityInfo, findNodeHandle } from 'react-native';
import { SHELL_COLORS } from '~internal';

export const useFocus = (refComponent?: React.RefObject<any>) => {
const setFocus = React.useCallback(
Expand Down
2 changes: 1 addition & 1 deletion packages/forms/src/components/Form.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useChecks, useFocus } from '@react-native-ama/core';
import { isFocused } from '~internal';
import * as React from 'react';
import { InteractionManager } from 'react-native';
import { isFocused } from '~internal';

export type FormProps = React.PropsWithChildren<{
onSubmit: () => boolean | Promise<boolean>;
Expand Down
2 changes: 1 addition & 1 deletion packages/forms/src/components/TextInput.test.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as UseChecks from '@react-native-ama/core/src/hooks/useChecks';
import { ERROR_STYLE } from '~internal';
import { fireEvent, render } from '@testing-library/react-native';
import * as React from 'react';
import { Text } from 'react-native';
import { ERROR_STYLE } from '~internal';

import * as UseFormField from '../hooks/useFormField';
import { TextInput } from './TextInput';
Expand Down
4 changes: 2 additions & 2 deletions packages/forms/src/components/TextInput.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { HideChildrenFromAccessibilityTree } from '@react-native-ama/core';
import { useChecks } from '@react-native-ama/core';
import { applyStyle } from '~internal';
import { maybeGenerateStringFromElement } from '~internal';
import * as React from 'react';
import {
TextInput as RNTextInput,
TextInputProps as RNTextInputProps,
} from 'react-native';
import { applyStyle } from '~internal';
import { maybeGenerateStringFromElement } from '~internal';

import { useTextInput } from '../hooks/useTextInput';

Expand Down
2 changes: 1 addition & 1 deletion packages/forms/src/hooks/useFormField.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useChecks } from '@react-native-ama/core';
import { applyStyle } from '~internal';
import React from 'react';
import { Keyboard, ViewStyle } from 'react-native';
import { applyStyle } from '~internal';

import { useForm } from '../components/Form';

Expand Down
2 changes: 1 addition & 1 deletion packages/forms/src/hooks/useTextInput.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { useChecks } from '@react-native-ama/core';
import { applyStyle } from '~internal';
import * as React from 'react';
import type {
LayoutChangeEvent,
Expand All @@ -10,6 +9,7 @@ import type {
TextStyle,
ViewStyle,
} from 'react-native';
import { applyStyle } from '~internal';

import { TextInputProps } from '../components/TextInput';
import { UseFormField, useFormField } from './useFormField';
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native/src/components/SwitchListItem.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { HideChildrenFromAccessibilityTree } from '@react-native-ama/core';
import { maybeGenerateStringFromElement } from '~internal';
import React from 'react';
import type { StyleProp, SwitchProps, ViewStyle } from 'react-native';
import { StyleSheet, Switch } from 'react-native';
import { maybeGenerateStringFromElement } from '~internal';

import { SwitchWrapper } from './SwitchWrapper';

Expand Down
5 changes: 1 addition & 4 deletions packages/react-native/src/components/SwitchWrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
import {
MINIMUM_TOUCHABLE_SIZE,
type AMAAccessibilityState,
} from '~internal';
import React from 'react';
import {
AccessibilityState,
Expand All @@ -10,6 +6,7 @@ import {
ViewProps,
} from 'react-native';
import { StyleSheet, TouchableWithoutFeedback } from 'react-native';
import { MINIMUM_TOUCHABLE_SIZE, type AMAAccessibilityState } from '~internal';

import { useSwitch } from '../hooks/useSwitch';

Expand Down
2 changes: 1 addition & 1 deletion packages/react-native/src/components/Text.test.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as UseChecks from '@react-native-ama/core/src/hooks/useChecks';
import * as UseFocus from '@react-native-ama/core/src/hooks/useFocus';
import { ERROR_STYLE } from '~internal';
import { render } from '@testing-library/react-native';
import * as React from 'react';
import { ERROR_STYLE } from '~internal';

import { Text } from './Text';

Expand Down
2 changes: 1 addition & 1 deletion packages/react-native/src/components/Text.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useChecks, useFocus } from '@react-native-ama/core';
import { applyStyle } from '~internal';
import * as React from 'react';
import { Text as RNText, TextProps as RNTextProps } from 'react-native';
import { applyStyle } from '~internal';

export type TextProps = RNTextProps & {
autofocus?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native/src/hooks/usePressable.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as UseChecks from '@react-native-ama/core/src/hooks/useChecks';
import { ERROR_STYLE } from '~internal';
import { act, renderHook, waitFor } from '@testing-library/react-native';
import { ERROR_STYLE } from '~internal';

import { usePressable } from './usePressable';

Expand Down
5 changes: 1 addition & 4 deletions packages/react-native/src/hooks/useSwitch.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import { useButtonChecks } from '@react-native-ama/core';
import {
applyStyle,
generateAccessibilityStateFromProp,
} from '~internal';
import React from 'react';
import type { ViewProps } from 'react-native';
import type { AccessibilityState } from 'react-native';
import { applyStyle, generateAccessibilityStateFromProp } from '~internal';

type UseSwitch = Omit<
ViewProps,
Expand Down

0 comments on commit 6ffa996

Please sign in to comment.