Skip to content

Commit

Permalink
style: enable eslint rules 'no-var' and ' prefer-const' (#1196)
Browse files Browse the repository at this point in the history
* source code fixes that did not fit these rules
  • Loading branch information
shauke authored Jun 27, 2022
1 parent 0dbd918 commit 7fc3582
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -796,8 +796,10 @@
"caughtErrors": "none"
}
],
"no-var": "warn",
"object-shorthand": "error",
"prefer-arrow-callback": "warn",
"prefer-const": "warn",
"prefer-template": "warn",
"prettier/prettier": "warn",
"rxjs-angular/prefer-takeuntil": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('Reviews Service', () => {
let apiServiceMock: ApiService;
let reviewsService: ReviewsService;

let review: ProductReview = {
const review: ProductReview = {
id: '1',
authorFirstName: 'Foo',
authorLastName: 'Bar',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@ describe('Product Reviews Component', () => {
let component: ProductReviewsComponent;
let fixture: ComponentFixture<ProductReviewsComponent>;
let element: HTMLElement;
let review: ProductReview;
let context: ProductContextFacade;
let reviewsFacade: ProductReviewsFacade;

review = {
const review: ProductReview = {
id: '1',
authorFirstName: 'Foo',
authorLastName: 'Bar',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe('Product Reviews Effects', () => {
});

it('should map to action of type loadProductReviewsSuccess', () => {
let reviews: ProductReviews = {
const reviews: ProductReviews = {
sku: '123',
reviews: [],
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { getProductReviewsBySku, getProductReviewsError, getProductReviewsLoadin
describe('Product Reviews Selectors', () => {
let store$: StoreWithSnapshots;

let reviews: ProductReviews = {
const reviews: ProductReviews = {
sku: '123',
reviews: [
{
Expand Down
10 changes: 5 additions & 5 deletions src/typings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ declare module 'express-http-proxy';

declare module 'express-robots-txt';

declare var PRODUCTION_MODE: boolean;
declare const PRODUCTION_MODE: boolean;

declare var SERVICE_WORKER: boolean;
declare const SERVICE_WORKER: boolean;

declare var NGRX_RUNTIME_CHECKS: boolean;
declare const NGRX_RUNTIME_CHECKS: boolean;

declare var PWA_VERSION: string;
declare const PWA_VERSION: string;

declare var THEME: string;
declare const THEME: string;

0 comments on commit 7fc3582

Please sign in to comment.