Skip to content

Commit

Permalink
fix(eslint-plugin): remove all whitespaces in comparison #4220 (#4223)
Browse files Browse the repository at this point in the history
  • Loading branch information
armano2 committed Nov 26, 2021
1 parent 4aaa34e commit 853d799
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/eslint-plugin/src/rules/ban-types.ts
Expand Up @@ -25,7 +25,7 @@ export type Options = [
export type MessageIds = 'bannedTypeMessage';

function removeSpaces(str: string): string {
return str.replace(/ /g, '');
return str.replace(/\s/g, '');
}

function stringifyNode(
Expand Down
12 changes: 12 additions & 0 deletions packages/eslint-plugin/tests/rules/ban-types.test.ts
Expand Up @@ -394,10 +394,13 @@ let b: Foo<NS.Good>;
code: noFormat`
let foo: {} = {};
let bar: { } = {};
let baz: {
} = {};
`,
output: `
let foo: object = {};
let bar: object = {};
let baz: object = {};
`,
options: [
{
Expand Down Expand Up @@ -428,6 +431,15 @@ let bar: object = {};
line: 3,
column: 10,
},
{
messageId: 'bannedTypeMessage',
data: {
name: '{}',
customMessage: ' Use object instead.',
},
line: 4,
column: 10,
},
],
},
{
Expand Down

0 comments on commit 853d799

Please sign in to comment.