Update Angular and React-Redux templates for default eslint config changes

This commit is contained in:
Rachel Shaffer 2019-11-04 14:21:20 -08:00
parent bd917f690d
commit 44df10b6a6
7 changed files with 20 additions and 14 deletions

View File

@ -1,7 +1,11 @@
import { BrowserModule } from '@angular/platform-browser'; import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms'; import { FormsModule } from '@angular/forms';
////#if (IndividualLocalAuth)
import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http'; import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
////#else
import { HttpClientModule } from '@angular/common/http';
////#endif
import { RouterModule } from '@angular/router'; import { RouterModule } from '@angular/router';
import { AppComponent } from './app.component'; import { AppComponent } from './app.component';

View File

@ -3,7 +3,6 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { CounterComponent } from './counter.component'; import { CounterComponent } from './counter.component';
describe('CounterComponent', () => { describe('CounterComponent', () => {
let component: CounterComponent;
let fixture: ComponentFixture<CounterComponent>; let fixture: ComponentFixture<CounterComponent>;
beforeEach(async(() => { beforeEach(async(() => {
@ -15,7 +14,6 @@ describe('CounterComponent', () => {
beforeEach(() => { beforeEach(() => {
fixture = TestBed.createComponent(CounterComponent); fixture = TestBed.createComponent(CounterComponent);
component = fixture.componentInstance;
fixture.detectChanges(); fixture.detectChanges();
}); });

View File

@ -7,7 +7,7 @@ import {
platformBrowserDynamicTesting platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing'; } from '@angular/platform-browser-dynamic/testing';
declare const require: any; declare const require;
// First, initialize the Angular testing environment. // First, initialize the Angular testing environment.
getTestBed().initTestEnvironment( getTestBed().initTestEnvironment(

View File

@ -81,4 +81,4 @@ class FetchData extends React.PureComponent<WeatherForecastProps> {
export default connect( export default connect(
(state: ApplicationState) => state.weatherForecasts, // Selects which state properties are merged into the component's props (state: ApplicationState) => state.weatherForecasts, // Selects which state properties are merged into the component's props
WeatherForecastsStore.actionCreators // Selects which action creators are merged into the component's props WeatherForecastsStore.actionCreators // Selects which action creators are merged into the component's props
)(FetchData as any); )(FetchData as any); // eslint-disable-line @typescript-eslint/no-explicit-any

View File

@ -10,7 +10,7 @@ const Home = () => (
<li><a href='https://facebook.github.io/react/'>React</a> and <a href='https://redux.js.org/'>Redux</a> for client-side code</li> <li><a href='https://facebook.github.io/react/'>React</a> and <a href='https://redux.js.org/'>Redux</a> for client-side code</li>
<li><a href='http://getbootstrap.com/'>Bootstrap</a> for layout and styling</li> <li><a href='http://getbootstrap.com/'>Bootstrap</a> for layout and styling</li>
</ul> </ul>
<p>To help you get started, we've also set up:</p> <p>To help you get started, we have also set up:</p>
<ul> <ul>
<li><strong>Client-side navigation</strong>. For example, click <em>Counter</em> then <em>Back</em> to return here.</li> <li><strong>Client-side navigation</strong>. For example, click <em>Counter</em> then <em>Back</em> to return here.</li>
<li><strong>Development server integration</strong>. In development mode, the development server from <code>create-react-app</code> runs in the background automatically, so your client-side resources are dynamically built on demand and the page refreshes when you modify any file.</li> <li><strong>Development server integration</strong>. In development mode, the development server from <code>create-react-app</code> runs in the background automatically, so your client-side resources are dynamically built on demand and the page refreshes when you modify any file.</li>

View File

@ -2,11 +2,15 @@ import * as React from 'react';
import { Container } from 'reactstrap'; import { Container } from 'reactstrap';
import NavMenu from './NavMenu'; import NavMenu from './NavMenu';
export default (props: { children?: React.ReactNode }) => ( export default class Layout extends React.PureComponent<{}, { children?: React.ReactNode }> {
<React.Fragment> public render() {
<NavMenu/> return (
<Container> <React.Fragment>
{props.children} <NavMenu />
</Container> <Container>
</React.Fragment> {this.props.children}
); </Container>
</React.Fragment>
);
}
}

View File

@ -16,7 +16,7 @@ export default function configureStore(history: History, initialState?: Applicat
}); });
const enhancers = []; const enhancers = [];
const windowIfDefined = typeof window === 'undefined' ? null : window as any; const windowIfDefined = typeof window === 'undefined' ? null : window as any; // eslint-disable-line @typescript-eslint/no-explicit-any
if (windowIfDefined && windowIfDefined.__REDUX_DEVTOOLS_EXTENSION__) { if (windowIfDefined && windowIfDefined.__REDUX_DEVTOOLS_EXTENSION__) {
enhancers.push(windowIfDefined.__REDUX_DEVTOOLS_EXTENSION__()); enhancers.push(windowIfDefined.__REDUX_DEVTOOLS_EXTENSION__());
} }