Skip to content

Commit f3cb477

Browse files
authored
Upgrade typescript-eslint to 4.x (#2056)
This is updated to officially support eslint 7.x (avoid a peer dependency install error), and also officially match the current TypeScript version (typescrlint-eslint 2.x doesn't officically support TypeScript 4.x). Without this fix, I just get an error upon 'npm install'. I disabled some of the new rules that caused a lot of errors, but they can probably be fixed and enabled in subsequent commits (there are a lot of other lint warnings that can be tackled as well, though).
1 parent 908a3de commit f3cb477

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

.eslintrc.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ module.exports = {
2929
'react/jsx-uses-vars': 2,
3030
'@typescript-eslint/no-use-before-define': 0,
3131
'@typescript-eslint/no-var-requires': 0,
32-
'@typescript-eslint/explicit-function-return-type': 0
32+
'@typescript-eslint/explicit-function-return-type': 0,
33+
'@typescript-eslint/ban-types': 0,
34+
'@typescript-eslint/ban-ts-comment': 1
3335
}
3436
};

example/src/mocks/theme.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Platform} from "react-native";
1+
import {Platform} from 'react-native';
22

33
export const themeColor = '#00AAAF';
44
export const lightThemeColor = '#f2f7f7';
@@ -16,18 +16,18 @@ export function getTheme() {
1616
monthTextColor: 'black',
1717
textMonthFontSize: 16,
1818
textMonthFontFamily: 'HelveticaNeue',
19-
textMonthFontWeight: 'bold' as 'bold',
19+
textMonthFontWeight: 'bold' as const,
2020
// day names
2121
textSectionTitleColor: 'black',
2222
textDayHeaderFontSize: 12,
2323
textDayHeaderFontFamily: 'HelveticaNeue',
24-
textDayHeaderFontWeight: 'normal' as 'normal',
24+
textDayHeaderFontWeight: 'normal' as const,
2525
// dates
2626
dayTextColor: themeColor,
2727
todayTextColor: '#af0078',
2828
textDayFontSize: 18,
2929
textDayFontFamily: 'HelveticaNeue',
30-
textDayFontWeight: '500' as '500',
30+
textDayFontWeight: '500' as const,
3131
textDayStyle: {marginTop: Platform.OS === 'android' ? 2 : 4},
3232
// selected date
3333
selectedDayBackgroundColor: themeColor,

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@
5252
"@types/react": "^17.0.44",
5353
"@types/react-native": "^0.64.19",
5454
"@types/xdate": "^0.8.32",
55-
"@typescript-eslint/eslint-plugin": "^2.13.0",
56-
"@typescript-eslint/parser": "^2.13.0",
55+
"@typescript-eslint/eslint-plugin": "^4.0.0",
56+
"@typescript-eslint/parser": "^4.0.0",
5757
"@welldone-software/why-did-you-render": "^6.0.3",
5858
"babel-eslint": "^10.1.0",
5959
"babel-jest": "^26.6.3",

src/utils/__tests__/Playground.perf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import {measurePerformance} from 'reassure';
3-
import {Calendar, CalendarList} from '../../index';
3+
import {Calendar, CalendarList, ExpandableCalendar} from '../../index';
44

55
const INITIAL_DATE = '2022-07-07';
66

0 commit comments

Comments
 (0)