Skip to content

Commit

Permalink
style(eslint-plugin): add workaround for failing lint
Browse files Browse the repository at this point in the history
  • Loading branch information
phaux committed Apr 3, 2020
1 parent 932ae62 commit f355e4e
Showing 1 changed file with 7 additions and 7 deletions.
@@ -1,5 +1,5 @@
import rule from '../../src/rules/method-signature-style';
import { batchedSingleLineTests, RuleTester } from '../RuleTester';
import { batchedSingleLineTests, noFormat, RuleTester } from '../RuleTester';

const ruleTester = new RuleTester({
parser: '@typescript-eslint/parser',
Expand All @@ -8,7 +8,7 @@ const ruleTester = new RuleTester({
ruleTester.run('method-signature-style', rule, {
valid: [
...batchedSingleLineTests({
code: `
code: noFormat`
interface Test { f: (a: string) => number }
interface Test { ['f']: (a: boolean) => void }
interface Test { f: <T>(a: T) => T }
Expand All @@ -22,7 +22,7 @@ ruleTester.run('method-signature-style', rule, {
}),
...batchedSingleLineTests({
options: ['method'],
code: `
code: noFormat`
interface Test { f(a: string): number }
interface Test { ['f'](a: boolean): void }
interface Test { f<T>(a: T): T }
Expand All @@ -37,7 +37,7 @@ ruleTester.run('method-signature-style', rule, {
],
invalid: [
...batchedSingleLineTests({
code: `
code: noFormat`
interface Test { f(a: string): number }
interface Test { ['f'](a: boolean): void }
interface Test { f<T>(a: T): T }
Expand All @@ -59,7 +59,7 @@ ruleTester.run('method-signature-style', rule, {
{ messageId: 'errorMethod', line: 9 },
{ messageId: 'errorMethod', line: 10 },
],
output: `
output: noFormat`
interface Test { f: (a: string) => number }
interface Test { ['f']: (a: boolean) => void }
interface Test { f: <T>(a: T) => T }
Expand All @@ -73,7 +73,7 @@ ruleTester.run('method-signature-style', rule, {
}),
...batchedSingleLineTests({
options: ['method'],
code: `
code: noFormat`
interface Test { f: (a: string) => number }
interface Test { ['f']: (a: boolean) => void }
interface Test { f: <T>(a: T) => T }
Expand All @@ -95,7 +95,7 @@ ruleTester.run('method-signature-style', rule, {
{ messageId: 'errorProperty', line: 9 },
{ messageId: 'errorProperty', line: 10 },
],
output: `
output: noFormat`
interface Test { f(a: string): number }
interface Test { ['f'](a: boolean): void }
interface Test { f<T>(a: T): T }
Expand Down

0 comments on commit f355e4e

Please sign in to comment.