Skip to content

Commit e5a25fa

Browse files
authored
test(unbound-method): port most of the test suite (#850)
* test(unbound-method): update fixtures * test(unbound-method): port base rule valid cases * test(unbound-method): port base rule invalid cases * test(unbound-method): port custom behaviour tests * test: remove unused fixtures * test: rename back to `fixture` * chore: formatting
1 parent 48aa682 commit e5a25fa

File tree

5 files changed

+1353
-27
lines changed

5 files changed

+1353
-27
lines changed

src/rules/unbound-method.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const toThrowMatchers = [
1414
'toThrowErrorMatchingInlineSnapshot',
1515
]
1616

17-
type MESSAGE_IDS = 'unbound' | 'unboundWithoutThisAnnotation'
17+
export type MESSAGE_IDS = 'unbound' | 'unboundWithoutThisAnnotation'
1818

1919
const DEFAULT_MESSAGE = 'This rule requires `@typescript-eslint/eslint-plugin`'
2020

tests/fixture/class.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// used by no-throw-literal test case to validate custom error
2+
export class Error {}
3+
4+
// used by unbound-method test case to test imports
5+
export const console = { log() {} }
6+
7+
// used by prefer-reduce-type-parameter to test native vs userland check
8+
export class Reducable {
9+
reduce() {}
10+
}
11+
12+
// used by no-implied-eval test function imports
13+
export class Function {}

tests/fixture/react.tsx

Whitespace-only changes.

tests/fixture/tsconfig.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
{
22
"compilerOptions": {
3-
"strict": true
3+
"jsx": "preserve",
4+
"target": "es5",
5+
"module": "commonjs",
6+
"strict": true,
7+
"esModuleInterop": true,
8+
"lib": ["es2015", "es2017", "esnext"],
9+
"experimentalDecorators": true
410
},
11+
"files": ["estree.ts"],
512
"include": ["*.ts", "*.tsx"]
613
}

0 commit comments

Comments
 (0)