Skip to content

Commit 88e145c

Browse files
authored
Merge pull request DSpace#3283 from DSpace/dependabot/npm_and_yarn/webpack-5.94.0
Bump webpack from 5.90.3 to 5.94.0
2 parents 027a4e5 + 5f922c0 commit 88e145c

11 files changed

Lines changed: 69 additions & 79 deletions

lint/src/rules/html/themed-component-usages.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@
77
*/
88
import { TmplAstElement } from '@angular-eslint/bundled-angular-compiler';
99
import { TemplateParserServices } from '@angular-eslint/utils';
10-
import {
11-
ESLintUtils,
12-
TSESLint,
13-
} from '@typescript-eslint/utils';
10+
import { ESLintUtils } from '@typescript-eslint/utils';
11+
import { RuleContext } from '@typescript-eslint/utils/ts-eslint';
1412

1513
import { fixture } from '../../../test/fixture';
1614
import {
@@ -52,7 +50,7 @@ The only exception to this rule are unit tests, where we may want to use the bas
5250

5351
export const rule = ESLintUtils.RuleCreator.withoutDocs({
5452
...info,
55-
create(context: TSESLint.RuleContext<Message, unknown[]>) {
53+
create(context: RuleContext<Message, unknown[]>) {
5654
if (getFilename(context).includes('.spec.ts')) {
5755
// skip inline templates in unit tests
5856
return {};

lint/src/rules/ts/themed-component-classes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
*/
88
import {
99
ESLintUtils,
10-
TSESLint,
1110
TSESTree,
1211
} from '@typescript-eslint/utils';
12+
import { RuleContext } from '@typescript-eslint/utils/ts-eslint';
1313

1414
import { fixture } from '../../../test/fixture';
1515
import {
@@ -57,7 +57,7 @@ export const info = {
5757

5858
export const rule = ESLintUtils.RuleCreator.withoutDocs({
5959
...info,
60-
create(context: TSESLint.RuleContext<Message, unknown[]>) {
60+
create(context: RuleContext<Message, unknown[]>) {
6161
const filename = getFilename(context);
6262

6363
if (filename.endsWith('.spec.ts')) {

lint/src/rules/ts/themed-component-selectors.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
*/
88
import {
99
ESLintUtils,
10-
TSESLint,
1110
TSESTree,
1211
} from '@typescript-eslint/utils';
12+
import { RuleContext } from '@typescript-eslint/utils/ts-eslint';
1313

1414
import { fixture } from '../../../test/fixture';
1515
import { getComponentSelectorNode } from '../../util/angular';
@@ -58,7 +58,7 @@ Unit tests are exempt from this rule, because they may redefine components using
5858

5959
export const rule = ESLintUtils.RuleCreator.withoutDocs({
6060
...info,
61-
create(context: TSESLint.RuleContext<Message, unknown[]>) {
61+
create(context: RuleContext<Message, unknown[]>) {
6262
const filename = getFilename(context);
6363

6464
if (filename.endsWith('.spec.ts')) {

lint/src/rules/ts/themed-component-usages.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
*/
88
import {
99
ESLintUtils,
10-
TSESLint,
1110
TSESTree,
1211
} from '@typescript-eslint/utils';
12+
import { RuleContext } from '@typescript-eslint/utils/ts-eslint';
1313

1414
import { fixture } from '../../../test/fixture';
1515
import {
@@ -68,7 +68,7 @@ There are a few exceptions where the base class can still be used:
6868

6969
export const rule = ESLintUtils.RuleCreator.withoutDocs({
7070
...info,
71-
create(context: TSESLint.RuleContext<Message, unknown[]>) {
71+
create(context: RuleContext<Message, unknown[]>) {
7272
const filename = getFilename(context);
7373

7474
function handleUnthemedUsagesInTypescript(node: TSESTree.Identifier) {

lint/src/util/structure.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,17 @@
55
*
66
* http://www.dspace.org/license/
77
*/
8-
import { TSESLint } from '@typescript-eslint/utils';
9-
import { RuleTester } from 'eslint';
8+
import {
9+
InvalidTestCase,
10+
RuleMetaData,
11+
RuleModule,
12+
ValidTestCase,
13+
} from '@typescript-eslint/utils/ts-eslint';
1014
import { EnumType } from 'typescript';
1115

12-
export type Meta = TSESLint.RuleMetaData<string>;
13-
export type Valid = TSESLint.ValidTestCase<unknown[]> | RuleTester.ValidTestCase;
14-
export type Invalid = TSESLint.InvalidTestCase<string, unknown[]> | RuleTester.InvalidTestCase;
16+
export type Meta = RuleMetaData<string>;
17+
export type Valid = ValidTestCase<unknown[]>;
18+
export type Invalid = InvalidTestCase<string, unknown[]>;
1519

1620
export interface DSpaceESLintRuleInfo {
1721
name: string;
@@ -28,7 +32,7 @@ export interface NamedTests {
2832
export interface RuleExports {
2933
Message: EnumType,
3034
info: DSpaceESLintRuleInfo,
31-
rule: TSESLint.RuleModule<string>,
35+
rule: RuleModule<string>,
3236
tests: NamedTests,
3337
default: unknown,
3438
}

lint/src/util/typescript.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,18 @@
55
*
66
* http://www.dspace.org/license/
77
*/
8+
import { TSESTree } from '@typescript-eslint/utils';
89
import {
9-
TSESLint,
10-
TSESTree,
11-
} from '@typescript-eslint/utils';
10+
RuleContext,
11+
SourceCode,
12+
} from '@typescript-eslint/utils/ts-eslint';
1213

1314
import {
1415
match,
1516
toUnixStylePath,
1617
} from './misc';
1718

18-
export type AnyRuleContext = TSESLint.RuleContext<string, unknown[]>;
19+
export type AnyRuleContext = RuleContext<string, unknown[]>;
1920

2021
/**
2122
* Return the current filename based on the ESLint rule context as a Unix-style path.
@@ -27,7 +28,7 @@ export function getFilename(context: AnyRuleContext): string {
2728
return toUnixStylePath(context.getFilename());
2829
}
2930

30-
export function getSourceCode(context: AnyRuleContext): TSESLint.SourceCode {
31+
export function getSourceCode(context: AnyRuleContext): SourceCode {
3132
// TSESLint claims this is deprecated, but the suggested alternative is undefined (could be a version mismatch between ESLint and TSESlint?)
3233
// eslint-disable-next-line deprecation/deprecation
3334
return context.getSourceCode();

lint/test/testing.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88

99
import { RuleTester as TypeScriptRuleTester } from '@typescript-eslint/rule-tester';
10-
import { RuleTester } from 'eslint';
10+
import { RuleTester } from '@typescript-eslint/utils/ts-eslint';
1111

1212
import { themeableComponents } from '../src/util/theme-support';
1313
import {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@
213213
"sass-resources-loader": "^2.2.5",
214214
"ts-node": "^8.10.2",
215215
"typescript": "~5.3.3",
216-
"webpack": "5.90.3",
216+
"webpack": "5.94.0",
217217
"webpack-bundle-analyzer": "^4.8.0",
218218
"webpack-cli": "^5.1.4",
219219
"webpack-dev-server": "^4.15.1"

webpack/webpack.common.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ const SCSS_LOADERS = [
7979

8080
export const commonExports = {
8181
plugins: [
82+
// @ts-expect-error: EnvironmentPlugin constructor types are currently to strict see issue https://github.com/webpack/webpack/issues/18719
8283
new EnvironmentPlugin({
8384
languageHashes: getFileHashes(path.join(__dirname, '..', 'src', 'assets', 'i18n'), /.*\.json5/g),
8485
}),

webpack/webpack.prod.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
import { commonExports } from './webpack.common';
2-
import { projectRoot } from './helpers';
1+
import { EnvironmentPlugin } from 'webpack';
32

4-
const webpack = require('webpack');
3+
import { projectRoot } from './helpers';
4+
import { commonExports } from './webpack.common';
55

66
module.exports = Object.assign({}, commonExports, {
77
plugins: [
88
...commonExports.plugins,
9-
new webpack.EnvironmentPlugin({
9+
// @ts-expect-error: EnvironmentPlugin constructor types are currently to strict see issue https://github.com/webpack/webpack/issues/18719
10+
new EnvironmentPlugin({
1011
'process.env': {
11-
NODE_ENV: JSON.stringify('production'),
12-
AOT: true
13-
}
12+
NODE_ENV: 'production',
13+
AOT: true,
14+
},
1415
}),
1516
],
1617
mode: 'production',

0 commit comments

Comments
 (0)