Skip to content

Commit bce8268

Browse files
authored
Update lint rules for dt tools plugin (DefinitelyTyped#66439)
* Update lint rules for @definitelytyped/ plugin 1. update .eslintrc.cjs with the plugin (add `extends` and remove explicit `rules` entries). 2. update lint overrides in various .eslintrc.json 3. update lint overrides in inline comments * Cleanup .eslintrc; undo overeager @definitelytyped/ replacement
1 parent f68db09 commit bce8268

File tree

2,231 files changed

+3932
-4085
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,231 files changed

+3932
-4085
lines changed

.eslintrc.cjs

+1-153
Original file line numberDiff line numberDiff line change
@@ -1,156 +1,4 @@
11
module.exports = {
22
root: true,
3-
parser: '@typescript-eslint/parser',
4-
parserOptions: {
5-
project: true,
6-
warnOnUnsupportedTypeScriptVersion: false,
7-
},
8-
plugins: ['@typescript-eslint', 'jsdoc'],
9-
rules: {
10-
'dt-header': 'error',
11-
'export-just-namespace': 'error',
12-
'jsdoc/check-tag-names': [
13-
'error',
14-
{
15-
// TODO: Some (but not all) of these tags should likely be removed from this list.
16-
// Additionally, some may need to be contributed to eslint-plugin-jsdoc.
17-
definedTags: [
18-
'addVersion',
19-
'also',
20-
'api',
21-
'author',
22-
'beta',
23-
'brief',
24-
'category',
25-
'cfg',
26-
'chainable',
27-
'check',
28-
'checkReturnValue',
29-
'classDescription',
30-
'condparamprivilege',
31-
'constraint',
32-
'credits',
33-
'declaration',
34-
'defApiFeature',
35-
'defaultValue',
36-
'detail',
37-
'end',
38-
'eventproperty',
39-
'experimental',
40-
'export',
41-
'expose',
42-
'extendscript',
43-
'factory',
44-
'field',
45-
'final',
46-
'fixme',
47-
'fluent',
48-
'for',
49-
'governance',
50-
'header',
51-
'hidden-property',
52-
'hidden',
53-
'id',
54-
'jsx',
55-
'jsxImportSource',
56-
'label',
57-
'language',
58-
'legacy',
59-
'link',
60-
'listen',
61-
'locus',
62-
'methodOf',
63-
'minVersion',
64-
'ngdoc',
65-
'nonstandard',
66-
'note',
67-
'npm',
68-
'observable',
69-
'option',
70-
'optionobject',
71-
'options',
72-
'packageDocumentation',
73-
'param',
74-
'parent',
75-
'platform',
76-
'plugin',
77-
'preserve',
78-
'privateRemarks',
79-
'privilegeLevel',
80-
'privilegeName',
81-
'proposed',
82-
'range',
83-
'readOnly',
84-
'related',
85-
'remark',
86-
'remarks',
87-
'required',
88-
'requires',
89-
'restriction',
90-
'returnType',
91-
'section',
92-
'see',
93-
'since',
94-
'const',
95-
'singleton',
96-
'source',
97-
'struct',
98-
'suppress',
99-
'targetfolder',
100-
'enum',
101-
'title',
102-
'record',
103-
'title',
104-
'TODO',
105-
'trigger',
106-
'triggers',
107-
'typeparam',
108-
'typeParam',
109-
'unsupported',
110-
'url',
111-
'usage',
112-
'warn',
113-
'warning',
114-
'version',
115-
],
116-
typed: true,
117-
},
118-
],
119-
'no-any-union': 'error',
120-
'no-bad-reference': 'error',
121-
'no-const-enum': 'error',
122-
'no-dead-reference': 'error',
123-
'no-declare-current-package': 'error',
124-
'no-import-default-of-export-equals': 'error',
125-
'no-outside-dependencies': 'error',
126-
'no-self-import': 'error',
127-
'no-single-element-tuple-type': 'error',
128-
'no-unnecessary-generics': 'error',
129-
'no-useless-files': 'error',
130-
'prefer-declare-function': 'error',
131-
'redundant-undefined': 'error',
132-
'trim-file': 'error',
133-
'@typescript-eslint/ban-ts-comment': [
134-
'error',
135-
{
136-
'ts-expect-error': false, // Used in tests.
137-
'ts-ignore': 'allow-with-description',
138-
'ts-nocheck': true,
139-
'ts-check': false,
140-
}
141-
],
142-
},
143-
settings: {
144-
jsdoc: {
145-
tagNamePreference: {
146-
argument: 'argument',
147-
exception: 'exception',
148-
function: 'function',
149-
method: 'method',
150-
param: 'param',
151-
return: 'return',
152-
returns: 'returns',
153-
},
154-
},
155-
},
3+
extends: ["plugin:@definitelytyped/all"],
1564
};

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"@definitelytyped/dtslint-runner": "latest",
3030
"@definitelytyped/header-parser": "latest",
3131
"@definitelytyped/utils": "latest",
32+
"@definitelytyped/eslint-plugin": "latest",
3233
"@octokit/core": "^3.5.1",
3334
"@octokit/rest": "^16.0.0",
3435
"comment-json": "^4.2.3",

types/abs-svg-path/.eslintrc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"rules": {
3-
"no-single-element-tuple-type": "off"
3+
"@definitelytyped/no-single-element-tuple-type": "off"
44
}
55
}

types/absolute/.eslintrc.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"rules": {
3-
"dt-header": "off",
4-
"trim-file": "off"
3+
"@definitelytyped/dt-header": "off",
4+
"@definitelytyped/trim-file": "off"
55
}
66
}

types/abstract-leveldown/index.d.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ export interface AbstractLevelDOWN<K = any, V = any> extends AbstractOptions {
5656
}
5757

5858
export interface AbstractLevelDOWNConstructor {
59-
// eslint-disable-next-line no-unnecessary-generics
59+
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
6060
new <K = any, V = any>(location: string): AbstractLevelDOWN<K, V>;
61-
// eslint-disable-next-line no-unnecessary-generics
61+
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
6262
<K = any, V = any>(location: string): AbstractLevelDOWN<K, V>;
6363
}
6464

@@ -97,9 +97,9 @@ export interface AbstractChainedBatch<K = any, V = any> extends AbstractOptions
9797
}
9898

9999
export interface AbstractChainedBatchConstructor {
100-
// eslint-disable-next-line no-unnecessary-generics
100+
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
101101
new <K = any, V = any>(db: any): AbstractChainedBatch<K, V>;
102-
// eslint-disable-next-line no-unnecessary-generics
102+
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
103103
<K = any, V = any>(db: any): AbstractChainedBatch<K, V>;
104104
}
105105

@@ -110,9 +110,9 @@ export interface AbstractIterator<K, V> extends AbstractOptions {
110110
}
111111

112112
export interface AbstractIteratorConstructor {
113-
// eslint-disable-next-line no-unnecessary-generics
113+
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
114114
new <K = any, V = any>(db: any): AbstractIterator<K, V>;
115-
// eslint-disable-next-line no-unnecessary-generics
115+
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
116116
<K = any, V = any>(db: any): AbstractIterator<K, V>;
117117
}
118118

types/acc-wizard/.eslintrc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"rules": {
3-
"dt-header": "off"
3+
"@definitelytyped/dt-header": "off"
44
}
55
}

types/ace/.eslintrc.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"rules": {
3-
"dt-header": "off",
4-
"trim-file": "off"
3+
"@definitelytyped/dt-header": "off",
4+
"@definitelytyped/trim-file": "off"
55
}
66
}

types/actioncable/.eslintrc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"rules": {
3-
"no-declare-current-package": "off"
3+
"@definitelytyped/no-declare-current-package": "off"
44
}
55
}

types/activex-access/.eslintrc.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"rules": {
3-
"no-const-enum": "off",
4-
"no-single-element-tuple-type": "off"
3+
"@definitelytyped/no-const-enum": "off",
4+
"@definitelytyped/no-single-element-tuple-type": "off"
55
}
66
}

types/activex-access/index.d.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -3526,9 +3526,9 @@ declare namespace Access {
35263526
interface Children {
35273527
readonly Count: number;
35283528
IsMemberSafe(dispid: number): boolean;
3529-
// eslint-disable-next-line no-unnecessary-generics
3529+
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
35303530
Item<T = Control>(Index: number | string): T;
3531-
// eslint-disable-next-line no-unnecessary-generics
3531+
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
35323532
<T = Control>(Index: number | string): T;
35333533
}
35343534

@@ -4021,10 +4021,10 @@ declare namespace Access {
40214021
readonly Application: Application;
40224022
readonly Count: number;
40234023
IsMemberSafe(dispid: number): boolean;
4024-
// eslint-disable-next-line no-unnecessary-generics
4024+
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
40254025
Item<T = Control>(Index: number | string): T;
40264026
readonly Parent: any;
4027-
// eslint-disable-next-line no-unnecessary-generics
4027+
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
40284028
<T = Control>(Index: number | string): T;
40294029
}
40304030

types/activex-adodb/.eslintrc.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"rules": {
3-
"no-const-enum": "off",
4-
"no-single-element-tuple-type": "off"
3+
"@definitelytyped/no-const-enum": "off",
4+
"@definitelytyped/no-single-element-tuple-type": "off"
55
}
66
}

types/activex-adox/.eslintrc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"rules": {
3-
"no-const-enum": "off"
3+
"@definitelytyped/no-const-enum": "off"
44
}
55
}

types/activex-dao/.eslintrc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"rules": {
3-
"no-const-enum": "off"
3+
"@definitelytyped/no-const-enum": "off"
44
}
55
}
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"rules": {
3-
"no-single-element-tuple-type": "off"
3+
"@definitelytyped/no-single-element-tuple-type": "off"
44
}
55
}

types/activex-diskquota/activex-diskquota-tests.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const collectionToArray = <T>(col: any) => { // eslint-disable-line no-unnecessary-generics
1+
const collectionToArray = <T>(col: any) => { // eslint-disable-line @definitelytyped/no-unnecessary-generics
22
const results: T[] = [];
33
const enumerator = new Enumerator<T>(col);
44
enumerator.moveFirst();

types/activex-diskquota/index.d.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
/// <reference types="activex-interop" />
88

99
declare namespace DiskQuotaTypeLibrary {
10-
// eslint-disable-next-line no-const-enum
10+
// eslint-disable-next-line @definitelytyped/no-const-enum
1111
const enum AccountStatusConstants {
1212
dqAcctDeleted = 2,
1313
dqAcctInvalid = 3,
@@ -17,14 +17,14 @@ declare namespace DiskQuotaTypeLibrary {
1717
dqAcctUnresolved = 5,
1818
}
1919

20-
// eslint-disable-next-line no-const-enum
20+
// eslint-disable-next-line @definitelytyped/no-const-enum
2121
const enum QuotaStateConstants {
2222
dqStateDisable = 0,
2323
dqStateEnforce = 2,
2424
dqStateTrack = 1,
2525
}
2626

27-
// eslint-disable-next-line no-const-enum
27+
// eslint-disable-next-line @definitelytyped/no-const-enum
2828
const enum UserNameResolutionConstants {
2929
dqResolveAsync = 2,
3030
dqResolveNone = 0,

types/activex-excel/.eslintrc.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"rules": {
3-
"no-const-enum": "off",
4-
"no-single-element-tuple-type": "off"
3+
"@definitelytyped/no-const-enum": "off",
4+
"@definitelytyped/no-single-element-tuple-type": "off"
55
}
66
}
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"rules": {
3-
"no-const-enum": "off",
4-
"no-single-element-tuple-type": "off"
3+
"@definitelytyped/no-const-enum": "off",
4+
"@definitelytyped/no-single-element-tuple-type": "off"
55
}
66
}

0 commit comments

Comments
 (0)