mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
Remove webpack@5.90.3 since it causes issues with the tests
This automatically removed some old eslint dependencies, which caused some conflicts in the custom linting plugin
This commit is contained in:
@@ -7,10 +7,8 @@
|
||||
*/
|
||||
import { TmplAstElement } from '@angular-eslint/bundled-angular-compiler';
|
||||
import { TemplateParserServices } from '@angular-eslint/utils';
|
||||
import {
|
||||
ESLintUtils,
|
||||
TSESLint,
|
||||
} from '@typescript-eslint/utils';
|
||||
import { ESLintUtils } from '@typescript-eslint/utils';
|
||||
import { RuleContext } from '@typescript-eslint/utils/ts-eslint';
|
||||
|
||||
import { fixture } from '../../../test/fixture';
|
||||
import {
|
||||
@@ -52,7 +50,7 @@ The only exception to this rule are unit tests, where we may want to use the bas
|
||||
|
||||
export const rule = ESLintUtils.RuleCreator.withoutDocs({
|
||||
...info,
|
||||
create(context: TSESLint.RuleContext<Message, unknown[]>) {
|
||||
create(context: RuleContext<Message, unknown[]>) {
|
||||
if (getFilename(context).includes('.spec.ts')) {
|
||||
// skip inline templates in unit tests
|
||||
return {};
|
||||
|
@@ -7,9 +7,9 @@
|
||||
*/
|
||||
import {
|
||||
ESLintUtils,
|
||||
TSESLint,
|
||||
TSESTree,
|
||||
} from '@typescript-eslint/utils';
|
||||
import { RuleContext } from '@typescript-eslint/utils/ts-eslint';
|
||||
|
||||
import { fixture } from '../../../test/fixture';
|
||||
import {
|
||||
@@ -57,7 +57,7 @@ export const info = {
|
||||
|
||||
export const rule = ESLintUtils.RuleCreator.withoutDocs({
|
||||
...info,
|
||||
create(context: TSESLint.RuleContext<Message, unknown[]>) {
|
||||
create(context: RuleContext<Message, unknown[]>) {
|
||||
const filename = getFilename(context);
|
||||
|
||||
if (filename.endsWith('.spec.ts')) {
|
||||
|
@@ -7,9 +7,9 @@
|
||||
*/
|
||||
import {
|
||||
ESLintUtils,
|
||||
TSESLint,
|
||||
TSESTree,
|
||||
} from '@typescript-eslint/utils';
|
||||
import { RuleContext } from '@typescript-eslint/utils/ts-eslint';
|
||||
|
||||
import { fixture } from '../../../test/fixture';
|
||||
import { getComponentSelectorNode } from '../../util/angular';
|
||||
@@ -58,7 +58,7 @@ Unit tests are exempt from this rule, because they may redefine components using
|
||||
|
||||
export const rule = ESLintUtils.RuleCreator.withoutDocs({
|
||||
...info,
|
||||
create(context: TSESLint.RuleContext<Message, unknown[]>) {
|
||||
create(context: RuleContext<Message, unknown[]>) {
|
||||
const filename = getFilename(context);
|
||||
|
||||
if (filename.endsWith('.spec.ts')) {
|
||||
|
@@ -7,9 +7,9 @@
|
||||
*/
|
||||
import {
|
||||
ESLintUtils,
|
||||
TSESLint,
|
||||
TSESTree,
|
||||
} from '@typescript-eslint/utils';
|
||||
import { RuleContext } from '@typescript-eslint/utils/ts-eslint';
|
||||
|
||||
import { fixture } from '../../../test/fixture';
|
||||
import {
|
||||
@@ -68,7 +68,7 @@ There are a few exceptions where the base class can still be used:
|
||||
|
||||
export const rule = ESLintUtils.RuleCreator.withoutDocs({
|
||||
...info,
|
||||
create(context: TSESLint.RuleContext<Message, unknown[]>) {
|
||||
create(context: RuleContext<Message, unknown[]>) {
|
||||
const filename = getFilename(context);
|
||||
|
||||
function handleUnthemedUsagesInTypescript(node: TSESTree.Identifier) {
|
||||
|
@@ -5,13 +5,17 @@
|
||||
*
|
||||
* http://www.dspace.org/license/
|
||||
*/
|
||||
import { TSESLint } from '@typescript-eslint/utils';
|
||||
import { RuleTester } from 'eslint';
|
||||
import {
|
||||
InvalidTestCase,
|
||||
RuleMetaData,
|
||||
RuleModule,
|
||||
ValidTestCase,
|
||||
} from '@typescript-eslint/utils/ts-eslint';
|
||||
import { EnumType } from 'typescript';
|
||||
|
||||
export type Meta = TSESLint.RuleMetaData<string>;
|
||||
export type Valid = TSESLint.ValidTestCase<unknown[]> | RuleTester.ValidTestCase;
|
||||
export type Invalid = TSESLint.InvalidTestCase<string, unknown[]> | RuleTester.InvalidTestCase;
|
||||
export type Meta = RuleMetaData<string>;
|
||||
export type Valid = ValidTestCase<unknown[]>;
|
||||
export type Invalid = InvalidTestCase<string, unknown[]>;
|
||||
|
||||
export interface DSpaceESLintRuleInfo {
|
||||
name: string;
|
||||
@@ -28,7 +32,7 @@ export interface NamedTests {
|
||||
export interface RuleExports {
|
||||
Message: EnumType,
|
||||
info: DSpaceESLintRuleInfo,
|
||||
rule: TSESLint.RuleModule<string>,
|
||||
rule: RuleModule<string>,
|
||||
tests: NamedTests,
|
||||
default: unknown,
|
||||
}
|
||||
|
@@ -5,17 +5,18 @@
|
||||
*
|
||||
* http://www.dspace.org/license/
|
||||
*/
|
||||
import { TSESTree } from '@typescript-eslint/utils';
|
||||
import {
|
||||
TSESLint,
|
||||
TSESTree,
|
||||
} from '@typescript-eslint/utils';
|
||||
RuleContext,
|
||||
SourceCode,
|
||||
} from '@typescript-eslint/utils/ts-eslint';
|
||||
|
||||
import {
|
||||
match,
|
||||
toUnixStylePath,
|
||||
} from './misc';
|
||||
|
||||
export type AnyRuleContext = TSESLint.RuleContext<string, unknown[]>;
|
||||
export type AnyRuleContext = RuleContext<string, unknown[]>;
|
||||
|
||||
/**
|
||||
* 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 {
|
||||
return toUnixStylePath(context.getFilename());
|
||||
}
|
||||
|
||||
export function getSourceCode(context: AnyRuleContext): TSESLint.SourceCode {
|
||||
export function getSourceCode(context: AnyRuleContext): SourceCode {
|
||||
// TSESLint claims this is deprecated, but the suggested alternative is undefined (could be a version mismatch between ESLint and TSESlint?)
|
||||
// eslint-disable-next-line deprecation/deprecation
|
||||
return context.getSourceCode();
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
import { RuleTester as TypeScriptRuleTester } from '@typescript-eslint/rule-tester';
|
||||
import { RuleTester } from 'eslint';
|
||||
import { RuleTester } from '@typescript-eslint/utils/ts-eslint';
|
||||
|
||||
import { themeableComponents } from '../src/util/theme-support';
|
||||
import {
|
||||
|
Reference in New Issue
Block a user