Skip to content
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

Update to TS4.3, enable explicit overrides #1171

Merged
merged 11 commits into from Jun 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions package.json
Expand Up @@ -65,7 +65,7 @@
"@babel/plugin-proposal-class-properties": "^7.12.1",
"@babel/plugin-proposal-decorators": "^7.12.12",
"@babel/plugin-transform-runtime": "^7.12.10",
"@babel/plugin-transform-typescript": "^7.12.1",
"@babel/plugin-transform-typescript": "^7.14.4",
"@babel/preset-env": "^7.12.11",
"@babel/preset-react": "^7.12.10",
"@babel/register": "^7.12.10",
Expand Down Expand Up @@ -100,8 +100,8 @@
"@types/webpack": "^5",
"@types/webpack-dev-server": "^3.11.1",
"@types/webpack-env": "^1.13.6",
"@typescript-eslint/eslint-plugin": "^4.12.0",
"@typescript-eslint/parser": "^4.12.0",
"@typescript-eslint/eslint-plugin": "^4.26.0",
"@typescript-eslint/parser": "^4.26.0",
"@xivanalysis/eslint-plugin": "^0.0.2",
"autoprefixer": "^10.1.0",
"babel-jest": "^26.6.3",
Expand Down Expand Up @@ -138,7 +138,7 @@
"postcss-modules-values-replace": "^3.1.0",
"raw-loader": "^4.0.2",
"style-loader": "^2.0.0",
"typescript": "~4.1",
"typescript": "~4.3.2",
"url-loader": "^4.1.1",
"webpack": "^5.11.1",
"webpack-cli": "^4.3.1",
Expand Down
2 changes: 1 addition & 1 deletion src/akkd/Container/Container.tsx
Expand Up @@ -7,7 +7,7 @@ interface Props {
}

export class Container extends React.PureComponent<Props> {
render() {
override render() {
const {className, children} = this.props
return (
<div className={classNames(
Expand Down
4 changes: 2 additions & 2 deletions src/akkd/List/List.tsx
Expand Up @@ -11,7 +11,7 @@ interface ListItemProps {
}

class ListItem extends React.PureComponent<ListItemProps> {
render() {
override render() {
const {
as: Component = 'div',
children,
Expand Down Expand Up @@ -40,7 +40,7 @@ interface ListProps {
export class List extends React.PureComponent<ListProps> {
static Item = ListItem

render() {
override render() {
const {color, children} = this.props

return (
Expand Down
2 changes: 1 addition & 1 deletion src/akkd/Message/Message.tsx
Expand Up @@ -26,7 +26,7 @@ interface Props extends MessageTypes {
export class Message extends React.PureComponent<Props> {
static Header = MessageHeader

render() {
override render() {
const {icon, children} = this.props

// Find the first message type that's truthy
Expand Down
2 changes: 1 addition & 1 deletion src/akkd/Message/MessageHeader.tsx
Expand Up @@ -6,7 +6,7 @@ interface MessageHeaderProps {
}

export class MessageHeader extends React.PureComponent<MessageHeaderProps> {
render() {
override render() {
return (
<div className={styles.header}>
{this.props.children}
Expand Down
6 changes: 3 additions & 3 deletions src/akkd/Segment/ExpandableSegment.tsx
Expand Up @@ -29,7 +29,7 @@ export class ExpandableSegment extends React.PureComponent<Props, State> {
}
}

componentDidMount() {
override componentDidMount() {
const {current} = this.ref
const {
maxHeight,
Expand All @@ -44,7 +44,7 @@ export class ExpandableSegment extends React.PureComponent<Props, State> {
}
}

componentDidUpdate(prevProps: Props) {
override componentDidUpdate(prevProps: Props) {
// Animate the expand the first time it's requested
if (
prevProps.collapsed !== false &&
Expand Down Expand Up @@ -78,7 +78,7 @@ export class ExpandableSegment extends React.PureComponent<Props, State> {
})
}

render() {
override render() {
const {
seeMore,
maxHeight: propHeight,
Expand Down
2 changes: 1 addition & 1 deletion src/akkd/Segment/Segment.tsx
Expand Up @@ -9,7 +9,7 @@ interface SegmentProps {
export class Segment extends React.PureComponent<SegmentProps> {
static Expandable = ExpandableSegment

render() {
override render() {
const {children} = this.props
return <div className={styles.segment}>{children}</div>
}
Expand Down
6 changes: 3 additions & 3 deletions src/components/BranchBanner.tsx
Expand Up @@ -11,10 +11,10 @@ import styles from './BranchBanner.module.css'

@observer
class BranchBannerComponent extends React.Component<RouteComponentProps> {
static contextType = StoreContext
context!: React.ContextType<typeof StoreContext>
static override contextType = StoreContext
declare context: React.ContextType<typeof StoreContext>

render() {
override render() {
const {reportStore} = this.context
const {location} = this.props
const {report} = reportStore
Expand Down
6 changes: 3 additions & 3 deletions src/components/Home/Home.tsx
Expand Up @@ -23,14 +23,14 @@ If you have any questions, suggestions, or would just like to have a chat - drop

@observer
class Home extends Component {
static contextType = StoreContext
static override contextType = StoreContext

componentDidMount() {
override componentDidMount() {
// Clean out the report state when the user returns to the home page
this.context.reportStore.clearReport()
}

render() {
override render() {
return <>
<div className={styles.background}/>

Expand Down
2 changes: 1 addition & 1 deletion src/components/Home/ReportSearch.tsx
Expand Up @@ -30,7 +30,7 @@ class ReportSearch extends React.Component<RouteComponentProps> {
this.result = parseInput(this.value)
}

render() {
override render() {
if (this.result.valid) {
return <Redirect to={this.result.path}/>
}
Expand Down
8 changes: 4 additions & 4 deletions src/components/LegacyAnalyse/ResultSegment.tsx
Expand Up @@ -50,7 +50,7 @@ export default class ResultSegment extends React.PureComponent<Props, State> imp
this.state = state
}

componentDidMount() {
override componentDidMount() {
// semantic-ui-react doesn't support refs at all, so we'd either need a wrapping div that's there
// just to be ref'd, or we need the ReactDOM hacks. We _need_ the element to have a size so we can't
// just jam it in as a 0-size child that wouldn't cause any trouble.
Expand All @@ -63,7 +63,7 @@ export default class ResultSegment extends React.PureComponent<Props, State> imp
}
}

componentDidUpdate(prevProps: Readonly<Props>) {
override componentDidUpdate(prevProps: Readonly<Props>) {
if (this.props.index !== prevProps.index) {
this.positionContext.unregister(prevProps.index)
}
Expand All @@ -78,7 +78,7 @@ export default class ResultSegment extends React.PureComponent<Props, State> imp
}
}

componentWillUnmount() {
override componentWillUnmount() {
if (ResultSegment.instances.get(this.props.result.handle) === this) {
ResultSegment.instances.delete(this.props.result.handle)
}
Expand All @@ -87,7 +87,7 @@ export default class ResultSegment extends React.PureComponent<Props, State> imp
this.positionContext.unregister(this.props.index)
}

render() {
override render() {
return <Consumer>{value => {
this.positionContext = value
return this.renderContent()
Expand Down
6 changes: 3 additions & 3 deletions src/components/LegacyAnalyse/SegmentPositionContext.tsx
Expand Up @@ -19,7 +19,7 @@ interface ProviderState extends Context {
}

export class SegmentPositionProvider extends React.PureComponent<Record<string, never>, ProviderState> {
readonly state: Readonly<ProviderState> = {
override readonly state: Readonly<ProviderState> = {
active: null,
register: this.register.bind(this),
unregister: this.unregister.bind(this),
Expand All @@ -28,7 +28,7 @@ export class SegmentPositionProvider extends React.PureComponent<Record<string,
}
private readonly refMap = new Map<number, { scrollIntoView(): void }>()

componentDidUpdate(_prevProps: Readonly<Record<string, never>>, prevState: Readonly<ProviderState>) {
override componentDidUpdate(_prevProps: Readonly<Record<string, never>>, prevState: Readonly<ProviderState>) {
const {registry} = this.state
if (registry !== prevState.registry) {
const toCheck = Array.from(registry.keys()).sort((a, b) => a - b)
Expand All @@ -43,7 +43,7 @@ export class SegmentPositionProvider extends React.PureComponent<Record<string,
}
}

render() {
override render() {
return <context.Provider value={this.state}>{this.props.children}</context.Provider>
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/ContributorLabel.tsx
Expand Up @@ -9,7 +9,7 @@ interface ContributorLabelProps {
}

export default class ContributorLabel extends PureComponent<ContributorLabelProps> {
render() {
override render() {
const {contributor, detail} = this.props

const {avatar, name, jobs} = contributor
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/JobIcon/JobIcon.tsx
Expand Up @@ -8,7 +8,7 @@ interface Props {
}

export default class JobIcon extends React.PureComponent<Props> {
render() {
override render() {
const {
job: {icon},
scale = 2,
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/PieChartWithLegend.tsx
Expand Up @@ -21,7 +21,7 @@ type Props = ChartComponentProps & {
const MISSING_COLOUR_FALLBACK = '#888'

export default class PieChartWithLegend extends React.Component<Props> {
render() {
override render() {
const {
data: propData,
headers,
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/Rotation.tsx
Expand Up @@ -32,7 +32,7 @@ export default class Rotation extends Component<RotationProps> {
return undefined
}

render() {
override render() {
const {events} = this.props

return <div className={styles.container}>
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/RotationTable.tsx
Expand Up @@ -221,7 +221,7 @@ export class RotationTable extends React.Component<RotationTableProps> {
}
</Table.Row>

render(): React.ReactNode {
override render(): React.ReactNode {
const {
targets,
notes,
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/TimeLineChart.tsx
Expand Up @@ -34,7 +34,7 @@ export default class TimeLineChart extends PureComponent<TimeLineChartProps> {
options: PropTypes.object,
}

render() {
override render() {
const options = _.merge({}, DEFAULT_OPTIONS, this.props.options || {})
return <Line
data={this.props.data}
Expand Down
2 changes: 1 addition & 1 deletion src/parser/bosses/e12_1/modules/Invulnerability.ts
Expand Up @@ -5,7 +5,7 @@ import {
} from 'parser/core/modules/Invulnerability'

export class Invulnerability extends CoreInvulnerability {
protected actorConfig: ActorsConfig = [
protected override actorConfig: ActorsConfig = [
// NM sculptures - targetable during adds phase, no TAU
{kind: {legacyFflogs: '12433'}, checks: [Check.FIRST_TARGETED, Check.OVERKILL]}, // Lissom
{kind: {legacyFflogs: '12434'}, checks: [Check.FIRST_TARGETED, Check.OVERKILL]}, // Chiseled
Expand Down
2 changes: 1 addition & 1 deletion src/parser/bosses/e12_2/modules/Invulnerability.ts
Expand Up @@ -4,7 +4,7 @@ import {
} from 'parser/core/modules/Invulnerability'

export class Invulnerability extends CoreInvulnerability {
protected actorConfig: ActorsConfig = [
protected override actorConfig: ActorsConfig = [
// Mechanic sources
{kind: {legacyFflogs: '11743'}, exclude: true}, // Sorrow's hourglass
]
Expand Down
2 changes: 1 addition & 1 deletion src/parser/bosses/e6/modules/Invulnerability.ts
Expand Up @@ -4,7 +4,7 @@ import {
} from 'parser/core/modules/Invulnerability'

export class Invulnerability extends CoreInvulnerability {
protected actorConfig: ActorsConfig = [
protected override actorConfig: ActorsConfig = [
// Mechanic sources
{kind: {legacyFflogs: '11537'}, exclude: true}, // tumultuous nexus (normal)
{kind: {legacyFflogs: '11542'}, exclude: true}, // ??? (savage)
Expand Down
2 changes: 1 addition & 1 deletion src/parser/bosses/exVaris/modules/Invulnerability.ts
Expand Up @@ -5,7 +5,7 @@ import {
} from 'parser/core/modules/Invulnerability'

export class Invulnerability extends CoreInvulnerability {
protected actorConfig: ActorsConfig = [
protected override actorConfig: ActorsConfig = [
// Bladesblood - Is overkilled but does not die.
{kind: {legacyFflogs: '11595'}, checks: [Check.TARGETABLE, Check.OVERKILL]},
// Confines of memory - die too quick to be meaningfully fixable
Expand Down
2 changes: 1 addition & 1 deletion src/parser/bosses/nier11/modules/Invulnerability.ts
Expand Up @@ -4,7 +4,7 @@ import {
} from 'parser/core/modules/Invulnerability'

export class Invulnerability extends CoreInvulnerability {
protected actorConfig: ActorsConfig = [
protected override actorConfig: ActorsConfig = [
// Hacking sequence pylons & walls, while targetable, only exist briefly and cause issues if alive when despawning
{kind: {legacyFflogs: '13031'}, exclude: true}, // White pylon
{kind: {legacyFflogs: '13032'}, exclude: true}, // Black pylon
Expand Down
2 changes: 1 addition & 1 deletion src/parser/bosses/nier4/modules/Invulnerability.ts
Expand Up @@ -4,7 +4,7 @@ import {
} from 'parser/core/modules/Invulnerability'

export class Invulnerability extends CoreInvulnerability {
protected actorConfig: ActorsConfig = [
protected override actorConfig: ActorsConfig = [
// Mechanic sources
{kind: {legacyFflogs: '11384'}, exclude: true}, // Marx
]
Expand Down
2 changes: 1 addition & 1 deletion src/parser/bosses/tea/modules/Invulnerability.ts
Expand Up @@ -5,7 +5,7 @@ import {
} from 'parser/core/modules/Invulnerability'

export class Invulnerability extends CoreInvulnerability {
protected actorConfig: ActorsConfig = [
protected override actorConfig: ActorsConfig = [
// Living liquid doesn't tau to start, nor die
{kind: {legacyFflogs: '11335'}, checks: [Check.FIRST_TARGETED, Check.OVERKILL]},
// Liquid limb is technically targetable, but troublesome as it typically is not killed.
Expand Down
2 changes: 1 addition & 1 deletion src/parser/bosses/urLeviathan/modules/Invulnerability.ts
Expand Up @@ -4,7 +4,7 @@ import {
} from 'parser/core/modules/Invulnerability'

export class Invulnerability extends CoreInvulnerability {
protected actorConfig: ActorsConfig = [
protected override actorConfig: ActorsConfig = [
// Cast target for aether drain
{kind: {legacyFflogs: '12678'}, exclude: true},
]
Expand Down
2 changes: 1 addition & 1 deletion src/parser/bosses/urShiva/modules/Invulnerability.ts
Expand Up @@ -4,7 +4,7 @@ import {
} from 'parser/core/modules/Invulnerability'

export class Invulnerability extends CoreInvulnerability {
protected actorConfig: ActorsConfig = [
protected override actorConfig: ActorsConfig = [
// Ghost copies of shiva, presumably mechanic sources
{kind: {legacyFflogs: '11960'}, exclude: true},
{kind: {legacyFflogs: '11961'}, exclude: true},
Expand Down
2 changes: 1 addition & 1 deletion src/parser/bosses/urTitan/modules/Invulnerability.ts
Expand Up @@ -4,7 +4,7 @@ import {
} from 'parser/core/modules/Invulnerability'

export class Invulnerability extends CoreInvulnerability {
protected actorConfig: ActorsConfig = [
protected override actorConfig: ActorsConfig = [
// Bomb boulders - targetable, but only one has to be killed, and all are targetable
// at the same time as Titan. Their explosion renders end-checks unuseable.
{kind: {legacyFflogs: '12502'}, exclude: true},
Expand Down
1 change: 0 additions & 1 deletion src/parser/core/Module.ts
Expand Up @@ -36,7 +36,6 @@ export default class Module extends Injectable {
static displayMode: DISPLAY_MODE
// TODO: Refactor this var
static i18n_id?: string // tslint:disable-line
static debug: boolean = false

private static _title: string | MessageDescriptor
static get title() {
Expand Down