@definitelytyped/eslint-plugin 0.0.203 → 0.0.204
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 +8 -0
- package/package.json +2 -2
- package/src/configs/all.ts +0 -189
- package/src/index.ts +0 -18
- package/src/rules/expect.ts +0 -556
- package/src/rules/export-just-namespace.ts +0 -82
- package/src/rules/index.ts +0 -43
- package/src/rules/no-any-union.ts +0 -33
- package/src/rules/no-bad-reference.ts +0 -199
- package/src/rules/no-const-enum.ts +0 -31
- package/src/rules/no-dead-reference.ts +0 -47
- package/src/rules/no-declare-current-package.ts +0 -45
- package/src/rules/no-import-default-of-export-equals.ts +0 -68
- package/src/rules/no-import-of-dev-dependencies.ts +0 -93
- package/src/rules/no-old-dt-header.ts +0 -40
- package/src/rules/no-relative-import-in-test.ts +0 -72
- package/src/rules/no-self-import.ts +0 -56
- package/src/rules/no-single-declare-module.ts +0 -57
- package/src/rules/no-single-element-tuple-type.ts +0 -30
- package/src/rules/no-unnecessary-generics.ts +0 -119
- package/src/rules/no-useless-files.ts +0 -51
- package/src/rules/npm-naming/types.ts +0 -14
- package/src/rules/npm-naming.ts +0 -211
- package/src/rules/prefer-declare-function.ts +0 -37
- package/src/rules/redundant-undefined.ts +0 -61
- package/src/rules/strict-export-declare-modifiers.ts +0 -195
- package/src/suggestions.ts +0 -75
- package/src/util.ts +0 -138
- package/test/__file_snapshots__/types/expect/expect-tests.ts.lint +0 -79
- package/test/__file_snapshots__/types/expect/index.d.ts.lint +0 -19
- package/test/__file_snapshots__/types/export-just-namespace/bad1.d.ts.lint +0 -11
- package/test/__file_snapshots__/types/export-just-namespace/bad2.d.ts.lint +0 -11
- package/test/__file_snapshots__/types/export-just-namespace/bad3.d.ts.lint +0 -12
- package/test/__file_snapshots__/types/export-just-namespace/export-just-namespace-tests.ts.lint +0 -10
- package/test/__file_snapshots__/types/export-just-namespace/good1.d.ts.lint +0 -5
- package/test/__file_snapshots__/types/export-just-namespace/good2.d.ts.lint +0 -5
- package/test/__file_snapshots__/types/export-just-namespace/good3.d.ts.lint +0 -5
- package/test/__file_snapshots__/types/export-just-namespace/good4.d.ts.lint +0 -5
- package/test/__file_snapshots__/types/export-just-namespace/good5.d.ts.lint +0 -5
- package/test/__file_snapshots__/types/export-just-namespace/good6.d.ts.lint +0 -5
- package/test/__file_snapshots__/types/export-just-namespace/good7.d.ts.lint +0 -7
- package/test/__file_snapshots__/types/export-just-namespace/good8.d.ts.lint +0 -7
- package/test/__file_snapshots__/types/export-just-namespace/good9.d.ts.lint +0 -15
- package/test/__file_snapshots__/types/foo/foo-tests.ts.lint +0 -10
- package/test/__file_snapshots__/types/foo/index.d.ts.lint +0 -5
- package/test/__file_snapshots__/types/foo/v1/foo-tests.ts.lint +0 -10
- package/test/__file_snapshots__/types/foo/v1/index.d.ts.lint +0 -5
- package/test/__file_snapshots__/types/no-any-union/bad.d.ts.lint +0 -10
- package/test/__file_snapshots__/types/no-any-union/index.d.ts.lint +0 -5
- package/test/__file_snapshots__/types/no-any-union/no-any-union-tests.ts.lint +0 -10
- package/test/__file_snapshots__/types/no-bad-reference/index.d.ts.lint +0 -43
- package/test/__file_snapshots__/types/no-bad-reference/no-bad-reference-tests.ts.lint +0 -14
- package/test/__file_snapshots__/types/no-bad-reference/v0.1/index.d.ts.lint +0 -48
- package/test/__file_snapshots__/types/no-bad-reference/v0.1/no-bad-reference-tests.ts.lint +0 -10
- package/test/__file_snapshots__/types/no-bad-reference/v11/index.d.ts.lint +0 -48
- package/test/__file_snapshots__/types/no-bad-reference/v11/no-bad-reference-tests.ts.lint +0 -10
- package/test/__file_snapshots__/types/no-const-enum/bad.d.ts.lint +0 -10
- package/test/__file_snapshots__/types/no-const-enum/index.d.ts.lint +0 -5
- package/test/__file_snapshots__/types/no-const-enum/no-const-enum-tests.ts.lint +0 -10
- package/test/__file_snapshots__/types/no-dead-reference/bad.d.ts.lint +0 -18
- package/test/__file_snapshots__/types/no-dead-reference/bad2.d.ts.lint +0 -15
- package/test/__file_snapshots__/types/no-dead-reference/bad3.d.ts.lint +0 -17
- package/test/__file_snapshots__/types/no-dead-reference/index.d.ts.lint +0 -6
- package/test/__file_snapshots__/types/no-dead-reference/no-dead-reference-tests.ts.lint +0 -10
- package/test/__file_snapshots__/types/no-declare-current-package/index.d.ts.lint +0 -13
- package/test/__file_snapshots__/types/no-declare-current-package/no-declare-current-package-tests.ts.lint +0 -10
- package/test/__file_snapshots__/types/no-declare-current-package/test/deep/import.d.ts.lint +0 -13
- package/test/__file_snapshots__/types/no-declare-current-package-other/index.d.ts.lint +0 -6
- package/test/__file_snapshots__/types/no-declare-current-package-other/no-declare-current-package-other-tests.ts.lint +0 -10
- package/test/__file_snapshots__/types/no-import-default-of-export-equals/bad.d.ts.lint +0 -17
- package/test/__file_snapshots__/types/no-import-default-of-export-equals/index.d.ts.lint +0 -12
- package/test/__file_snapshots__/types/no-import-default-of-export-equals/no-import-default-of-export-equals-tests.ts.lint +0 -10
- package/test/__file_snapshots__/types/no-import-of-dev-dependencies/bad.d.ts.lint +0 -44
- package/test/__file_snapshots__/types/no-import-of-dev-dependencies/index.d.ts.lint +0 -25
- package/test/__file_snapshots__/types/no-import-of-dev-dependencies/no-import-of-dev-dependencies-tests.ts.lint +0 -39
- package/test/__file_snapshots__/types/no-old-dt-header/index.d.ts.lint +0 -23
- package/test/__file_snapshots__/types/no-old-dt-header/index2.d.ts.lint +0 -14
- package/test/__file_snapshots__/types/no-old-dt-header/no-old-dt-header-tests.ts.lint +0 -10
- package/test/__file_snapshots__/types/no-old-dt-header/ok1.ts.lint +0 -11
- package/test/__file_snapshots__/types/no-old-dt-header/ok2.d.ts.lint +0 -10
- package/test/__file_snapshots__/types/no-old-dt-header/ok3.d.ts.lint +0 -10
- package/test/__file_snapshots__/types/no-old-dt-header/ok4.d.ts.lint +0 -12
- package/test/__file_snapshots__/types/no-relative-import-in-test/abc.d.ts.lint +0 -6
- package/test/__file_snapshots__/types/no-relative-import-in-test/bad.d.ts.lint +0 -10
- package/test/__file_snapshots__/types/no-relative-import-in-test/index.d.ts.lint +0 -5
- package/test/__file_snapshots__/types/no-relative-import-in-test/no-relative-import-in-test/abc.d.ts.lint +0 -6
- package/test/__file_snapshots__/types/no-relative-import-in-test/no-relative-import-in-test-tests.ts.lint +0 -10
- package/test/__file_snapshots__/types/no-relative-import-in-test/no-relative-import-in-test-tests2.ts.lint +0 -7
- package/test/__file_snapshots__/types/no-relative-import-in-test/no-relative-import-in-test-tests3.ts.lint +0 -10
- package/test/__file_snapshots__/types/no-relative-references/index.d.ts.lint +0 -51
- package/test/__file_snapshots__/types/no-relative-references/no-relative-references-tests.ts.lint +0 -10
- package/test/__file_snapshots__/types/no-relative-references/other/other.d.ts.lint +0 -31
- package/test/__file_snapshots__/types/no-relative-references/v1/index.d.ts.lint +0 -57
- package/test/__file_snapshots__/types/no-relative-references/v1/no-relative-references-tests.ts.lint +0 -10
- package/test/__file_snapshots__/types/no-relative-references/v1/other/other.d.ts.lint +0 -31
- package/test/__file_snapshots__/types/no-self-import/bad.d.ts.lint +0 -65
- package/test/__file_snapshots__/types/no-self-import/index.d.ts.lint +0 -19
- package/test/__file_snapshots__/types/no-self-import/no-self-import-tests.ts.lint +0 -39
- package/test/__file_snapshots__/types/no-single-declare-module/bad.d.ts.lint +0 -13
- package/test/__file_snapshots__/types/no-single-declare-module/index.d.ts.lint +0 -6
- package/test/__file_snapshots__/types/no-single-declare-module/index2.d.ts.lint +0 -6
- package/test/__file_snapshots__/types/no-single-declare-module/index3.d.ts.lint +0 -5
- package/test/__file_snapshots__/types/no-single-declare-module/no-single-declare-module-tests.ts.lint +0 -10
- package/test/__file_snapshots__/types/no-single-element-tuple-type/bad.d.ts.lint +0 -10
- package/test/__file_snapshots__/types/no-single-element-tuple-type/index.d.ts.lint +0 -9
- package/test/__file_snapshots__/types/no-single-element-tuple-type/no-single-element-tuple-type-tests.ts.lint +0 -10
- package/test/__file_snapshots__/types/no-unnecessary-generics/bad.d.ts.lint +0 -14
- package/test/__file_snapshots__/types/no-unnecessary-generics/index.d.ts.lint +0 -11
- package/test/__file_snapshots__/types/no-unnecessary-generics/no-unnecessary-generics-tests.ts.lint +0 -44
- package/test/__file_snapshots__/types/no-useless-files/bad.d.ts.lint +0 -10
- package/test/__file_snapshots__/types/no-useless-files/bad2.d.ts.lint +0 -10
- package/test/__file_snapshots__/types/no-useless-files/bad3.d.ts.lint +0 -10
- package/test/__file_snapshots__/types/no-useless-files/index.d.ts.lint +0 -5
- package/test/__file_snapshots__/types/no-useless-files/index2.d.ts.lint +0 -5
- package/test/__file_snapshots__/types/no-useless-files/index3.d.ts.lint +0 -5
- package/test/__file_snapshots__/types/no-useless-files/no-useless-files-tests.ts.lint +0 -10
- package/test/__file_snapshots__/types/other/index.d.ts.lint +0 -5
- package/test/__file_snapshots__/types/other/other-tests.ts.lint +0 -10
- package/test/__file_snapshots__/types/other/v1/index.d.ts.lint +0 -5
- package/test/__file_snapshots__/types/other/v1/other-tests.ts.lint +0 -10
- package/test/__file_snapshots__/types/prefer-declare-function/bad.d.ts.lint +0 -33
- package/test/__file_snapshots__/types/prefer-declare-function/index.d.ts.lint +0 -14
- package/test/__file_snapshots__/types/prefer-declare-function/prefer-declare-function-tests.ts.lint +0 -10
- package/test/__file_snapshots__/types/redundant-undefined/bad.d.ts.lint +0 -15
- package/test/__file_snapshots__/types/redundant-undefined/index.d.ts.lint +0 -9
- package/test/__file_snapshots__/types/redundant-undefined/redundant-undefined-tests.ts.lint +0 -10
- package/test/__file_snapshots__/types/scoped__foo/index.d.ts.lint +0 -5
- package/test/__file_snapshots__/types/scoped__foo/scoped__foo-tests.ts.lint +0 -10
- package/test/__file_snapshots__/types/scoped__foo/v1/index.d.ts.lint +0 -5
- package/test/__file_snapshots__/types/scoped__foo/v1/scoped__foo-tests.ts.lint +0 -10
- package/test/__file_snapshots__/types/scoped__no-declare-current-package/index.d.ts.lint +0 -13
- package/test/__file_snapshots__/types/scoped__no-declare-current-package/no-declare-current-package-tests.ts.lint +0 -10
- package/test/__file_snapshots__/types/scoped__no-declare-current-package/test/deep/import.d.ts.lint +0 -13
- package/test/__file_snapshots__/types/scoped__no-relative-references/index.d.ts.lint +0 -51
- package/test/__file_snapshots__/types/scoped__no-relative-references/no-relative-references-tests.ts.lint +0 -10
- package/test/__file_snapshots__/types/scoped__no-relative-references/other/other.d.ts.lint +0 -31
- package/test/__file_snapshots__/types/scoped__no-relative-references/v1/index.d.ts.lint +0 -57
- package/test/__file_snapshots__/types/scoped__no-relative-references/v1/no-relative-references-tests.ts.lint +0 -10
- package/test/__file_snapshots__/types/scoped__no-relative-references/v1/other/other.d.ts.lint +0 -31
- package/test/__file_snapshots__/types/strict-export-declare-modifiers/bad1.d.ts.lint +0 -10
- package/test/__file_snapshots__/types/strict-export-declare-modifiers/bad2.d.ts.lint +0 -12
- package/test/__file_snapshots__/types/strict-export-declare-modifiers/bad3.d.ts.lint +0 -10
- package/test/__file_snapshots__/types/strict-export-declare-modifiers/bad4.d.ts.lint +0 -12
- package/test/__file_snapshots__/types/strict-export-declare-modifiers/bad5.d.ts.lint +0 -11
- package/test/__file_snapshots__/types/strict-export-declare-modifiers/bad6.d.ts.lint +0 -14
- package/test/__file_snapshots__/types/strict-export-declare-modifiers/bad7.d.ts.lint +0 -14
- package/test/__file_snapshots__/types/strict-export-declare-modifiers/good1.ts.lint +0 -5
- package/test/__file_snapshots__/types/strict-export-declare-modifiers/good2.d.ts.lint +0 -5
- package/test/__file_snapshots__/types/strict-export-declare-modifiers/good3.d.ts.lint +0 -5
- package/test/__file_snapshots__/types/strict-export-declare-modifiers/good4.d.ts.lint +0 -5
- package/test/__file_snapshots__/types/strict-export-declare-modifiers/good5.d.ts.lint +0 -5
- package/test/__file_snapshots__/types/strict-export-declare-modifiers/good6.ts.lint +0 -7
- package/test/__file_snapshots__/types/strict-export-declare-modifiers/good7.d.ts.lint +0 -6
- package/test/__file_snapshots__/types/strict-export-declare-modifiers/good8.d.ts.lint +0 -9
- package/test/__file_snapshots__/types/strict-export-declare-modifiers/good9.d.ts.lint +0 -7
- package/test/__file_snapshots__/types/strict-export-declare-modifiers/strict-export-declare-modifiers-tests.ts.lint +0 -10
- package/test/__snapshots__/plugin.test.ts.snap +0 -262
- package/test/eslint.test.ts +0 -134
- package/test/fixtures/.eslintrc.cjs +0 -4
- package/test/fixtures/notNeededPackages.json +0 -3
- package/test/fixtures/package.json +0 -4
- package/test/fixtures/types/expect/expect-tests.ts +0 -49
- package/test/fixtures/types/expect/index.d.ts +0 -9
- package/test/fixtures/types/expect/package.json +0 -5
- package/test/fixtures/types/expect/tsconfig.json +0 -20
- package/test/fixtures/types/export-just-namespace/bad1.d.ts +0 -2
- package/test/fixtures/types/export-just-namespace/bad2.d.ts +0 -2
- package/test/fixtures/types/export-just-namespace/bad3.d.ts +0 -3
- package/test/fixtures/types/export-just-namespace/export-just-namespace-tests.ts +0 -0
- package/test/fixtures/types/export-just-namespace/good1.d.ts +0 -1
- package/test/fixtures/types/export-just-namespace/good2.d.ts +0 -1
- package/test/fixtures/types/export-just-namespace/good3.d.ts +0 -1
- package/test/fixtures/types/export-just-namespace/good4.d.ts +0 -1
- package/test/fixtures/types/export-just-namespace/good5.d.ts +0 -1
- package/test/fixtures/types/export-just-namespace/good6.d.ts +0 -1
- package/test/fixtures/types/export-just-namespace/good7.d.ts +0 -3
- package/test/fixtures/types/export-just-namespace/good8.d.ts +0 -3
- package/test/fixtures/types/export-just-namespace/good9.d.ts +0 -3
- package/test/fixtures/types/export-just-namespace/package.json +0 -8
- package/test/fixtures/types/export-just-namespace/tsconfig.json +0 -31
- package/test/fixtures/types/foo/foo-tests.ts +0 -0
- package/test/fixtures/types/foo/index.d.ts +0 -1
- package/test/fixtures/types/foo/package.json +0 -5
- package/test/fixtures/types/foo/tsconfig.json +0 -20
- package/test/fixtures/types/foo/v1/foo-tests.ts +0 -0
- package/test/fixtures/types/foo/v1/index.d.ts +0 -1
- package/test/fixtures/types/foo/v1/package.json +0 -5
- package/test/fixtures/types/foo/v1/tsconfig.json +0 -20
- package/test/fixtures/types/no-any-union/bad.d.ts +0 -1
- package/test/fixtures/types/no-any-union/index.d.ts +0 -1
- package/test/fixtures/types/no-any-union/no-any-union-tests.ts +0 -1
- package/test/fixtures/types/no-any-union/package.json +0 -8
- package/test/fixtures/types/no-any-union/tsconfig.json +0 -21
- package/test/fixtures/types/no-bad-reference/index.d.ts +0 -16
- package/test/fixtures/types/no-bad-reference/no-bad-reference-tests.ts +0 -2
- package/test/fixtures/types/no-bad-reference/package.json +0 -5
- package/test/fixtures/types/no-bad-reference/tsconfig.json +0 -20
- package/test/fixtures/types/no-bad-reference/v0.1/index.d.ts +0 -15
- 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 +0 -5
- package/test/fixtures/types/no-bad-reference/v0.1/tsconfig.json +0 -20
- package/test/fixtures/types/no-bad-reference/v11/index.d.ts +0 -15
- 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 +0 -5
- package/test/fixtures/types/no-bad-reference/v11/tsconfig.json +0 -20
- package/test/fixtures/types/no-const-enum/bad.d.ts +0 -1
- package/test/fixtures/types/no-const-enum/index.d.ts +0 -1
- package/test/fixtures/types/no-const-enum/no-const-enum-tests.ts +0 -0
- package/test/fixtures/types/no-const-enum/package.json +0 -8
- package/test/fixtures/types/no-const-enum/tsconfig.json +0 -21
- package/test/fixtures/types/no-dead-reference/bad.d.ts +0 -6
- package/test/fixtures/types/no-dead-reference/bad2.d.ts +0 -3
- package/test/fixtures/types/no-dead-reference/bad3.d.ts +0 -5
- package/test/fixtures/types/no-dead-reference/index.d.ts +0 -2
- package/test/fixtures/types/no-dead-reference/no-dead-reference-tests.ts +0 -0
- package/test/fixtures/types/no-dead-reference/package.json +0 -8
- package/test/fixtures/types/no-dead-reference/tsconfig.json +0 -23
- package/test/fixtures/types/no-declare-current-package/index.d.ts +0 -1
- 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 +0 -8
- package/test/fixtures/types/no-declare-current-package/test/deep/import.d.ts +0 -1
- package/test/fixtures/types/no-declare-current-package/tsconfig.json +0 -21
- package/test/fixtures/types/no-declare-current-package-other/index.d.ts +0 -2
- 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 +0 -8
- package/test/fixtures/types/no-declare-current-package-other/tsconfig.json +0 -20
- package/test/fixtures/types/no-import-default-of-export-equals/bad.d.ts +0 -8
- package/test/fixtures/types/no-import-default-of-export-equals/index.d.ts +0 -8
- package/test/fixtures/types/no-import-default-of-export-equals/no-import-default-of-export-equals-tests.ts +0 -0
- package/test/fixtures/types/no-import-default-of-export-equals/package.json +0 -8
- package/test/fixtures/types/no-import-default-of-export-equals/tsconfig.json +0 -21
- package/test/fixtures/types/no-import-of-dev-dependencies/bad.d.ts +0 -8
- package/test/fixtures/types/no-import-of-dev-dependencies/index.d.ts +0 -7
- package/test/fixtures/types/no-import-of-dev-dependencies/no-import-of-dev-dependencies-tests.ts +0 -15
- package/test/fixtures/types/no-import-of-dev-dependencies/package.json +0 -14
- package/test/fixtures/types/no-import-of-dev-dependencies/tsconfig.json +0 -21
- package/test/fixtures/types/no-old-dt-header/index.d.ts +0 -14
- package/test/fixtures/types/no-old-dt-header/index2.d.ts +0 -2
- package/test/fixtures/types/no-old-dt-header/no-old-dt-header-tests.ts +0 -0
- package/test/fixtures/types/no-old-dt-header/ok1.ts +0 -2
- package/test/fixtures/types/no-old-dt-header/ok2.d.ts +0 -1
- package/test/fixtures/types/no-old-dt-header/ok3.d.ts +0 -1
- package/test/fixtures/types/no-old-dt-header/ok4.d.ts +0 -3
- package/test/fixtures/types/no-old-dt-header/package.json +0 -8
- package/test/fixtures/types/no-old-dt-header/tsconfig.json +0 -25
- package/test/fixtures/types/no-relative-import-in-test/abc.d.ts +0 -2
- package/test/fixtures/types/no-relative-import-in-test/bad.d.ts +0 -0
- package/test/fixtures/types/no-relative-import-in-test/index.d.ts +0 -1
- package/test/fixtures/types/no-relative-import-in-test/no-relative-import-in-test/abc.d.ts +0 -2
- package/test/fixtures/types/no-relative-import-in-test/no-relative-import-in-test-tests.ts +0 -1
- package/test/fixtures/types/no-relative-import-in-test/no-relative-import-in-test-tests2.ts +0 -3
- package/test/fixtures/types/no-relative-import-in-test/no-relative-import-in-test-tests3.ts +0 -1
- package/test/fixtures/types/no-relative-import-in-test/package.json +0 -8
- package/test/fixtures/types/no-relative-import-in-test/tsconfig.json +0 -25
- package/test/fixtures/types/no-relative-references/index.d.ts +0 -12
- 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 +0 -7
- package/test/fixtures/types/no-relative-references/package.json +0 -5
- package/test/fixtures/types/no-relative-references/tsconfig.json +0 -21
- package/test/fixtures/types/no-relative-references/v1/index.d.ts +0 -15
- 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 +0 -7
- package/test/fixtures/types/no-relative-references/v1/package.json +0 -5
- package/test/fixtures/types/no-relative-references/v1/tsconfig.json +0 -21
- package/test/fixtures/types/no-self-import/bad.d.ts +0 -17
- package/test/fixtures/types/no-self-import/index.d.ts +0 -15
- package/test/fixtures/types/no-self-import/no-self-import-tests.ts +0 -15
- package/test/fixtures/types/no-self-import/package.json +0 -11
- package/test/fixtures/types/no-self-import/tsconfig.json +0 -21
- package/test/fixtures/types/no-single-declare-module/bad.d.ts +0 -4
- package/test/fixtures/types/no-single-declare-module/index.d.ts +0 -2
- package/test/fixtures/types/no-single-declare-module/index2.d.ts +0 -2
- package/test/fixtures/types/no-single-declare-module/index3.d.ts +0 -1
- package/test/fixtures/types/no-single-declare-module/no-single-declare-module-tests.ts +0 -0
- package/test/fixtures/types/no-single-declare-module/package.json +0 -8
- package/test/fixtures/types/no-single-declare-module/tsconfig.json +0 -23
- package/test/fixtures/types/no-single-element-tuple-type/bad.d.ts +0 -1
- package/test/fixtures/types/no-single-element-tuple-type/index.d.ts +0 -5
- package/test/fixtures/types/no-single-element-tuple-type/no-single-element-tuple-type-tests.ts +0 -0
- package/test/fixtures/types/no-single-element-tuple-type/package.json +0 -8
- package/test/fixtures/types/no-single-element-tuple-type/tsconfig.json +0 -21
- package/test/fixtures/types/no-unnecessary-generics/bad.d.ts +0 -2
- package/test/fixtures/types/no-unnecessary-generics/index.d.ts +0 -7
- package/test/fixtures/types/no-unnecessary-generics/no-unnecessary-generics-tests.ts +0 -14
- package/test/fixtures/types/no-unnecessary-generics/package.json +0 -8
- package/test/fixtures/types/no-unnecessary-generics/tsconfig.json +0 -21
- package/test/fixtures/types/no-useless-files/bad.d.ts +0 -1
- package/test/fixtures/types/no-useless-files/bad2.d.ts +0 -0
- package/test/fixtures/types/no-useless-files/bad3.d.ts +0 -1
- package/test/fixtures/types/no-useless-files/index.d.ts +0 -1
- package/test/fixtures/types/no-useless-files/index2.d.ts +0 -1
- package/test/fixtures/types/no-useless-files/index3.d.ts +0 -1
- package/test/fixtures/types/no-useless-files/no-useless-files-tests.ts +0 -0
- package/test/fixtures/types/no-useless-files/package.json +0 -8
- package/test/fixtures/types/no-useless-files/tsconfig.json +0 -25
- package/test/fixtures/types/other/index.d.ts +0 -1
- package/test/fixtures/types/other/other-tests.ts +0 -0
- package/test/fixtures/types/other/package.json +0 -5
- package/test/fixtures/types/other/tsconfig.json +0 -20
- package/test/fixtures/types/other/v1/index.d.ts +0 -1
- package/test/fixtures/types/other/v1/other-tests.ts +0 -0
- package/test/fixtures/types/other/v1/package.json +0 -5
- package/test/fixtures/types/other/v1/tsconfig.json +0 -20
- package/test/fixtures/types/prefer-declare-function/bad.d.ts +0 -9
- package/test/fixtures/types/prefer-declare-function/index.d.ts +0 -2
- package/test/fixtures/types/prefer-declare-function/package.json +0 -8
- package/test/fixtures/types/prefer-declare-function/prefer-declare-function-tests.ts +0 -0
- package/test/fixtures/types/prefer-declare-function/tsconfig.json +0 -21
- package/test/fixtures/types/redundant-undefined/bad.d.ts +0 -3
- package/test/fixtures/types/redundant-undefined/index.d.ts +0 -5
- package/test/fixtures/types/redundant-undefined/package.json +0 -8
- package/test/fixtures/types/redundant-undefined/redundant-undefined-tests.ts +0 -1
- package/test/fixtures/types/redundant-undefined/tsconfig.json +0 -21
- package/test/fixtures/types/scoped__foo/index.d.ts +0 -1
- package/test/fixtures/types/scoped__foo/package.json +0 -5
- package/test/fixtures/types/scoped__foo/scoped__foo-tests.ts +0 -0
- package/test/fixtures/types/scoped__foo/tsconfig.json +0 -20
- package/test/fixtures/types/scoped__foo/v1/index.d.ts +0 -1
- package/test/fixtures/types/scoped__foo/v1/package.json +0 -5
- package/test/fixtures/types/scoped__foo/v1/scoped__foo-tests.ts +0 -0
- package/test/fixtures/types/scoped__foo/v1/tsconfig.json +0 -20
- package/test/fixtures/types/scoped__no-declare-current-package/index.d.ts +0 -1
- 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 +0 -8
- package/test/fixtures/types/scoped__no-declare-current-package/test/deep/import.d.ts +0 -1
- package/test/fixtures/types/scoped__no-declare-current-package/tsconfig.json +0 -21
- package/test/fixtures/types/scoped__no-relative-references/index.d.ts +0 -12
- 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 +0 -7
- package/test/fixtures/types/scoped__no-relative-references/package.json +0 -5
- package/test/fixtures/types/scoped__no-relative-references/tsconfig.json +0 -21
- package/test/fixtures/types/scoped__no-relative-references/v1/index.d.ts +0 -15
- 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 +0 -7
- package/test/fixtures/types/scoped__no-relative-references/v1/package.json +0 -5
- package/test/fixtures/types/scoped__no-relative-references/v1/tsconfig.json +0 -21
- package/test/fixtures/types/strict-export-declare-modifiers/bad1.d.ts +0 -1
- package/test/fixtures/types/strict-export-declare-modifiers/bad2.d.ts +0 -3
- package/test/fixtures/types/strict-export-declare-modifiers/bad3.d.ts +0 -1
- package/test/fixtures/types/strict-export-declare-modifiers/bad4.d.ts +0 -3
- package/test/fixtures/types/strict-export-declare-modifiers/bad5.d.ts +0 -2
- package/test/fixtures/types/strict-export-declare-modifiers/bad6.d.ts +0 -2
- package/test/fixtures/types/strict-export-declare-modifiers/bad7.d.ts +0 -2
- package/test/fixtures/types/strict-export-declare-modifiers/good1.ts +0 -1
- package/test/fixtures/types/strict-export-declare-modifiers/good2.d.ts +0 -1
- package/test/fixtures/types/strict-export-declare-modifiers/good3.d.ts +0 -1
- package/test/fixtures/types/strict-export-declare-modifiers/good4.d.ts +0 -1
- package/test/fixtures/types/strict-export-declare-modifiers/good5.d.ts +0 -1
- package/test/fixtures/types/strict-export-declare-modifiers/good6.ts +0 -3
- package/test/fixtures/types/strict-export-declare-modifiers/good7.d.ts +0 -2
- package/test/fixtures/types/strict-export-declare-modifiers/good8.d.ts +0 -5
- package/test/fixtures/types/strict-export-declare-modifiers/good9.d.ts +0 -3
- package/test/fixtures/types/strict-export-declare-modifiers/package.json +0 -8
- package/test/fixtures/types/strict-export-declare-modifiers/strict-export-declare-modifiers-tests.ts +0 -0
- package/test/fixtures/types/strict-export-declare-modifiers/tsconfig.json +0 -35
- package/test/npm-naming.test.ts +0 -57
- package/test/plugin.test.ts +0 -14
- package/test/tsconfig.json +0 -13
- package/test/types/dts-critic/index.d.ts +0 -9
- package/test/types/dts-critic/package.json +0 -17
- package/test/types/wenceslas/index.d.ts +0 -0
- package/test/types/wenceslas/package.json +0 -17
- package/test/util.test.ts +0 -40
- package/test/util.ts +0 -3
- package/tsconfig.json +0 -11
- package/tsconfig.tsbuildinfo +0 -1
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
types/strict-export-declare-modifiers/strict-export-declare-modifiers-tests.ts
|
|
2
|
-
1:1 error File has no content @definitelytyped/no-useless-files
|
|
3
|
-
|
|
4
|
-
✖ 1 problem (1 error, 0 warnings)
|
|
5
|
-
|
|
6
|
-
==== types/strict-export-declare-modifiers/strict-export-declare-modifiers-tests.ts ====
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
~
|
|
10
|
-
!!! @definitelytyped/no-useless-files: File has no content.
|
|
@@ -1,262 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`plugin should have the expected exports 1`] = `
|
|
4
|
-
{
|
|
5
|
-
"configs": {
|
|
6
|
-
"all": {
|
|
7
|
-
"overrides": [
|
|
8
|
-
{
|
|
9
|
-
"files": [
|
|
10
|
-
"*.cts",
|
|
11
|
-
"*.mts",
|
|
12
|
-
"*.ts",
|
|
13
|
-
"*.tsx",
|
|
14
|
-
],
|
|
15
|
-
"parser": "@typescript-eslint/parser",
|
|
16
|
-
"parserOptions": {
|
|
17
|
-
"project": true,
|
|
18
|
-
"warnOnUnsupportedTypeScriptVersion": false,
|
|
19
|
-
},
|
|
20
|
-
"rules": {
|
|
21
|
-
"@definitelytyped/expect": "error",
|
|
22
|
-
"@definitelytyped/export-just-namespace": "error",
|
|
23
|
-
"@definitelytyped/no-any-union": "error",
|
|
24
|
-
"@definitelytyped/no-bad-reference": "error",
|
|
25
|
-
"@definitelytyped/no-const-enum": "error",
|
|
26
|
-
"@definitelytyped/no-dead-reference": "error",
|
|
27
|
-
"@definitelytyped/no-declare-current-package": "error",
|
|
28
|
-
"@definitelytyped/no-import-default-of-export-equals": "error",
|
|
29
|
-
"@definitelytyped/no-import-of-dev-dependencies": "error",
|
|
30
|
-
"@definitelytyped/no-old-dt-header": "error",
|
|
31
|
-
"@definitelytyped/no-relative-import-in-test": "error",
|
|
32
|
-
"@definitelytyped/no-self-import": "error",
|
|
33
|
-
"@definitelytyped/no-single-declare-module": "error",
|
|
34
|
-
"@definitelytyped/no-single-element-tuple-type": "error",
|
|
35
|
-
"@definitelytyped/no-unnecessary-generics": "error",
|
|
36
|
-
"@definitelytyped/no-useless-files": "error",
|
|
37
|
-
"@definitelytyped/prefer-declare-function": "error",
|
|
38
|
-
"@definitelytyped/redundant-undefined": "error",
|
|
39
|
-
"@definitelytyped/strict-export-declare-modifiers": "error",
|
|
40
|
-
"@typescript-eslint/adjacent-overload-signatures": "error",
|
|
41
|
-
"@typescript-eslint/array-type": [
|
|
42
|
-
"error",
|
|
43
|
-
{
|
|
44
|
-
"default": "array-simple",
|
|
45
|
-
},
|
|
46
|
-
],
|
|
47
|
-
"@typescript-eslint/ban-ts-comment": [
|
|
48
|
-
"error",
|
|
49
|
-
{
|
|
50
|
-
"ts-check": false,
|
|
51
|
-
"ts-expect-error": false,
|
|
52
|
-
"ts-ignore": "allow-with-description",
|
|
53
|
-
"ts-nocheck": true,
|
|
54
|
-
},
|
|
55
|
-
],
|
|
56
|
-
"@typescript-eslint/ban-types": [
|
|
57
|
-
"error",
|
|
58
|
-
{
|
|
59
|
-
"extendDefaults": true,
|
|
60
|
-
"types": {
|
|
61
|
-
"{}": false,
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
],
|
|
65
|
-
"@typescript-eslint/consistent-type-definitions": "error",
|
|
66
|
-
"@typescript-eslint/explicit-member-accessibility": [
|
|
67
|
-
"error",
|
|
68
|
-
{
|
|
69
|
-
"accessibility": "no-public",
|
|
70
|
-
},
|
|
71
|
-
],
|
|
72
|
-
"@typescript-eslint/naming-convention": [
|
|
73
|
-
"error",
|
|
74
|
-
{
|
|
75
|
-
"custom": {
|
|
76
|
-
"match": false,
|
|
77
|
-
"regex": "^I[A-Z]",
|
|
78
|
-
},
|
|
79
|
-
"format": [],
|
|
80
|
-
"selector": "interface",
|
|
81
|
-
},
|
|
82
|
-
],
|
|
83
|
-
"@typescript-eslint/no-empty-interface": "error",
|
|
84
|
-
"@typescript-eslint/no-invalid-void-type": [
|
|
85
|
-
"error",
|
|
86
|
-
{
|
|
87
|
-
"allowAsThisParameter": true,
|
|
88
|
-
"allowInGenericTypeArguments": true,
|
|
89
|
-
},
|
|
90
|
-
],
|
|
91
|
-
"@typescript-eslint/no-misused-new": "error",
|
|
92
|
-
"@typescript-eslint/prefer-namespace-keyword": "error",
|
|
93
|
-
"@typescript-eslint/triple-slash-reference": [
|
|
94
|
-
"error",
|
|
95
|
-
{
|
|
96
|
-
"path": "always",
|
|
97
|
-
"types": "prefer-import",
|
|
98
|
-
},
|
|
99
|
-
],
|
|
100
|
-
"no-duplicate-imports": "error",
|
|
101
|
-
"unicode-bom": [
|
|
102
|
-
"error",
|
|
103
|
-
"never",
|
|
104
|
-
],
|
|
105
|
-
},
|
|
106
|
-
},
|
|
107
|
-
],
|
|
108
|
-
"plugins": [
|
|
109
|
-
"@definitelytyped",
|
|
110
|
-
"@typescript-eslint",
|
|
111
|
-
"jsdoc",
|
|
112
|
-
],
|
|
113
|
-
"rules": {
|
|
114
|
-
"jsdoc/check-tag-names": [
|
|
115
|
-
"error",
|
|
116
|
-
{
|
|
117
|
-
"definedTags": [
|
|
118
|
-
"addVersion",
|
|
119
|
-
"also",
|
|
120
|
-
"api",
|
|
121
|
-
"author",
|
|
122
|
-
"beta",
|
|
123
|
-
"brief",
|
|
124
|
-
"category",
|
|
125
|
-
"cfg",
|
|
126
|
-
"chainable",
|
|
127
|
-
"check",
|
|
128
|
-
"checkReturnValue",
|
|
129
|
-
"classDescription",
|
|
130
|
-
"condparamprivilege",
|
|
131
|
-
"constraint",
|
|
132
|
-
"credits",
|
|
133
|
-
"declaration",
|
|
134
|
-
"defApiFeature",
|
|
135
|
-
"defaultValue",
|
|
136
|
-
"detail",
|
|
137
|
-
"end",
|
|
138
|
-
"eventproperty",
|
|
139
|
-
"experimental",
|
|
140
|
-
"export",
|
|
141
|
-
"expose",
|
|
142
|
-
"extendscript",
|
|
143
|
-
"factory",
|
|
144
|
-
"field",
|
|
145
|
-
"final",
|
|
146
|
-
"fixme",
|
|
147
|
-
"fluent",
|
|
148
|
-
"for",
|
|
149
|
-
"governance",
|
|
150
|
-
"header",
|
|
151
|
-
"hidden-property",
|
|
152
|
-
"hidden",
|
|
153
|
-
"id",
|
|
154
|
-
"jsx",
|
|
155
|
-
"jsxImportSource",
|
|
156
|
-
"label",
|
|
157
|
-
"language",
|
|
158
|
-
"legacy",
|
|
159
|
-
"link",
|
|
160
|
-
"listen",
|
|
161
|
-
"locus",
|
|
162
|
-
"methodOf",
|
|
163
|
-
"minVersion",
|
|
164
|
-
"ngdoc",
|
|
165
|
-
"nonstandard",
|
|
166
|
-
"note",
|
|
167
|
-
"npm",
|
|
168
|
-
"observable",
|
|
169
|
-
"option",
|
|
170
|
-
"optionobject",
|
|
171
|
-
"options",
|
|
172
|
-
"packageDocumentation",
|
|
173
|
-
"param",
|
|
174
|
-
"parent",
|
|
175
|
-
"platform",
|
|
176
|
-
"plugin",
|
|
177
|
-
"preserve",
|
|
178
|
-
"privateRemarks",
|
|
179
|
-
"privilegeLevel",
|
|
180
|
-
"privilegeName",
|
|
181
|
-
"proposed",
|
|
182
|
-
"range",
|
|
183
|
-
"readOnly",
|
|
184
|
-
"related",
|
|
185
|
-
"remark",
|
|
186
|
-
"remarks",
|
|
187
|
-
"required",
|
|
188
|
-
"requires",
|
|
189
|
-
"restriction",
|
|
190
|
-
"returnType",
|
|
191
|
-
"section",
|
|
192
|
-
"see",
|
|
193
|
-
"since",
|
|
194
|
-
"const",
|
|
195
|
-
"singleton",
|
|
196
|
-
"source",
|
|
197
|
-
"struct",
|
|
198
|
-
"suppress",
|
|
199
|
-
"targetfolder",
|
|
200
|
-
"enum",
|
|
201
|
-
"title",
|
|
202
|
-
"record",
|
|
203
|
-
"title",
|
|
204
|
-
"TODO",
|
|
205
|
-
"trigger",
|
|
206
|
-
"triggers",
|
|
207
|
-
"typeparam",
|
|
208
|
-
"typeParam",
|
|
209
|
-
"unsupported",
|
|
210
|
-
"url",
|
|
211
|
-
"usage",
|
|
212
|
-
"warn",
|
|
213
|
-
"warning",
|
|
214
|
-
"version",
|
|
215
|
-
],
|
|
216
|
-
"typed": true,
|
|
217
|
-
},
|
|
218
|
-
],
|
|
219
|
-
},
|
|
220
|
-
"settings": {
|
|
221
|
-
"jsdoc": {
|
|
222
|
-
"tagNamePreference": {
|
|
223
|
-
"argument": "argument",
|
|
224
|
-
"exception": "exception",
|
|
225
|
-
"function": "function",
|
|
226
|
-
"method": "method",
|
|
227
|
-
"param": "param",
|
|
228
|
-
"return": "return",
|
|
229
|
-
"returns": "returns",
|
|
230
|
-
},
|
|
231
|
-
},
|
|
232
|
-
},
|
|
233
|
-
},
|
|
234
|
-
},
|
|
235
|
-
"meta": {
|
|
236
|
-
"name": "@definitelytyped/eslint-plugin",
|
|
237
|
-
"version": "version",
|
|
238
|
-
},
|
|
239
|
-
"rules": [
|
|
240
|
-
"export-just-namespace",
|
|
241
|
-
"no-any-union",
|
|
242
|
-
"no-bad-reference",
|
|
243
|
-
"no-const-enum",
|
|
244
|
-
"no-dead-reference",
|
|
245
|
-
"no-declare-current-package",
|
|
246
|
-
"no-import-default-of-export-equals",
|
|
247
|
-
"no-relative-import-in-test",
|
|
248
|
-
"no-self-import",
|
|
249
|
-
"no-single-element-tuple-type",
|
|
250
|
-
"no-unnecessary-generics",
|
|
251
|
-
"no-useless-files",
|
|
252
|
-
"prefer-declare-function",
|
|
253
|
-
"redundant-undefined",
|
|
254
|
-
"strict-export-declare-modifiers",
|
|
255
|
-
"no-single-declare-module",
|
|
256
|
-
"no-old-dt-header",
|
|
257
|
-
"no-import-of-dev-dependencies",
|
|
258
|
-
"npm-naming",
|
|
259
|
-
"expect",
|
|
260
|
-
],
|
|
261
|
-
}
|
|
262
|
-
`;
|
package/test/eslint.test.ts
DELETED
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import { ESLint, Linter } from "eslint";
|
|
2
|
-
import path from "path";
|
|
3
|
-
import stripAnsi from "strip-ansi";
|
|
4
|
-
import { globSync } from "glob";
|
|
5
|
-
import { fixtureRoot } from "./util";
|
|
6
|
-
import { toMatchFile } from "jest-file-snapshot";
|
|
7
|
-
import * as plugin from "../src/index";
|
|
8
|
-
import fs from "fs";
|
|
9
|
-
|
|
10
|
-
expect.extend({ toMatchFile });
|
|
11
|
-
const snapshotDir = path.join(__dirname, "__file_snapshots__");
|
|
12
|
-
|
|
13
|
-
const allFixtures = globSync(["**/*.ts", "**/*.cts", "**/*.mts", "**/*.tsx"], { cwd: fixtureRoot });
|
|
14
|
-
|
|
15
|
-
function getLintSnapshotPath(fixture: string): string {
|
|
16
|
-
return path.join(snapshotDir, `${fixture}.lint`);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function getAllLintSnapshots() {
|
|
20
|
-
return new Set(globSync("**/*.lint", { cwd: snapshotDir, absolute: true }));
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function getAllExpectedLintSnapshots() {
|
|
24
|
-
return new Set(allFixtures.map(getLintSnapshotPath));
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
let eslint: ESLint;
|
|
28
|
-
|
|
29
|
-
beforeAll(() => {
|
|
30
|
-
eslint = new ESLint({
|
|
31
|
-
cwd: fixtureRoot,
|
|
32
|
-
plugins: { [plugin.meta.name]: plugin },
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
afterAll(() => {
|
|
37
|
-
eslint = undefined as any;
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
// Force one test per fixture so we can see when a file has no errors.
|
|
41
|
-
for (const fixture of allFixtures) {
|
|
42
|
-
describe(`fixture ${fixture}`, () => {
|
|
43
|
-
it("should lint", async () => {
|
|
44
|
-
const results = await eslint.lintFiles([fixture]);
|
|
45
|
-
for (const result of results) {
|
|
46
|
-
result.filePath = path.relative(fixtureRoot, result.filePath);
|
|
47
|
-
}
|
|
48
|
-
const formatter = await eslint.loadFormatter("stylish");
|
|
49
|
-
const formatted = await formatter.format(results);
|
|
50
|
-
const resultText = stripAnsi(formatted).trim() || "No errors";
|
|
51
|
-
expect(resultText).not.toContain("Parsing error");
|
|
52
|
-
const newOutput = formatResultsWithInlineErrors(results);
|
|
53
|
-
expect(resultText + "\n\n" + newOutput).toMatchFile(getLintSnapshotPath(fixture));
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function formatResultsWithInlineErrors(results: ESLint.LintResult[]): string {
|
|
59
|
-
const output: string[] = [];
|
|
60
|
-
|
|
61
|
-
function pushMessage(message: Linter.LintMessage): void {
|
|
62
|
-
const ruleId = message.ruleId;
|
|
63
|
-
if (!ruleId) {
|
|
64
|
-
throw new Error("Expected ruleId");
|
|
65
|
-
}
|
|
66
|
-
const lines = message.message.split(/\r?\n/);
|
|
67
|
-
for (let i = 0; i < lines.length; i++) {
|
|
68
|
-
const line = lines[i];
|
|
69
|
-
const prefix = `!!! ${i === 0 ? ruleId : " ".repeat(ruleId.length)}: `;
|
|
70
|
-
output.push(prefix + line);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
const indent = " ";
|
|
75
|
-
|
|
76
|
-
for (const result of results) {
|
|
77
|
-
output.push(`==== ${result.filePath} ====`);
|
|
78
|
-
output.push("");
|
|
79
|
-
|
|
80
|
-
const sourceText = fs.readFileSync(path.join(fixtureRoot, result.filePath), "utf-8");
|
|
81
|
-
|
|
82
|
-
const lines = sourceText.split(/\r?\n/);
|
|
83
|
-
|
|
84
|
-
for (let i = 0; i < lines.length; i++) {
|
|
85
|
-
const line = lines[i];
|
|
86
|
-
output.push(indent + line);
|
|
87
|
-
|
|
88
|
-
for (const message of result.messages) {
|
|
89
|
-
const startLine = message.line - 1;
|
|
90
|
-
const endLine = message.endLine === undefined ? startLine : message.endLine - 1;
|
|
91
|
-
const startColumn = message.column - 1;
|
|
92
|
-
const endColumn = message.endColumn === undefined ? startColumn : message.endColumn - 1;
|
|
93
|
-
if (i < startLine || i > endLine) {
|
|
94
|
-
continue;
|
|
95
|
-
}
|
|
96
|
-
if (i === startLine) {
|
|
97
|
-
const squiggle = "~".repeat(Math.max(1, endColumn - startColumn));
|
|
98
|
-
output.push(indent + " ".repeat(startColumn) + squiggle);
|
|
99
|
-
pushMessage(message);
|
|
100
|
-
} else {
|
|
101
|
-
const squiggle = "~".repeat(Math.max(1, line.length - startColumn));
|
|
102
|
-
output.push(indent + squiggle);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
output.push("");
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
return output.join("\n").trim() + "\n";
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
// Similar to https://github.com/storybookjs/storybook/blob/df357020e010f49e7c325942f0c891e6702527d6/code/addons/storyshots-core/src/api/integrityTestTemplate.ts
|
|
114
|
-
describe("lint snapshots", () => {
|
|
115
|
-
it("abandoned snapshots", () => {
|
|
116
|
-
const expectedSnapshots = getAllExpectedLintSnapshots();
|
|
117
|
-
const actualSnapshots = getAllLintSnapshots();
|
|
118
|
-
const abandonedSnapshots = [...actualSnapshots].filter((s) => !expectedSnapshots.has(s));
|
|
119
|
-
|
|
120
|
-
if (abandonedSnapshots.length === 0) {
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
// https://github.com/jestjs/jest/issues/8732#issuecomment-516445064
|
|
125
|
-
if (expect.getState().snapshotState._updateSnapshot === "all") {
|
|
126
|
-
for (const abandoned of abandonedSnapshots) {
|
|
127
|
-
fs.rmSync(abandoned);
|
|
128
|
-
}
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
expect(abandonedSnapshots).toHaveLength(0);
|
|
133
|
-
});
|
|
134
|
-
});
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
// eslint-disable-next-line @definitelytyped/no-relative-import-in-test
|
|
2
|
-
import * as expect from "./";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
// $ExpectType number
|
|
6
|
-
expect.foo;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
// $ExpectType 1234
|
|
10
|
-
expect.foo;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
// $ExpectType NotRightAtAll
|
|
14
|
-
expect.foo;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
// $ExpectType string | number | undefined
|
|
18
|
-
expect.aUnion;
|
|
19
|
-
|
|
20
|
-
// $ExpectType string | undefined | number
|
|
21
|
-
expect.aUnion;
|
|
22
|
-
|
|
23
|
-
// $ExpectType number | string | undefined
|
|
24
|
-
expect.aUnion;
|
|
25
|
-
|
|
26
|
-
// $ExpectType number | undefined | string
|
|
27
|
-
expect.aUnion;
|
|
28
|
-
|
|
29
|
-
// $ExpectType undefined | string | number
|
|
30
|
-
expect.aUnion;
|
|
31
|
-
|
|
32
|
-
// $ExpectType undefined | number | string
|
|
33
|
-
expect.aUnion;
|
|
34
|
-
|
|
35
|
-
// $ExpectType any || undefined | number | string
|
|
36
|
-
expect.aUnion;
|
|
37
|
-
|
|
38
|
-
// $ExpectType { prop1: "a" | "b" | "c"; prop2: readonly (string | number)[]; prop3: readonly (string | number)[]; }
|
|
39
|
-
expect.complicatedUnion(1, 2);
|
|
40
|
-
|
|
41
|
-
// $ExpectType { prop1: "c" | "b" | "a"; prop2: ReadonlyArray<number | string>; prop3: ReadonlyArray<string | number>; }
|
|
42
|
-
expect.complicatedUnion(1, 2);
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
// $ExpectType NotMatched
|
|
46
|
-
// Whoops
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
// $ExpectType NotMatched
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export const foo = 1234;
|
|
2
|
-
|
|
3
|
-
export const aUnion: string | number | undefined;
|
|
4
|
-
|
|
5
|
-
export function complicatedUnion<T extends string | number>(x: T, y: T): {
|
|
6
|
-
prop1: "a" | "b" | "c";
|
|
7
|
-
prop2: readonly (string | number)[];
|
|
8
|
-
prop3: ReadonlyArray<string | number>;
|
|
9
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
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
|
-
"expect-tests.ts"
|
|
19
|
-
]
|
|
20
|
-
}
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const value = 3;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default class Hello {}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import * as fs from "fs";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const value = 123;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export = stuff;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export = createStuff();
|
|
@@ -1,31 +0,0 @@
|
|
|
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
|
-
"good1.d.ts",
|
|
18
|
-
"good2.d.ts",
|
|
19
|
-
"good3.d.ts",
|
|
20
|
-
"good4.d.ts",
|
|
21
|
-
"good5.d.ts",
|
|
22
|
-
"good6.d.ts",
|
|
23
|
-
"good7.d.ts",
|
|
24
|
-
"good8.d.ts",
|
|
25
|
-
"good9.d.ts",
|
|
26
|
-
"bad1.d.ts",
|
|
27
|
-
"bad2.d.ts",
|
|
28
|
-
"bad3.d.ts",
|
|
29
|
-
"export-just-namespace-tests.ts"
|
|
30
|
-
]
|
|
31
|
-
}
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const foo = 1234;
|
|
@@ -1,20 +0,0 @@
|
|
|
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
|
-
}
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const foo = 1234;
|