Skip to content

Commit 13db519

Browse files
Merge pull request #17153 from rachelgshaffer/rachelgshaffer/lint-clean-templates
Update Angular and React-Redux templates
2 parents 8cee6ce + 84d2d83 commit 13db519

File tree

8 files changed

+24
-15
lines changed

8 files changed

+24
-15
lines changed

src/ProjectTemplates/Web.Spa.ProjectTemplates/content/Angular-CSharp/ClientApp/src/app/app.module.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
import { BrowserModule } from '@angular/platform-browser';
22
import { NgModule } from '@angular/core';
33
import { FormsModule } from '@angular/forms';
4+
////#if (IndividualLocalAuth)
45
import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
6+
////#else
7+
import { HttpClientModule } from '@angular/common/http';
8+
////#endif
59
import { RouterModule } from '@angular/router';
610

711
import { AppComponent } from './app.component';

src/ProjectTemplates/Web.Spa.ProjectTemplates/content/Angular-CSharp/ClientApp/src/app/counter/counter.component.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing';
33
import { CounterComponent } from './counter.component';
44

55
describe('CounterComponent', () => {
6-
let component: CounterComponent;
76
let fixture: ComponentFixture<CounterComponent>;
87

98
beforeEach(async(() => {
@@ -15,7 +14,6 @@ describe('CounterComponent', () => {
1514

1615
beforeEach(() => {
1716
fixture = TestBed.createComponent(CounterComponent);
18-
component = fixture.componentInstance;
1917
fixture.detectChanges();
2018
});
2119

src/ProjectTemplates/Web.Spa.ProjectTemplates/content/Angular-CSharp/ClientApp/src/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
platformBrowserDynamicTesting
88
} from '@angular/platform-browser-dynamic/testing';
99

10-
declare const require: any;
10+
declare const require;
1111

1212
// First, initialize the Angular testing environment.
1313
getTestBed().initTestEnvironment(

src/ProjectTemplates/Web.Spa.ProjectTemplates/content/ReactRedux-CSharp/ClientApp/.eslintrc.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,8 @@
33
"parserOptions": {
44
"ecmaVersion": 6,
55
"sourceType": "module"
6-
}
6+
},
7+
"plugins": [
8+
"@typescript-eslint"
9+
]
710
}

src/ProjectTemplates/Web.Spa.ProjectTemplates/content/ReactRedux-CSharp/ClientApp/src/components/FetchData.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,4 @@ class FetchData extends React.PureComponent<WeatherForecastProps> {
8181
export default connect(
8282
(state: ApplicationState) => state.weatherForecasts, // Selects which state properties are merged into the component's props
8383
WeatherForecastsStore.actionCreators // Selects which action creators are merged into the component's props
84-
)(FetchData as any);
84+
)(FetchData as any); // eslint-disable-line @typescript-eslint/no-explicit-any

src/ProjectTemplates/Web.Spa.ProjectTemplates/content/ReactRedux-CSharp/ClientApp/src/components/Home.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const Home = () => (
1010
<li><a href='https://facebook.github.io/react/'>React</a> and <a href='https://redux.js.org/'>Redux</a> for client-side code</li>
1111
<li><a href='http://getbootstrap.com/'>Bootstrap</a> for layout and styling</li>
1212
</ul>
13-
<p>To help you get started, we've also set up:</p>
13+
<p>To help you get started, we have also set up:</p>
1414
<ul>
1515
<li><strong>Client-side navigation</strong>. For example, click <em>Counter</em> then <em>Back</em> to return here.</li>
1616
<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>

src/ProjectTemplates/Web.Spa.ProjectTemplates/content/ReactRedux-CSharp/ClientApp/src/components/Layout.tsx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@ import * as React from 'react';
22
import { Container } from 'reactstrap';
33
import NavMenu from './NavMenu';
44

5-
export default (props: { children?: React.ReactNode }) => (
6-
<React.Fragment>
7-
<NavMenu/>
8-
<Container>
9-
{props.children}
10-
</Container>
11-
</React.Fragment>
12-
);
5+
export default class Layout extends React.PureComponent<{}, { children?: React.ReactNode }> {
6+
public render() {
7+
return (
8+
<React.Fragment>
9+
<NavMenu />
10+
<Container>
11+
{this.props.children}
12+
</Container>
13+
</React.Fragment>
14+
);
15+
}
16+
}

src/ProjectTemplates/Web.Spa.ProjectTemplates/content/ReactRedux-CSharp/ClientApp/src/store/configureStore.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default function configureStore(history: History, initialState?: Applicat
1616
});
1717

1818
const enhancers = [];
19-
const windowIfDefined = typeof window === 'undefined' ? null : window as any;
19+
const windowIfDefined = typeof window === 'undefined' ? null : window as any; // eslint-disable-line @typescript-eslint/no-explicit-any
2020
if (windowIfDefined && windowIfDefined.__REDUX_DEVTOOLS_EXTENSION__) {
2121
enhancers.push(windowIfDefined.__REDUX_DEVTOOLS_EXTENSION__());
2222
}

0 commit comments

Comments
 (0)