@@ -1844,6 +1844,52 @@ ruleTester.run("my-rule", rule, {
18441844 { code : "foo" , errors : [ / f o o / ] } ,
18451845 { code : "foo" , errors : [ { message : "foo" } ] } ,
18461846 { code : "foo" , errors : [ { message : "foo" , data : { foo : true } } ] } ,
1847+ { code : "foo" , errors : [ { message : "foo" , data : undefined } ] } ,
1848+ {
1849+ code : "foo" ,
1850+ errors : [
1851+ {
1852+ message : "foo" ,
1853+ // @ts -expect-error -- `data` cannot be `null`
1854+ data : null ,
1855+ } ,
1856+ ] ,
1857+ } ,
1858+ {
1859+ code : "foo" ,
1860+ errors : [
1861+ {
1862+ message : "foo" ,
1863+ data : {
1864+ foo : "foo" ,
1865+ bar : 1 ,
1866+ baz : true ,
1867+ qux : false ,
1868+ a : 1n ,
1869+ b : null ,
1870+ c : undefined ,
1871+ d : void 0 ,
1872+ // @ts -expect-error -- Symbols are not allowed in `data`.
1873+ e : Symbol ( "b" ) ,
1874+ // @ts -expect-error -- Objects are not allowed in `data`.
1875+ f : {
1876+ hi : "hi" ,
1877+ } ,
1878+ // @ts -expect-error -- Arrays are not allowed in `data`.
1879+ g : [ 1 , 2 , 3 ] ,
1880+ // @ts -expect-error -- Sets are not allowed in `data`.
1881+ h : new Set ( [ 1 , 2 , 3 ] ) ,
1882+ // @ts -expect-error -- Maps are not allowed in `data`.
1883+ i : new Map ( [
1884+ [ "a" , 1 ] ,
1885+ [ "b" , 2 ] ,
1886+ ] ) ,
1887+ // @ts -expect-error -- Functions are not allowed in `data`.
1888+ j : ( ) => { } ,
1889+ } ,
1890+ } ,
1891+ ] ,
1892+ } ,
18471893 { code : "foo" , errors : [ { message : "foo" , line : 0 } ] } ,
18481894 {
18491895 code : "foo" ,
@@ -1859,6 +1905,49 @@ ruleTester.run("my-rule", rule, {
18591905 messageId : "foo" ,
18601906 output : "foo" ,
18611907 } ,
1908+ {
1909+ messageId : "foo" ,
1910+ output : "foo" ,
1911+ data : undefined ,
1912+ } ,
1913+ {
1914+ messageId : "foo" ,
1915+ output : "foo" ,
1916+ // @ts -expect-error -- `data` cannot be `null`
1917+ data : null ,
1918+ } ,
1919+ {
1920+ messageId : "foo" ,
1921+ desc : "foo" ,
1922+ output : "foo" ,
1923+ data : {
1924+ foo : "foo" ,
1925+ bar : 1 ,
1926+ baz : true ,
1927+ qux : false ,
1928+ a : 1n ,
1929+ b : null ,
1930+ c : undefined ,
1931+ d : void 0 ,
1932+ // @ts -expect-error -- Symbols are not allowed in `data`.
1933+ e : Symbol ( "b" ) ,
1934+ // @ts -expect-error -- Objects are not allowed in `data`.
1935+ f : {
1936+ hi : "hi" ,
1937+ } ,
1938+ // @ts -expect-error -- Arrays are not allowed in `data`.
1939+ g : [ 1 , 2 , 3 ] ,
1940+ // @ts -expect-error -- Sets are not allowed in `data`.
1941+ h : new Set ( [ 1 , 2 , 3 ] ) ,
1942+ // @ts -expect-error -- Maps are not allowed in `data`.
1943+ i : new Map ( [
1944+ [ "a" , 1 ] ,
1945+ [ "b" , 2 ] ,
1946+ ] ) ,
1947+ // @ts -expect-error -- Functions are not allowed in `data`.
1948+ j : ( ) => { } ,
1949+ } ,
1950+ } ,
18621951 ] ,
18631952 } ,
18641953 ] ,
0 commit comments