-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Port builtin tslint rules Only keep 10; I tried no-redeclare but it doesn't suffice to forbid only duplicated `var` and nothing else because it doesn't understand Typescript syntax or semantics. * Add changeset * fix some test * make tests pass
- Loading branch information
Showing
20 changed files
with
85 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@definitelytyped/eslint-plugin": patch | ||
"@definitelytyped/dtslint": patch | ||
--- | ||
|
||
Port tslint builtins -> eslint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
{ | ||
"extends": "./dtslint.json", | ||
"rules": { | ||
"no-redundant-jsdoc": false, | ||
"npm-naming": [true, { "mode": "code" }] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,110 +1,8 @@ | ||
{ | ||
"extends": "tslint:all", | ||
"rulesDirectory": "./dist/rules", | ||
"rules": { | ||
// Broken in Typescript 5.0 and above: | ||
"unnecessary-bind": false, | ||
"no-unnecessary-initializer": false, | ||
"prefer-for-of": false, | ||
"only-arrow-functions": false, | ||
// Custom rules | ||
"expect": true, | ||
"unified-signatures": true, | ||
"void-return": true, | ||
"npm-naming": true, | ||
|
||
"interface-name": [true, "never-prefix"], | ||
"member-access": [true, "no-public"], | ||
"no-unnecessary-callback-wrapper": true, | ||
"no-namespace": [true, "allow-declarations"], | ||
"one-variable-per-declaration": [true, "ignore-for-loop"], | ||
"prefer-template": [true, "allow-single-concat"], | ||
|
||
// TODO? | ||
"align": false, // TODO | ||
"arrow-parens": false, | ||
"arrow-return-shorthand": true, // TODO: "multiline" | ||
"linebreak-style": false, // TODO | ||
"no-void-expression": [true, "ignore-arrow-function-shorthand"], | ||
"no-any": false, // TODO | ||
"no-floating-promises": false, // TODO: https://github.com/palantir/tslint/issues/2879 | ||
"no-import-side-effect": false, | ||
"no-this-assignment": false, | ||
"no-unbound-method": false, // TODO? | ||
"no-unsafe-any": false, // TODO | ||
"no-restricted-globals": false, | ||
"number-literal-format": false, // TODO | ||
"promise-function-async": false, | ||
"restrict-plus-operands": false, // TODO | ||
"return-undefined": false, // TODO | ||
"switch-final-break": false, // TODO | ||
"prefer-method-signature": false, // TODO? | ||
|
||
// Pretty sure we don't want these | ||
"ban-ts-ignore": false, // Provided by ts-eslint | ||
"binary-expression-operand-order": false, | ||
"class-name": false, | ||
"comment-format": false, | ||
"completed-docs": false, | ||
"curly": false, | ||
"cyclomatic-complexity": false, | ||
"deprecation": false, | ||
"file-name-casing": false, | ||
"forin": false, | ||
"indent": false, | ||
"match-default-export-name": false, | ||
"max-classes-per-file": false, | ||
"max-file-line-count": false, | ||
"max-line-length": false, | ||
"member-ordering": false, | ||
"newline-before-return": false, | ||
"newline-per-chained-call": false, | ||
"no-bitwise": false, | ||
"no-consecutive-blank-lines": false, | ||
"no-console": false, | ||
"no-default-export": false, | ||
"no-empty": false, | ||
"no-implicit-dependencies": false, // See https://github.com/palantir/tslint/issues/3364 | ||
"no-inferred-empty-object-type": false, | ||
"no-magic-numbers": false, | ||
"no-non-null-assertion": false, | ||
"no-null-keyword": false, | ||
"no-parameter-properties": false, | ||
"no-parameter-reassignment": false, | ||
"no-reference": false, // But see no-bad-reference | ||
"no-require-imports": false, | ||
"no-shadowed-variable": false, | ||
"no-string-literal": false, | ||
"no-submodule-imports": false, | ||
"no-tautology-expression": false, | ||
"no-trailing-whitespace": false, | ||
"no-unused-expression": false, | ||
"no-unused-variable": false, | ||
"no-use-before-declare": false, | ||
"object-literal-key-quotes": false, | ||
"object-literal-sort-keys": false, | ||
"one-line": false, | ||
"ordered-imports": false, | ||
"prefer-function-over-method": false, | ||
"quotemark": false, | ||
"semicolon": false, | ||
"space-before-function-paren": false, | ||
"space-within-parens": false, | ||
"strict-boolean-expressions": false, | ||
"strict-type-predicates": false, | ||
"switch-default": false, | ||
"trailing-comma": false, | ||
"triple-equals": [true, "allow-null-check"], | ||
"typedef": false, | ||
"typedef-whitespace": false, | ||
"type-literal-delimiter": false, | ||
"variable-name": false, | ||
"whitespace": false, | ||
"increment-decrement": false, | ||
"unnecessary-constructor": false, | ||
"unnecessary-else": false, | ||
"no-angle-bracket-type-assertion": false, | ||
"no-default-import": false, | ||
"callable-types": false | ||
"npm-naming": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 11 additions & 5 deletions
16
...s/eslint-plugin/test/__file_snapshots__/types/no-import-of-dev-dependencies/bad.d.ts.lint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletion
5
...eslint-plugin/test/__file_snapshots__/types/no-import-of-dev-dependencies/index.d.ts.lint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 12 additions & 1 deletion
13
...apshots__/types/no-import-of-dev-dependencies/no-import-of-dev-dependencies-tests.ts.lint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 12 additions & 1 deletion
13
...s/eslint-plugin/test/__file_snapshots__/types/no-self-import/no-self-import-tests.ts.lint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ No errors | |
|
||
==== types/strict-export-declare-modifiers/good5.d.ts ==== | ||
|
||
interface J {} | ||
interface J { j: any } |
2 changes: 1 addition & 1 deletion
2
packages/eslint-plugin/test/fixtures/types/no-import-default-of-export-equals/bad.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
declare module "a" { | ||
interface I {} | ||
interface I { i: any } | ||
export = I; | ||
} | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
packages/eslint-plugin/test/fixtures/types/no-import-default-of-export-equals/index.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
declare module "agood" { | ||
interface I {} | ||
interface I { i: any } | ||
export default I; | ||
} | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
packages/eslint-plugin/test/fixtures/types/no-single-declare-module/bad.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
declare module "foo" {} | ||
|
||
// Other global declarations don't affect this. They should go in "declare global". | ||
interface I {} | ||
interface I { i: any } |
2 changes: 1 addition & 1 deletion
2
packages/eslint-plugin/test/fixtures/types/strict-export-declare-modifiers/bad1.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
declare interface I {} | ||
declare interface I { i: any } |
2 changes: 1 addition & 1 deletion
2
packages/eslint-plugin/test/fixtures/types/strict-export-declare-modifiers/bad5.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
interface I {} | ||
interface I { i: any } | ||
export namespace M {} |
2 changes: 1 addition & 1 deletion
2
packages/eslint-plugin/test/fixtures/types/strict-export-declare-modifiers/good5.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
interface J {} | ||
interface J { j: any } |