Skip to content

Commit aa1a61a

Browse files
authored
chore: Enforce consistent type imports (#6727)
1 parent d3b9ea6 commit aa1a61a

File tree

659 files changed

+1616
-1453
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

659 files changed

+1616
-1453
lines changed

.eslintrc.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@ module.exports = {
1111
},
1212
'import/parsers': {
1313
'@typescript-eslint/parser': ['.ts', '.tsx']
14+
// plugins: ['@typescript-eslint'],
15+
// rules: {
16+
// '@typescript-eslint/consistent-type-imports': [
17+
// 'error',
18+
// {
19+
// prefer: 'type-imports', // enforce `import type`
20+
// disallowTypeAnnotations: true // disallow `import { type Foo }`
21+
// // fixStyle: 'inline-type-imports' // keeps type imports inline rather than grouped
22+
// }
23+
// ]
24+
// }
1425
}
1526
},
1627
parser: '@babel/eslint-parser',
@@ -219,6 +230,14 @@ module.exports = {
219230
ignoreRestSiblings: true
220231
}
221232
],
233+
'@typescript-eslint/consistent-type-imports': [
234+
'error',
235+
{
236+
prefer: 'type-imports',
237+
disallowTypeAnnotations: true,
238+
fixStyle: 'inline-type-imports'
239+
}
240+
],
222241
'new-cap': 'off',
223242
'lines-between-class-members': 'off',
224243
'react-hooks/rules-of-hooks': 'error',

app/AppContainer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { NavigationContainer } from '@react-navigation/native';
33
import { createNativeStackNavigator } from '@react-navigation/native-stack';
44
import { connect } from 'react-redux';
55

6-
import { SetUsernameStackParamList, StackParamList } from './definitions/navigationTypes';
6+
import type { SetUsernameStackParamList, StackParamList } from './definitions/navigationTypes';
77
import Navigation from './lib/navigation/appNavigation';
88
import { defaultHeader, getActiveRouteName, navigationTheme } from './lib/methods/helpers/navigation';
99
import { RootEnum } from './definitions';

app/actions/activeUsers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { Action } from 'redux';
1+
import { type Action } from 'redux';
22

3-
import { IActiveUsers } from '../reducers/activeUsers';
3+
import { type IActiveUsers } from '../reducers/activeUsers';
44
import { ACTIVE_USERS } from './actionsTypes';
55

66
interface ISetActiveUsers extends Action {

app/actions/app.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { Action } from 'redux';
2-
import { NetInfoStateType } from '@react-native-community/netinfo';
1+
import { type Action } from 'redux';
2+
import { type NetInfoStateType } from '@react-native-community/netinfo';
33

4-
import { RootEnum } from '../definitions';
4+
import { type RootEnum } from '../definitions';
55
import { APP } from './actionsTypes';
66

77
interface IAppStart extends Action {

app/actions/connect.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Action } from 'redux';
1+
import { type Action } from 'redux';
22

33
import * as types from './actionsTypes';
44

app/actions/createChannel.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { Action } from 'redux';
1+
import { type Action } from 'redux';
22

3-
import { TCreateChannelResult } from '../reducers/createChannel';
3+
import { type TCreateChannelResult } from '../reducers/createChannel';
44
import { CREATE_CHANNEL } from './actionsTypes';
55

66
interface ICreateChannelRequest extends Action {

app/actions/createDiscussion.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Action } from 'redux';
1+
import { type Action } from 'redux';
22

33
import { CREATE_DISCUSSION } from './actionsTypes';
44

app/actions/customEmojis.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { Action } from 'redux';
1+
import { type Action } from 'redux';
22

33
import { SET_CUSTOM_EMOJIS } from './actionsTypes';
4-
import { ICustomEmojis } from '../definitions';
4+
import { type ICustomEmojis } from '../definitions';
55

66
export interface ISetCustomEmojis extends Action {
77
emojis: ICustomEmojis;

app/actions/deepLinking.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Action } from 'redux';
1+
import { type Action } from 'redux';
22

33
import { DEEP_LINKING } from './actionsTypes';
44

app/actions/encryption.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { Action } from 'redux';
1+
import { type Action } from 'redux';
22

3-
import { IBanner } from '../reducers/encryption';
3+
import { type IBanner } from '../reducers/encryption';
44
import { ENCRYPTION } from './actionsTypes';
55

66
export interface IEncryptionSet extends Action {

0 commit comments

Comments
 (0)