@definitelytyped/eslint-plugin 0.0.187 → 0.0.189
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/dist/configs/all.js +1 -0
- package/dist/configs/all.js.map +1 -1
- package/dist/rules/index.d.ts +1 -1
- package/dist/rules/no-bad-reference.d.ts +1 -1
- package/dist/rules/no-bad-reference.js +172 -28
- package/dist/rules/no-bad-reference.js.map +1 -1
- package/dist/rules/no-declare-current-package.js +4 -1
- package/dist/rules/no-declare-current-package.js.map +1 -1
- package/dist/rules/no-import-default-of-export-equals.js +4 -3
- package/dist/rules/no-import-default-of-export-equals.js.map +1 -1
- package/dist/rules/no-import-of-dev-dependencies.js +32 -60
- package/dist/rules/no-import-of-dev-dependencies.js.map +1 -1
- package/dist/rules/no-old-dt-header.js +2 -1
- package/dist/rules/no-old-dt-header.js.map +1 -1
- package/dist/rules/no-relative-import-in-test.js +2 -3
- package/dist/rules/no-relative-import-in-test.js.map +1 -1
- package/dist/rules/no-self-import.js +3 -0
- package/dist/rules/no-self-import.js.map +1 -1
- package/dist/rules/prefer-declare-function.js +2 -1
- package/dist/rules/prefer-declare-function.js.map +1 -1
- package/dist/util.d.ts +15 -0
- package/dist/util.js +50 -8
- package/dist/util.js.map +1 -1
- package/package.json +2 -2
- package/src/configs/all.ts +1 -0
- package/src/rules/no-bad-reference.ts +176 -33
- package/src/rules/no-declare-current-package.ts +4 -1
- package/src/rules/no-import-default-of-export-equals.ts +2 -1
- package/src/rules/no-import-of-dev-dependencies.ts +40 -59
- package/src/rules/no-old-dt-header.ts +2 -1
- package/src/rules/no-relative-import-in-test.ts +2 -5
- package/src/rules/no-self-import.ts +3 -0
- package/src/rules/prefer-declare-function.ts +2 -1
- package/src/util.ts +69 -9
- package/test/fixtureTester.ts +64 -0
- package/test/fixtures/notNeededPackages.json +3 -0
- package/test/fixtures/package.json +4 -0
- package/test/fixtures/types/foo/foo-tests.ts +0 -0
- package/test/fixtures/types/foo/index.d.ts +1 -0
- package/test/fixtures/types/foo/package.json +5 -0
- package/test/fixtures/types/foo/tsconfig.json +20 -0
- package/test/fixtures/types/foo/v1/foo-tests.ts +0 -0
- package/test/fixtures/types/foo/v1/index.d.ts +1 -0
- package/test/fixtures/types/foo/v1/package.json +5 -0
- package/test/fixtures/types/foo/v1/tsconfig.json +20 -0
- package/test/fixtures/types/no-bad-reference/index.d.ts +16 -0
- package/test/fixtures/types/no-bad-reference/no-bad-reference-tests.ts +2 -0
- package/test/fixtures/types/no-bad-reference/package.json +5 -0
- package/test/fixtures/types/no-bad-reference/tsconfig.json +20 -0
- package/test/fixtures/types/no-bad-reference/v0.1/index.d.ts +15 -0
- package/test/fixtures/types/no-bad-reference/v0.1/no-bad-reference-tests.ts +0 -0
- package/test/fixtures/types/no-bad-reference/v0.1/package.json +5 -0
- package/test/fixtures/types/no-bad-reference/v0.1/tsconfig.json +20 -0
- package/test/fixtures/types/no-bad-reference/v11/index.d.ts +15 -0
- package/test/fixtures/types/no-bad-reference/v11/no-bad-reference-tests.ts +0 -0
- package/test/fixtures/types/no-bad-reference/v11/package.json +5 -0
- package/test/fixtures/types/no-bad-reference/v11/tsconfig.json +20 -0
- package/test/fixtures/types/no-declare-current-package/index.d.ts +1 -0
- package/test/fixtures/types/no-declare-current-package/no-declare-current-package-tests.ts +0 -0
- package/test/fixtures/types/no-declare-current-package/package.json +8 -0
- package/test/fixtures/types/no-declare-current-package/test/deep/import.d.ts +1 -0
- package/test/fixtures/types/no-declare-current-package/tsconfig.json +20 -0
- package/test/fixtures/types/no-declare-current-package-other/index.d.ts +2 -0
- package/test/fixtures/types/no-declare-current-package-other/no-declare-current-package-other-tests.ts +0 -0
- package/test/fixtures/types/no-declare-current-package-other/package.json +8 -0
- package/test/fixtures/types/no-declare-current-package-other/tsconfig.json +20 -0
- package/test/fixtures/types/no-import-of-dev-dependencies/bad.d.ts +5 -0
- package/test/fixtures/types/no-import-of-dev-dependencies/index.d.ts +4 -0
- package/test/fixtures/types/no-import-of-dev-dependencies/no-import-of-dev-dependencies-tests.ts +9 -0
- package/test/fixtures/types/no-import-of-dev-dependencies/package.json +14 -0
- package/test/fixtures/types/no-import-of-dev-dependencies/tsconfig.json +20 -0
- package/test/fixtures/types/no-relative-references/index.d.ts +12 -0
- package/test/fixtures/types/no-relative-references/no-relative-references-tests.ts +0 -0
- package/test/fixtures/types/no-relative-references/other/other.d.ts +7 -0
- package/test/fixtures/types/no-relative-references/package.json +5 -0
- package/test/fixtures/types/no-relative-references/tsconfig.json +20 -0
- package/test/fixtures/types/no-relative-references/v1/index.d.ts +15 -0
- package/test/fixtures/types/no-relative-references/v1/no-relative-references-tests.ts +0 -0
- package/test/fixtures/types/no-relative-references/v1/other/other.d.ts +7 -0
- package/test/fixtures/types/no-relative-references/v1/package.json +5 -0
- package/test/fixtures/types/no-relative-references/v1/tsconfig.json +20 -0
- package/test/fixtures/types/no-self-import/bad.d.ts +8 -0
- package/test/fixtures/types/no-self-import/index.d.ts +7 -0
- package/test/fixtures/types/no-self-import/no-self-import-tests.ts +9 -0
- package/test/fixtures/types/no-self-import/package.json +11 -0
- package/test/fixtures/types/no-self-import/tsconfig.json +20 -0
- package/test/fixtures/types/other/index.d.ts +1 -0
- package/test/fixtures/types/other/other-tests.ts +0 -0
- package/test/fixtures/types/other/package.json +5 -0
- package/test/fixtures/types/other/tsconfig.json +20 -0
- package/test/fixtures/types/other/v1/index.d.ts +1 -0
- package/test/fixtures/types/other/v1/other-tests.ts +0 -0
- package/test/fixtures/types/other/v1/package.json +5 -0
- package/test/fixtures/types/other/v1/tsconfig.json +20 -0
- package/test/fixtures/types/scoped__foo/index.d.ts +1 -0
- package/test/fixtures/types/scoped__foo/package.json +5 -0
- package/test/fixtures/types/scoped__foo/scoped__foo-tests.ts +0 -0
- package/test/fixtures/types/scoped__foo/tsconfig.json +20 -0
- package/test/fixtures/types/scoped__foo/v1/index.d.ts +1 -0
- package/test/fixtures/types/scoped__foo/v1/package.json +5 -0
- package/test/fixtures/types/scoped__foo/v1/scoped__foo-tests.ts +0 -0
- package/test/fixtures/types/scoped__foo/v1/tsconfig.json +20 -0
- package/test/fixtures/types/scoped__no-declare-current-package/index.d.ts +1 -0
- package/test/fixtures/types/scoped__no-declare-current-package/no-declare-current-package-tests.ts +0 -0
- package/test/fixtures/types/scoped__no-declare-current-package/package.json +8 -0
- package/test/fixtures/types/scoped__no-declare-current-package/test/deep/import.d.ts +1 -0
- package/test/fixtures/types/scoped__no-declare-current-package/tsconfig.json +20 -0
- package/test/fixtures/types/scoped__no-relative-references/index.d.ts +12 -0
- package/test/fixtures/types/scoped__no-relative-references/no-relative-references-tests.ts +0 -0
- package/test/fixtures/types/scoped__no-relative-references/other/other.d.ts +7 -0
- package/test/fixtures/types/scoped__no-relative-references/package.json +5 -0
- package/test/fixtures/types/scoped__no-relative-references/tsconfig.json +20 -0
- package/test/fixtures/types/scoped__no-relative-references/v1/index.d.ts +15 -0
- package/test/fixtures/types/scoped__no-relative-references/v1/no-relative-references-tests.ts +0 -0
- package/test/fixtures/types/scoped__no-relative-references/v1/other/other.d.ts +7 -0
- package/test/fixtures/types/scoped__no-relative-references/v1/package.json +5 -0
- package/test/fixtures/types/scoped__no-relative-references/v1/tsconfig.json +20 -0
- package/test/no-bad-reference.test.ts +87 -94
- package/test/no-declare-current-package.test.ts +31 -31
- package/test/no-import-of-dev-dependencies.test.ts +14 -59
- package/test/no-self-import.test.ts +16 -100
- package/test/no-single-declare-module.test.ts +0 -1
- package/test/no-unnecessary-generics.test.ts +1 -1
- package/test/tsconfig.json +9 -6
- package/test/tsconfig.test.json +10 -0
- package/test/util.test.ts +29 -18
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="devdep"/>
|
|
2
|
+
/// <reference types="otherdevdep"/>
|
|
3
|
+
/// <reference types="other"/>
|
|
4
|
+
|
|
5
|
+
import other from "other";
|
|
6
|
+
import self from "no-import-of-dev-dependencies";
|
|
7
|
+
|
|
8
|
+
import devdep from "devdep";
|
|
9
|
+
import * as otherdevdep from "otherdevdep";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"module": "commonjs",
|
|
4
|
+
"lib": [
|
|
5
|
+
"es6",
|
|
6
|
+
"dom"
|
|
7
|
+
],
|
|
8
|
+
"noImplicitAny": true,
|
|
9
|
+
"noImplicitThis": true,
|
|
10
|
+
"strictFunctionTypes": true,
|
|
11
|
+
"strictNullChecks": true,
|
|
12
|
+
"types": [],
|
|
13
|
+
"noEmit": true,
|
|
14
|
+
"forceConsistentCasingInFileNames": true
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"index.d.ts",
|
|
18
|
+
"no-import-of-dev-dependencies-tests.ts"
|
|
19
|
+
]
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const foo = 1234;
|
|
File without changes
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"module": "commonjs",
|
|
4
|
+
"lib": [
|
|
5
|
+
"es6",
|
|
6
|
+
"dom"
|
|
7
|
+
],
|
|
8
|
+
"noImplicitAny": true,
|
|
9
|
+
"noImplicitThis": true,
|
|
10
|
+
"strictFunctionTypes": true,
|
|
11
|
+
"strictNullChecks": true,
|
|
12
|
+
"types": [],
|
|
13
|
+
"noEmit": true,
|
|
14
|
+
"forceConsistentCasingInFileNames": true
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"index.d.ts",
|
|
18
|
+
"foo-tests.ts"
|
|
19
|
+
]
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const foo = 1234;
|
|
File without changes
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"module": "commonjs",
|
|
4
|
+
"lib": [
|
|
5
|
+
"es6",
|
|
6
|
+
"dom"
|
|
7
|
+
],
|
|
8
|
+
"noImplicitAny": true,
|
|
9
|
+
"noImplicitThis": true,
|
|
10
|
+
"strictFunctionTypes": true,
|
|
11
|
+
"strictNullChecks": true,
|
|
12
|
+
"types": [],
|
|
13
|
+
"noEmit": true,
|
|
14
|
+
"forceConsistentCasingInFileNames": true
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"index.d.ts",
|
|
18
|
+
"foo-tests.ts"
|
|
19
|
+
]
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const foo = 1234;
|
|
File without changes
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"module": "commonjs",
|
|
4
|
+
"lib": [
|
|
5
|
+
"es6",
|
|
6
|
+
"dom"
|
|
7
|
+
],
|
|
8
|
+
"noImplicitAny": true,
|
|
9
|
+
"noImplicitThis": true,
|
|
10
|
+
"strictFunctionTypes": true,
|
|
11
|
+
"strictNullChecks": true,
|
|
12
|
+
"types": [],
|
|
13
|
+
"noEmit": true,
|
|
14
|
+
"forceConsistentCasingInFileNames": true
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"index.d.ts",
|
|
18
|
+
"foo-tests.ts"
|
|
19
|
+
]
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const foo = 1234;
|
|
File without changes
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"module": "commonjs",
|
|
4
|
+
"lib": [
|
|
5
|
+
"es6",
|
|
6
|
+
"dom"
|
|
7
|
+
],
|
|
8
|
+
"noImplicitAny": true,
|
|
9
|
+
"noImplicitThis": true,
|
|
10
|
+
"strictFunctionTypes": true,
|
|
11
|
+
"strictNullChecks": true,
|
|
12
|
+
"types": [],
|
|
13
|
+
"noEmit": true,
|
|
14
|
+
"forceConsistentCasingInFileNames": true
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"index.d.ts",
|
|
18
|
+
"foo-tests.ts"
|
|
19
|
+
]
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare module "@scoped/no-declare-current-package" { }
|
package/test/fixtures/types/scoped__no-declare-current-package/no-declare-current-package-tests.ts
ADDED
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare module "@scoped/no-declare-current-package/deep/import" { }
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"module": "commonjs",
|
|
4
|
+
"lib": [
|
|
5
|
+
"es6",
|
|
6
|
+
"dom"
|
|
7
|
+
],
|
|
8
|
+
"noImplicitAny": true,
|
|
9
|
+
"noImplicitThis": true,
|
|
10
|
+
"strictFunctionTypes": true,
|
|
11
|
+
"strictNullChecks": true,
|
|
12
|
+
"types": [],
|
|
13
|
+
"noEmit": true,
|
|
14
|
+
"forceConsistentCasingInFileNames": true
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"index.d.ts",
|
|
18
|
+
"no-import-of-dev-dependencies-tests.ts"
|
|
19
|
+
]
|
|
20
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference path="../foo/index.d.ts" />
|
|
2
|
+
/// <reference path="./v1/index.d.ts" />
|
|
3
|
+
/// <reference path="../foo/v1/index.d.ts" />
|
|
4
|
+
|
|
5
|
+
import * as foo from "../foo";
|
|
6
|
+
import * as foo2 from "./v1";
|
|
7
|
+
import * as foo3 from "../foo/v1";
|
|
8
|
+
|
|
9
|
+
declare module "@scoped/no-relative-references" {
|
|
10
|
+
import A = require("@scoped/no-relative-references/blah"); // Okay; relative
|
|
11
|
+
import B = require("@scoped/no-relative-references/v1"); // Bad; versioned subdir
|
|
12
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"module": "commonjs",
|
|
4
|
+
"lib": [
|
|
5
|
+
"es6",
|
|
6
|
+
"dom"
|
|
7
|
+
],
|
|
8
|
+
"noImplicitAny": true,
|
|
9
|
+
"noImplicitThis": true,
|
|
10
|
+
"strictFunctionTypes": true,
|
|
11
|
+
"strictNullChecks": true,
|
|
12
|
+
"types": [],
|
|
13
|
+
"noEmit": true,
|
|
14
|
+
"forceConsistentCasingInFileNames": true
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"index.d.ts",
|
|
18
|
+
"no-relative-references-tests.ts"
|
|
19
|
+
]
|
|
20
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference path="../../foo/index.d.ts" />
|
|
2
|
+
/// <reference path="../v1/index.d.ts" />
|
|
3
|
+
/// <reference path="../../foo/v1/index.d.ts" />
|
|
4
|
+
/// <reference path="../index.d.ts" />
|
|
5
|
+
|
|
6
|
+
import * as foo from "../../foo";
|
|
7
|
+
import * as foo2 from "../v1";
|
|
8
|
+
import * as foo3 from "../../foo/v1";
|
|
9
|
+
import * as va4 from "../index";
|
|
10
|
+
|
|
11
|
+
declare module "@scoped/no-relative-references" {
|
|
12
|
+
import A = require("@scoped/no-relative-references/blah"); // Okay; relative
|
|
13
|
+
import B = require("@scoped/no-relative-references/v1"); // Okay; no versioned dir here
|
|
14
|
+
import C = require("../index"); // Bad; parent dir
|
|
15
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference path="../../../foo/index.d.ts" />
|
|
2
|
+
/// <reference path="../../v1/index.d.ts" />
|
|
3
|
+
/// <reference path="../../../foo/v1/index.d.ts" />
|
|
4
|
+
|
|
5
|
+
import * as foo from "../../../foo";
|
|
6
|
+
import * as foo2 from "../../v1";
|
|
7
|
+
import * as foo3 from "../../../foo/v1";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"module": "commonjs",
|
|
4
|
+
"lib": [
|
|
5
|
+
"es6",
|
|
6
|
+
"dom"
|
|
7
|
+
],
|
|
8
|
+
"noImplicitAny": true,
|
|
9
|
+
"noImplicitThis": true,
|
|
10
|
+
"strictFunctionTypes": true,
|
|
11
|
+
"strictNullChecks": true,
|
|
12
|
+
"types": [],
|
|
13
|
+
"noEmit": true,
|
|
14
|
+
"forceConsistentCasingInFileNames": true
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"index.d.ts",
|
|
18
|
+
"no-relative-references-tests.ts"
|
|
19
|
+
]
|
|
20
|
+
}
|
|
@@ -1,134 +1,127 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { runTestsWithFixtures } from "./fixtureTester";
|
|
2
|
+
import * as rule from "../src/rules/no-bad-reference";
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
ruleTester.run("@definitelytyped/no-bad-reference", noBadReference, {
|
|
4
|
+
runTestsWithFixtures("@definitelytyped/no-bad-reference", rule, {
|
|
5
|
+
valid: [
|
|
6
|
+
{
|
|
7
|
+
filename: "types/foo/index.d.ts",
|
|
8
|
+
},
|
|
9
|
+
],
|
|
10
10
|
invalid: [
|
|
11
11
|
{
|
|
12
|
-
|
|
12
|
+
filename: "types/no-relative-references/index.d.ts",
|
|
13
13
|
errors: [
|
|
14
|
-
{
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
},
|
|
14
|
+
{ messageId: "referenceOutside", data: { text: "../foo/index.d.ts" } },
|
|
15
|
+
{ messageId: "referenceOutside", data: { text: "./v1/index.d.ts" } },
|
|
16
|
+
{ messageId: "referenceOutside", data: { text: "../foo/v1/index.d.ts" } },
|
|
17
|
+
{ messageId: "importOutside", data: { text: "../foo" } },
|
|
18
|
+
{ messageId: "importOutside", data: { text: "./v1" } },
|
|
19
|
+
{ messageId: "importOutside", data: { text: "../foo/v1" } },
|
|
20
|
+
{ messageId: "importOutside", data: { text: "no-relative-references/v1" } },
|
|
20
21
|
],
|
|
21
|
-
filename: "types.ts",
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
|
-
|
|
24
|
+
filename: "types/no-relative-references/other/other.d.ts",
|
|
25
25
|
errors: [
|
|
26
|
-
{
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
},
|
|
26
|
+
{ messageId: "referenceOutside", data: { text: "../../foo/index.d.ts" } },
|
|
27
|
+
{ messageId: "referenceOutside", data: { text: "../v1/index.d.ts" } },
|
|
28
|
+
{ messageId: "referenceOutside", data: { text: "../../foo/v1/index.d.ts" } },
|
|
29
|
+
{ messageId: "importOutside", data: { text: "../../foo" } },
|
|
30
|
+
{ messageId: "importOutside", data: { text: "../v1" } },
|
|
31
|
+
{ messageId: "importOutside", data: { text: "../../foo/v1" } },
|
|
32
32
|
],
|
|
33
|
-
filename: "types.ts",
|
|
34
33
|
},
|
|
35
34
|
{
|
|
36
|
-
|
|
35
|
+
filename: "types/no-relative-references/v1/index.d.ts",
|
|
37
36
|
errors: [
|
|
38
|
-
{
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
},
|
|
37
|
+
{ messageId: "referenceOutside", data: { text: "../../foo/index.d.ts" } },
|
|
38
|
+
{ messageId: "referenceLeaves", data: { text: "../v1/index.d.ts" } },
|
|
39
|
+
{ messageId: "referenceOutside", data: { text: "../../foo/v1/index.d.ts" } },
|
|
40
|
+
{ messageId: "referenceOutside", data: { text: "../index.d.ts" } },
|
|
41
|
+
{ messageId: "importOutside", data: { text: "../../foo" } },
|
|
42
|
+
{ messageId: "importLeaves", data: { text: "../v1" } },
|
|
43
|
+
{ messageId: "importOutside", data: { text: "../../foo/v1" } },
|
|
44
|
+
{ messageId: "importOutside", data: { text: "../index" } },
|
|
45
|
+
{ messageId: "importOutside", data: { text: "../index" } },
|
|
44
46
|
],
|
|
45
|
-
filename: "types.d.ts",
|
|
46
47
|
},
|
|
47
48
|
{
|
|
48
|
-
|
|
49
|
+
filename: "types/no-relative-references/v1/other/other.d.ts",
|
|
49
50
|
errors: [
|
|
50
|
-
{
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
},
|
|
51
|
+
{ messageId: "referenceOutside", data: { text: "../../../foo/index.d.ts" } },
|
|
52
|
+
{ messageId: "referenceLeaves", data: { text: "../../v1/index.d.ts" } },
|
|
53
|
+
{ messageId: "referenceOutside", data: { text: "../../../foo/v1/index.d.ts" } },
|
|
54
|
+
{ messageId: "importOutside", data: { text: "../../../foo" } },
|
|
55
|
+
{ messageId: "importLeaves", data: { text: "../../v1" } },
|
|
56
|
+
{ messageId: "importOutside", data: { text: "../../../foo/v1" } },
|
|
56
57
|
],
|
|
57
|
-
filename: "types.d.ts",
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
|
-
|
|
60
|
+
filename: "types/scoped__no-relative-references/index.d.ts",
|
|
61
61
|
errors: [
|
|
62
|
-
{
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
},
|
|
62
|
+
{ messageId: "referenceOutside", data: { text: "../foo/index.d.ts" } },
|
|
63
|
+
{ messageId: "referenceOutside", data: { text: "./v1/index.d.ts" } },
|
|
64
|
+
{ messageId: "referenceOutside", data: { text: "../foo/v1/index.d.ts" } },
|
|
65
|
+
{ messageId: "importOutside", data: { text: "../foo" } },
|
|
66
|
+
{ messageId: "importOutside", data: { text: "./v1" } },
|
|
67
|
+
{ messageId: "importOutside", data: { text: "../foo/v1" } },
|
|
68
|
+
{ messageId: "importOutside", data: { text: "@scoped/no-relative-references/v1" } },
|
|
68
69
|
],
|
|
69
|
-
filename: "types.d.ts",
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
|
-
|
|
72
|
+
filename: "types/scoped__no-relative-references/other/other.d.ts",
|
|
73
73
|
errors: [
|
|
74
|
-
{
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
},
|
|
74
|
+
{ messageId: "referenceOutside", data: { text: "../../foo/index.d.ts" } },
|
|
75
|
+
{ messageId: "referenceOutside", data: { text: "../v1/index.d.ts" } },
|
|
76
|
+
{ messageId: "referenceOutside", data: { text: "../../foo/v1/index.d.ts" } },
|
|
77
|
+
{ messageId: "importOutside", data: { text: "../../foo" } },
|
|
78
|
+
{ messageId: "importOutside", data: { text: "../v1" } },
|
|
79
|
+
{ messageId: "importOutside", data: { text: "../../foo/v1" } },
|
|
80
80
|
],
|
|
81
|
-
filename: "types.d.ts",
|
|
82
81
|
},
|
|
83
82
|
{
|
|
84
|
-
|
|
83
|
+
filename: "types/scoped__no-relative-references/v1/index.d.ts",
|
|
85
84
|
errors: [
|
|
86
|
-
{
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
},
|
|
85
|
+
{ messageId: "referenceOutside", data: { text: "../../foo/index.d.ts" } },
|
|
86
|
+
{ messageId: "referenceLeaves", data: { text: "../v1/index.d.ts" } },
|
|
87
|
+
{ messageId: "referenceOutside", data: { text: "../../foo/v1/index.d.ts" } },
|
|
88
|
+
{ messageId: "referenceOutside", data: { text: "../index.d.ts" } },
|
|
89
|
+
{ messageId: "importOutside", data: { text: "../../foo" } },
|
|
90
|
+
{ messageId: "importLeaves", data: { text: "../v1" } },
|
|
91
|
+
{ messageId: "importOutside", data: { text: "../../foo/v1" } },
|
|
92
|
+
{ messageId: "importOutside", data: { text: "../index" } },
|
|
93
|
+
{ messageId: "importOutside", data: { text: "../index" } },
|
|
92
94
|
],
|
|
93
|
-
filename: "types.d.ts",
|
|
94
95
|
},
|
|
95
96
|
{
|
|
96
|
-
|
|
97
|
+
filename: "types/scoped__no-relative-references/v1/other/other.d.ts",
|
|
97
98
|
errors: [
|
|
98
|
-
{
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
},
|
|
99
|
+
{ messageId: "referenceOutside", data: { text: "../../../foo/index.d.ts" } },
|
|
100
|
+
{ messageId: "referenceLeaves", data: { text: "../../v1/index.d.ts" } },
|
|
101
|
+
{ messageId: "referenceOutside", data: { text: "../../../foo/v1/index.d.ts" } },
|
|
102
|
+
{ messageId: "importOutside", data: { text: "../../../foo" } },
|
|
103
|
+
{ messageId: "importLeaves", data: { text: "../../v1" } },
|
|
104
|
+
{ messageId: "importOutside", data: { text: "../../../foo/v1" } },
|
|
104
105
|
],
|
|
105
|
-
filename: "types.d.ts",
|
|
106
106
|
},
|
|
107
|
-
],
|
|
108
|
-
valid: [
|
|
109
|
-
``,
|
|
110
|
-
`// unrelated comment`,
|
|
111
|
-
`/// similar (reference path) comment`,
|
|
112
107
|
{
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
code: `/// <reference path="./v1verb/other" />`,
|
|
126
|
-
filename: "types.d.ts",
|
|
108
|
+
filename: "types/no-bad-reference/index.d.ts",
|
|
109
|
+
errors: [
|
|
110
|
+
{ messageId: "referenceOutside", data: { text: "../other" } },
|
|
111
|
+
{ messageId: "referenceOutside", data: { text: "./v11" } },
|
|
112
|
+
{ messageId: "referenceOutside", data: { text: "./v11/index" } },
|
|
113
|
+
{ messageId: "referenceOutside", data: { text: "./v11/subdir/file" } },
|
|
114
|
+
{ messageId: "referenceOutside", data: { text: "./v0.1" } },
|
|
115
|
+
{ messageId: "referenceOutside", data: { text: "./v0.1/index" } },
|
|
116
|
+
{ messageId: "backslashes", line: 13 },
|
|
117
|
+
],
|
|
127
118
|
},
|
|
128
119
|
{
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
120
|
+
filename: "types/no-bad-reference/no-bad-reference-tests.ts",
|
|
121
|
+
errors: [
|
|
122
|
+
{ messageId: "testReference", data: { text: "../other" } },
|
|
123
|
+
{ messageId: "testReference", data: { text: "other" } },
|
|
124
|
+
],
|
|
132
125
|
},
|
|
133
126
|
],
|
|
134
127
|
});
|