-
Notifications
You must be signed in to change notification settings - Fork 42
[MOB-10141] make lint rules stricter #604
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
2ce56ae
1d73a8d
b6797da
0bd3f0c
46c5710
bc32769
6f87314
61d143d
888ee75
a8ac6a1
7b0104a
ad2cf2d
9cbfc82
4b20c6e
6ebc953
d76e662
5d96ec5
cc96da8
d029374
c556a9f
835786f
52a6422
e2ebcf1
241c5f6
15add53
575cfbf
989dead
e5ade24
89ac82b
cbc3418
f2f5122
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| integration-testing/ | ||
| lib/ | ||
| node_modules/ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| module.exports = { | ||
| root: true, | ||
| extends: [ | ||
| '@react-native', | ||
| 'plugin:react/recommended', | ||
| 'plugin:react-native/all', | ||
| 'prettier', // Disables ESLint rules that conflict with Prettier | ||
| ], | ||
| rules: { | ||
| 'react/react-in-jsx-scope': 'off', | ||
| }, | ||
| overrides: [ | ||
| { | ||
| files: ['*.ts', '*.tsx'], | ||
| plugins: ['@typescript-eslint/eslint-plugin'], | ||
| extends: [ | ||
| 'plugin:@typescript-eslint/recommended', | ||
| // We need more verbose typing to enable the below rule, but we should | ||
| // do this in the future | ||
| // 'plugin:@typescript-eslint/recommended-requiring-type-checking', | ||
| ], | ||
| parser: '@typescript-eslint/parser', | ||
| parserOptions: { | ||
| project: true, | ||
| tsconfigRootDir: __dirname, | ||
| }, | ||
| rules: { | ||
| '@typescript-eslint/no-var-requires': [ | ||
| 'error', | ||
| { allow: ['/package\\.json$'] }, | ||
| ], | ||
| '@typescript-eslint/no-require-imports': [ | ||
| 'error', | ||
| { allow: ['/package\\.json$'] }, | ||
| ], | ||
| }, | ||
| }, | ||
| { | ||
| files: ['**/*.test.{js,ts,tsx}', '**/__mocks__/*', '**/__tests__/*'], | ||
| plugins: ['jest'], | ||
| env: { | ||
| jest: true, | ||
| }, | ||
| rules: { | ||
| '@typescript-eslint/no-var-requires': 'off', | ||
| '@typescript-eslint/no-require-imports': 'off', | ||
| }, | ||
| }, | ||
| ], | ||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "quoteProps": "consistent", | ||
| "singleQuote": true, | ||
| "tabWidth": 2, | ||
| "trailingComma": "es5", | ||
| "useTabs": false | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| import Icon from 'react-native-vector-icons/Ionicons'; | ||
|
|
||
| export const getIcon = (name: string, props: Record<string, any>) => ( | ||
| export const getIcon = (name: string, props: Record<string, unknown>) => ( | ||
| <Icon name={name} {...props} /> | ||
| ); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,62 +6,63 @@ import { | |
| container, | ||
| title, | ||
| subtitle, | ||
| shadows, | ||
| } from '../../constants'; | ||
|
|
||
| const styles = StyleSheet.create({ | ||
| container, | ||
| title: { ...title, textAlign: 'center' }, | ||
| subtitle: { ...subtitle, textAlign: 'center' }, | ||
| button: { ...button, marginTop: 10, paddingVertical: 5, width: 100 }, | ||
| buttonText, | ||
| cardContainer: { | ||
| backgroundColor: colors?.white, | ||
| borderWidth: 1, | ||
| padding: 15, | ||
| borderColor: colors?.grey5, | ||
| shadowColor: 'rgba(0,0,0, .2)', | ||
| shadowOffset: { height: 0, width: 0 }, | ||
| shadowOpacity: 1, | ||
| shadowRadius: 1, | ||
| elevation: 10, // Required for Android | ||
| width: '100%', | ||
| borderWidth: 1, | ||
| elevation: shadows.card.elevation, // Required for Android | ||
| height: 150, | ||
| marginBottom: 10, | ||
| }, | ||
| infoContainer: { | ||
| display: 'flex', | ||
| flexDirection: 'row', | ||
| gap: 10, | ||
| alignItems: 'center', | ||
| }, | ||
| imageContainer: { | ||
| width: 120, | ||
| height: 100, | ||
| flex: 0, | ||
| }, | ||
| textContainer: { | ||
| paddingTop: 10, | ||
| flex: 1, | ||
| marginLeft: 10, | ||
| padding: 15, | ||
| shadowColor: shadows.card.color, | ||
| shadowOffset: shadows.card.offset, | ||
| shadowOpacity: shadows.card.opacity, | ||
| shadowRadius: shadows.card.radius, | ||
| width: '100%', | ||
| }, | ||
| cardImage: { | ||
| height: '100%', | ||
| width: '100%', | ||
| resizeMode: 'contain', | ||
| width: '100%', | ||
| }, | ||
| cardSubtitle: { | ||
| color: colors.textSecondary, | ||
| fontSize: 14, | ||
| }, | ||
| cardTitle: { | ||
| fontSize: 18, | ||
| fontWeight: 'bold', | ||
| }, | ||
| cardSubtitle: { | ||
| fontSize: 14, | ||
| color: colors.textSecondary, | ||
| container, | ||
| imageContainer: { | ||
| flex: 0, | ||
| height: 100, | ||
| width: 120, | ||
| }, | ||
| infoContainer: { | ||
| alignItems: 'center', | ||
| display: 'flex', | ||
| flexDirection: 'row', | ||
| gap: 10, | ||
| }, | ||
| price: { | ||
| marginVertical: 5, | ||
| fontWeight: 'bold', | ||
| color: colors.salmon50, | ||
| fontWeight: 'bold', | ||
| marginVertical: 5, | ||
| }, | ||
| button: { ...button, width: 100, marginTop: 10, paddingVertical: 5 }, | ||
| buttonText, | ||
| subtitle: { ...subtitle, textAlign: 'center' }, | ||
| textContainer: { | ||
| flex: 1, | ||
| marginLeft: 10, | ||
| paddingTop: 10, | ||
| }, | ||
| title: { ...title, textAlign: 'center' }, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see this is alphabetical |
||
| }); | ||
|
|
||
| export default styles; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| export * from './colors'; | ||
| export * from './containers'; | ||
| export * from './formElements'; | ||
| export * from './shadows'; | ||
| export * from './typography'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| export const shadows = { | ||
| card: { | ||
| color: 'rgba(0,0,0, .2)', | ||
| offset: { height: 0, width: 0 }, | ||
| opacity: 1, | ||
| radius: 1, | ||
| elevation: 10, // Required for Android | ||
| }, | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,8 +27,4 @@ export type MainScreenProps<T extends keyof MainScreenParamList> = | |
| export type RootStackScreenProps<T extends keyof RootStackParamList> = | ||
| StackScreenProps<RootStackParamList, T>; | ||
|
|
||
| declare global { | ||
| namespace ReactNavigation { | ||
| interface RootParamList extends RootStackParamList {} | ||
| } | ||
| } | ||
| export type { RootStackParamList as RootParamList }; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure whats going on here.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the rule I was fixing: https://typescript-eslint.io/rules/no-namespace/ |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what is done here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just making ts rules in eslint stricter