Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port builtin tslint rules #67455

Merged
merged 7 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion types/abbrev/abbrev-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ abbrev([{}, "foo"]); // $ExpectType { [abbreviation: string]: string; }
abbrev.monkeyPatch();

abbrs = [].abbrev();
const roArr: ReadonlyArray<string> = [];
const roArr: readonly string[] = [];
abbrs = roArr.abbrev();
abbrs = ({}).abbrev();
4 changes: 2 additions & 2 deletions types/abbrev/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export = abbrev;

declare function abbrev(words: ReadonlyArray<abbrev.Abbreviable>): { [abbreviation: string]: string };
declare function abbrev(...words: ReadonlyArray<abbrev.Abbreviable>): { [abbreviation: string]: string };
declare function abbrev(words: readonly abbrev.Abbreviable[]): { [abbreviation: string]: string };
declare function abbrev(...words: readonly abbrev.Abbreviable[]): { [abbreviation: string]: string };

declare namespace abbrev {
function monkeyPatch(): void;
Expand Down
3 changes: 2 additions & 1 deletion types/acc-wizard/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"rules": {
"@definitelytyped/dt-header": "off"
"@definitelytyped/dt-header": "off",
"@typescript-eslint/ban-types": "off"
}
}
1 change: 0 additions & 1 deletion types/acc-wizard/tslint.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": "@definitelytyped/dtslint/dt.json",
"rules": {
"ban-types": false,
"no-var-keyword": false,
"npm-naming": false,
"object-literal-shorthand": false,
Expand Down
2 changes: 1 addition & 1 deletion types/accedo__accedo-one/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ declare class AccedoClient {
* @returns A promise of the success of the operation
*/

sendLogs(logs: ReadonlyArray<AccedoLog.Logobject>): Promise<boolean>;
sendLogs(logs: readonly AccedoLog.Logobject[]): Promise<boolean>;
}

declare namespace AccedoLog {
Expand Down
6 changes: 5 additions & 1 deletion types/ace/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"rules": {
"@definitelytyped/dt-header": "off",
"@definitelytyped/strict-export-declare-modifiers": "off"
"@definitelytyped/strict-export-declare-modifiers": "off",
"@typescript-eslint/adjacent-overload-signatures": "off",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/naming-convention": "off"
}
}
4 changes: 0 additions & 4 deletions types/ace/tslint.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
{
"extends": "@definitelytyped/dtslint/dt.json",
"rules": {
"adjacent-overload-signatures": false,
"ban-types": false,
"interface-name": false,
"jsdoc-format": false,
"no-duplicate-variable": false,
"no-empty-interface": false,
"no-redundant-jsdoc-2": false,
"no-string-throw": false,
"no-var-keyword": false,
Expand Down
5 changes: 5 additions & 0 deletions types/acl/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"rules": {
"@typescript-eslint/no-empty-interface": "off"
jakebailey marked this conversation as resolved.
Show resolved Hide resolved
}
}
4 changes: 3 additions & 1 deletion types/actioncable/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"rules": {
"@definitelytyped/no-declare-current-package": "off",
"@definitelytyped/strict-export-declare-modifiers": "off",
"@definitelytyped/no-single-declare-module": "off"
"@definitelytyped/no-single-declare-module": "off",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/prefer-namespace": "off"
}
}
2 changes: 0 additions & 2 deletions types/actioncable/tslint.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"extends": "@definitelytyped/dtslint/dt.json",
"rules": {
"ban-types": false,
"no-internal-module": false,
"unified-signatures": false
}
}
2 changes: 1 addition & 1 deletion types/activex-excel/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8648,7 +8648,7 @@ declare namespace Excel {
UseStandardWidth: boolean | null;
readonly Validation: Validation;

// tslint:disable-next-line: ban-types
// eslint-disable-next-line @typescript-eslint/ban-types
Value: Exclude<any, Function> & ((RangeValueDataType?: XlRangeValueDataType) => any);
Value2: any;
VerticalAlignment: VerticalAlignments;
Expand Down
2 changes: 1 addition & 1 deletion types/activex-interop/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// tslint:disable-next-line no-empty-interface
// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface ActiveXObjectNameMap {}

interface ActiveXObject {
Expand Down
3 changes: 2 additions & 1 deletion types/activex-libreoffice/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"rules": {
"@definitelytyped/no-const-enum": "off",
"@definitelytyped/no-single-element-tuple-type": "off"
"@definitelytyped/no-single-element-tuple-type": "off",
"@typescript-eslint/ban-types": "off"
}
}
1 change: 0 additions & 1 deletion types/activex-libreoffice/tslint.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": "@definitelytyped/dtslint/dt.json",
"rules": {
"ban-types": false,
"no-const-enum": false,
"no-unnecessary-qualifier": false
}
Expand Down
28 changes: 14 additions & 14 deletions types/activex-mshtml/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31720,7 +31720,7 @@ declare namespace MSHTML {
removeEventListener(type: string, listener: any, useCapture: boolean): void;
}

// tslint:disable-next-line:interface-name
// eslint-disable-next-line @typescript-eslint/naming-convention
interface IHTMLAreasCollection {
add(element: IHTMLElement, before?: any): void;
item(name?: any, index?: any): any;
Expand All @@ -31747,7 +31747,7 @@ declare namespace MSHTML {
private constructor();
}

// tslint:disable-next-line:interface-name
// eslint-disable-next-line @typescript-eslint/naming-convention
interface IHTMLBookmarkCollection {
item(index: number): any;
readonly length: number;
Expand All @@ -31772,7 +31772,7 @@ declare namespace MSHTML {
readonly type: number;
}

// tslint:disable-next-line:interface-name
// eslint-disable-next-line @typescript-eslint/naming-convention
interface IHTMLCSSStyleDeclaration {
accelerator: string;
alignmentBaseline: string;
Expand Down Expand Up @@ -32249,7 +32249,7 @@ declare namespace MSHTML {
readonly version: string;
}

// tslint:disable-next-line:interface-name
// eslint-disable-next-line @typescript-eslint/naming-convention
interface IHTMLDocumentCompatibleInfoCollection {
item(index: number): IHTMLDocumentCompatibleInfo;
readonly length: number;
Expand Down Expand Up @@ -32287,7 +32287,7 @@ declare namespace MSHTML {
value: string;
}

// tslint:disable-next-line:interface-name
// eslint-disable-next-line @typescript-eslint/naming-convention
interface IHTMLDOMChildrenCollection {
item(index: number): any;
readonly length: number;
Expand Down Expand Up @@ -32520,7 +32520,7 @@ declare namespace MSHTML {
tagUrn: string;
}

// tslint:disable-next-line:interface-name
// eslint-disable-next-line @typescript-eslint/naming-convention
interface IHTMLElementCollection {
item(name?: any, index?: any): any;
length: number;
Expand Down Expand Up @@ -32556,14 +32556,14 @@ declare namespace MSHTML {
readonly y: number;
}

// tslint:disable-next-line:interface-name
// eslint-disable-next-line @typescript-eslint/naming-convention
interface IHTMLFiltersCollection {
item(pvarIndex: any): any;
readonly length: number;
(pvarIndex: any): any;
}

// tslint:disable-next-line:interface-name
// eslint-disable-next-line @typescript-eslint/naming-convention
interface IHTMLFormElement {
action: string;
dir: string;
Expand Down Expand Up @@ -32728,7 +32728,7 @@ declare namespace MSHTML {
top: number;
}

// tslint:disable-next-line:interface-name
// eslint-disable-next-line @typescript-eslint/naming-convention
interface IHTMLRectCollection {
item(pvarIndex: any): any;
readonly length: number;
Expand Down Expand Up @@ -33040,7 +33040,7 @@ declare namespace MSHTML {
readonly selector: string;
}

// tslint:disable-next-line:interface-name
// eslint-disable-next-line @typescript-eslint/naming-convention
interface IHTMLStyleSheetPagesCollection {
item(index: number): IHTMLStyleSheetPage;
readonly length: number;
Expand All @@ -33055,7 +33055,7 @@ declare namespace MSHTML {
readonly style: IHTMLRuleStyle;
}

// tslint:disable-next-line:interface-name
// eslint-disable-next-line @typescript-eslint/naming-convention
interface IHTMLStyleSheetRulesAppliedCollection {
item(index: number): IHTMLStyleSheetRule;
readonly length: number;
Expand All @@ -33065,14 +33065,14 @@ declare namespace MSHTML {
(index: number): IHTMLStyleSheetRule;
}

// tslint:disable-next-line:interface-name
// eslint-disable-next-line @typescript-eslint/naming-convention
interface IHTMLStyleSheetRulesCollection {
item(index: number): IHTMLStyleSheetRule;
readonly length: number;
(index: number): IHTMLStyleSheetRule;
}

// tslint:disable-next-line:interface-name
// eslint-disable-next-line @typescript-eslint/naming-convention
interface IHTMLStyleSheetsCollection {
item(pvarIndex: any): any;
readonly length: number;
Expand Down Expand Up @@ -33160,7 +33160,7 @@ declare namespace MSHTML {
text: string;
}

// tslint:disable-next-line:interface-name
// eslint-disable-next-line @typescript-eslint/naming-convention
interface IHTMLWindow2 {
/** @param message [message=''] */
alert(message?: string): void;
Expand Down
12 changes: 6 additions & 6 deletions types/activex-msxml2/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,7 @@ declare namespace MSXML2 {
}

/** IMXNamespacePrefixes interface */
// tslint:disable-next-line:interface-name
// eslint-disable-next-line @typescript-eslint/naming-convention
interface IMXNamespacePrefixes {
item(index: number): string;
readonly length: number;
Expand Down Expand Up @@ -869,7 +869,7 @@ declare namespace MSXML2 {
}

/** XML Schema Item Collection */
// tslint:disable-next-line:interface-name
// eslint-disable-next-line @typescript-eslint/naming-convention
interface ISchemaItemCollection {
item(index: number): ISchemaItem;
itemByName(name: string): ISchemaItem;
Expand All @@ -879,7 +879,7 @@ declare namespace MSXML2 {
}

/** XML Schema String Collection */
// tslint:disable-next-line:interface-name
// eslint-disable-next-line @typescript-eslint/naming-convention
interface ISchemaStringCollection {
item(index: number): string;
readonly length: number;
Expand Down Expand Up @@ -1986,7 +1986,7 @@ declare namespace MSXML2 {
hasFeature(feature: string, version: string): boolean;
}

// tslint:disable-next-line:interface-name
// eslint-disable-next-line @typescript-eslint/naming-convention
interface IXMLDOMNamedNodeMap {
/** lookup item by name */
getNamedItem(name: string): IXMLDOMNode;
Expand Down Expand Up @@ -2117,7 +2117,7 @@ declare namespace MSXML2 {
readonly xml: string;
}

// tslint:disable-next-line:interface-name
// eslint-disable-next-line @typescript-eslint/naming-convention
interface IXMLDOMNodeList {
/** collection of nodes */
item(index: number): IXMLDOMNode;
Expand Down Expand Up @@ -2266,7 +2266,7 @@ declare namespace MSXML2 {
}

/** XML Schemas Collection */
// tslint:disable-next-line:interface-name
// eslint-disable-next-line @typescript-eslint/naming-convention
interface IXMLDOMSchemaCollection {
/** add a new schema */
add(namespaceURI: string, var_1: any): void;
Expand Down
2 changes: 1 addition & 1 deletion types/activex-office/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4917,7 +4917,7 @@ declare namespace Office {
}

/** For Macintosh only */
// tslint:disable-next-line:interface-name
// eslint-disable-next-line @typescript-eslint/naming-convention
interface IFoundFiles {
readonly Count: number;
Item(Index: number): string;
Expand Down
4 changes: 2 additions & 2 deletions types/add/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
declare function accSum(numbers: ReadonlyArray<number>): number;
declare function accSum(numbers: readonly number[]): number;

export = accSum;

declare namespace accSum {
function dumbSum(numbers: ReadonlyArray<number>): number;
function dumbSum(numbers: readonly number[]): number;
function fastTwoSum(a: number, b: number): [number, number, null];

/**
Expand Down
8 changes: 4 additions & 4 deletions types/adeira__js/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
type Maybe<T> = null | undefined | T;

export function invariant(condition: boolean, format: string, ...args: ReadonlyArray<any>): asserts condition;
export function invariant(condition: boolean, format: string, ...args: readonly any[]): asserts condition;

export function isBrowser(): boolean;

Expand All @@ -12,10 +12,10 @@ export function isObjectEmpty(value: any): boolean;

export function nullthrows<T>(x: Maybe<T>, message?: string): T extends null | undefined ? never : T;

export function sprintf(format: string, ...args: ReadonlyArray<any>): string;
export function sprintf(format: string, ...args: readonly any[]): string;

export function warning(condition: boolean, format: string, ...args: ReadonlyArray<any>): void;
export function warning(condition: boolean, format: string, ...args: readonly any[]): void;

export function rangeMap<T>(n: number, fn: (i: number) => T): ReadonlyArray<T>;
export function rangeMap<T>(n: number, fn: (i: number) => T): readonly T[];

export {};
2 changes: 1 addition & 1 deletion types/adm-zip/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ declare namespace AdmZip {
* data and creates the headers required to write in the zip file.
*/
// disable warning about the I-prefix in interface name to prevent breaking stuff for users without a major bump
// tslint:disable-next-line:interface-name
// eslint-disable-next-line @typescript-eslint/naming-convention
interface IZipEntry {
/**
* Represents the full name and path of the file
Expand Down
2 changes: 1 addition & 1 deletion types/airbnb-prop-types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export function childrenSequenceOf<T = PropTypes.ReactNodeLike>(

export function componentWithName<T = PropTypes.ReactNodeLike>(
name: string | RegExp,
options?: { stripHOCs: ReadonlyArray<string> },
options?: { stripHOCs: readonly string[] },
): PropTypes.Requireable<T>;

export function disallowedIf<T>(
Expand Down
6 changes: 6 additions & 0 deletions types/akamai-edgeworkers/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"rules": {
"@typescript-eslint/no-empty-interface": "off",
"no-duplicate-imports": "off"
}
}
5 changes: 1 addition & 4 deletions types/akamai-edgeworkers/tslint.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
{
"extends": "@definitelytyped/dtslint/dt.json",
"rules": {
"no-empty-interface": false
}
"extends": "@definitelytyped/dtslint/dt.json"
}
2 changes: 1 addition & 1 deletion types/akumina-core/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1673,7 +1673,7 @@ declare class Templates {
GetFullViewPrefix(): string;
}

// tslint:disable-next-line interface-name
// eslint-disable-next-line @typescript-eslint/naming-convention
interface IConstants {
LOADER_STEPS_ENABLE_AUTOCLEAR: boolean;
LOADER_STEPS_ENABLE_FETCHCONFIGCONTEXT: boolean;
Expand Down
2 changes: 1 addition & 1 deletion types/akumina-core/interfaces/IGetListRequest.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import ILanguageRequest from "./ILanguageRequest";

// tslint:disable-next-line interface-name
// eslint-disable-next-line @typescript-eslint/naming-convention
export default interface IGetListRequest {
listName: string;
selectFields: string;
Expand Down
Loading
Loading