Skip to content

Commit 3a177b9

Browse files
fix: Typescript files at root level not being linted
1 parent 3753418 commit 3a177b9

File tree

4 files changed

+35
-32
lines changed

4 files changed

+35
-32
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
cypress.config.ts

angular.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,8 @@
271271
"cypress/**/*.ts",
272272
"lint/**/*.ts",
273273
"src/**/*.html",
274-
"src/**/*.json5"
274+
"src/**/*.json5",
275+
"*.ts"
275276
]
276277
}
277278
}

server.ts

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -14,48 +14,48 @@
1414
* from your application's main.server.ts file, as seen below with the
1515
* import for `ngExpressEngine`.
1616
*/
17+
18+
/* eslint-disable import/no-namespace, @typescript-eslint/no-require-imports */
19+
1720
import 'reflect-metadata';
1821
import 'zone.js/node';
1922

20-
/* eslint-disable import/no-namespace */
21-
import * as morgan from 'morgan';
22-
import express from 'express';
23-
import * as ejs from 'ejs';
23+
import { readFileSync } from 'node:fs';
24+
import { createServer } from 'node:https';
25+
import { join } from 'node:path';
26+
27+
import { APP_BASE_HREF } from '@angular/common';
28+
import { enableProdMode } from '@angular/core';
29+
import { CommonEngine } from '@angular/ssr/node';
30+
import { TOKENITEM } from '@dspace/core/auth/models/auth-token-info.model';
31+
import { hasValue } from '@dspace/shared/utils/empty.util';
32+
import { json } from 'body-parser';
2433
import * as compression from 'compression';
34+
import { renderFile } from 'ejs';
35+
import express from 'express';
2536
import expressStaticGzip from 'express-static-gzip';
26-
import { LRUCache } from 'lru-cache';
37+
import { createProxyMiddleware } from 'http-proxy-middleware';
38+
import { createHttpTerminator } from 'http-terminator';
2739
import { isbot } from 'isbot';
40+
import { LRUCache } from 'lru-cache';
41+
import * as morgan from 'morgan';
2842
import { createCertificate } from 'pem';
29-
import { createServer } from 'https';
30-
import { json } from 'body-parser';
31-
import { createHttpTerminator } from 'http-terminator';
32-
33-
import { readFileSync } from 'fs';
34-
import { join } from 'path';
3543

36-
import { enableProdMode } from '@angular/core';
37-
38-
39-
import { environment } from './src/environments/environment';
40-
import { createProxyMiddleware } from 'http-proxy-middleware';
41-
import { hasValue } from '@dspace/shared/utils/empty.util';
42-
import { UIServerConfig } from './src/config/ui-server-config.interface';
43-
import bootstrap from './src/main.server';
44-
import { buildAppConfig } from './src/config/config.server';
4544
import {
4645
APP_CONFIG,
4746
AppConfig,
4847
} from './src/config/app-config.interface';
48+
import { buildAppConfig } from './src/config/config.server';
4949
import { extendEnvironmentWithAppConfig } from './src/config/config.util';
50-
import { logStartupMessage } from './startup-message';
51-
import { TOKENITEM } from '@dspace/core/auth/models/auth-token-info.model';
52-
import { CommonEngine } from '@angular/ssr/node';
53-
import { APP_BASE_HREF } from '@angular/common';
50+
import { SsrExcludePatterns } from './src/config/ssr-config.interface';
51+
import { UIServerConfig } from './src/config/ui-server-config.interface';
52+
import { environment } from './src/environments/environment';
5453
import {
5554
REQUEST,
5655
RESPONSE,
5756
} from './src/express.tokens';
58-
import { SsrExcludePatterns } from './src/config/ssr-config.interface';
57+
import bootstrap from './src/main.server';
58+
import { logStartupMessage } from './startup-message';
5959

6060
/*
6161
* Set path for the browser application's dist folder
@@ -130,7 +130,7 @@ export function app() {
130130
*/
131131
server.use(json());
132132

133-
server.engine('ejs', ejs.renderFile);
133+
server.engine('ejs', renderFile);
134134

135135
/*
136136
* Register the view engines for html and ejs
@@ -316,7 +316,7 @@ function clientSideRender(req, res) {
316316
// Replace base href dynamically
317317
html = html.replace(
318318
/<base href="[^"]*">/,
319-
`<base href="${namespace.endsWith('/') ? namespace : namespace + '/'}">`
319+
`<base href="${namespace.endsWith('/') ? namespace : namespace + '/'}">`,
320320
);
321321

322322
// Replace REST URL with UI URL
@@ -650,10 +650,10 @@ function start() {
650650
*/
651651
function isExcludedFromSsr(path: string, excludePathPattern: SsrExcludePatterns[]): boolean {
652652
const patterns = excludePathPattern.map(p =>
653-
new RegExp(p.pattern, p.flag || '')
653+
new RegExp(p.pattern, p.flag || ''),
654654
);
655655
return patterns.some((regex) => {
656-
return regex.test(path)
656+
return regex.test(path);
657657
});
658658
}
659659

startup-message.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import PACKAGE_JSON from './package.json';
21
import { BuildConfig } from '@dspace/config/build-config.interface';
32

3+
import PACKAGE_JSON from './package.json';
4+
45
/**
56
* Log a message at the start of the application containing the version number and the environment.
67
*
@@ -16,4 +17,4 @@ export const logStartupMessage = (environment: Partial<BuildConfig>) => {
1617
console.info(`Environment: %c${env}`, `color: ${color}; font-weight: bold;`);
1718
console.info('');
1819

19-
}
20+
};

0 commit comments

Comments
 (0)