What does ことがないように express?


I've come across this sentence quite a few months ago, but I never understood
the meaning of "こと **が** ないように", I've searched and found about こと **の** ないように,
but I think it has not the same meaning.

This is the sentence:

> 松野の家名を汚す **ことがないように** お願いしますよ。

The translation I found is:

> "Please, do not do anything that can dishonor the name of Matsuno family"




> 松野の家名を汚すこと **が** ないようにお願いしますよ。  
>  松野の家名を汚すこと **の** ないようにお願いしますよ。

Both are correct and mean the same thing. (～こと **の** ないように sounds a tiny bit
more formal to me..)

ように is the continuative form of the auxiliary ようだ. ようだ comes from the noun
[様]{よう} + the copula だ. Since the よう is originally a noun, it can act like a
noun and can be a head noun of a relative clause.

> ｛松野の家名を汚すこと **が/の** ない｝よう(に)  
>  _lit._ (in) the way/manner [that you don't dishonor the name of the Matsuno
> family]  
>  → so as not to dishonor the name of the Matsuno family

You could see 松野の家名を汚すことがない as a relative clause that modifies the noun よう.  
It has the same structure as:

> ｛日本人 **が/の** 知らない｝日本語  
>  the Japanese language [that Japanese people don't know]

For more on the が-の conversion, see: [How does the の work in
「日本人の知らない日本語」?](https://japanese.stackexchange.com/q/12825/9831)




> 松野の家名を汚すこと **が** ないようにお願いしますよ。  
>  松野の家名を汚すこと **の** ないようにお願いしますよ。

Both are correct and mean the same thing. (～こと **の** ないように sounds a tiny bit
more formal to me..)

ように is the continuative form of the auxiliary ようだ. ようだ comes from the noun
[様]{よう} + the copula だ. Since the よう is originally a noun, it can act like a
noun and can be a head noun of a relative clause.

> ｛松野の家名を汚すこと **が/の** ない｝よう(に)  
>  _lit._ (in) the way/manner [that you don't dishonor the name of the Matsuno
> family]  
>  → so as not to dishonor the name of the Matsuno family

You could see 松野の家名を汚すことがない as a relative clause that modifies the noun よう.  
It has the same structure as:

> ｛日本人 **が/の** 知らない｝日本語  
>  the Japanese language [that Japanese people don't know]

For more on the が-の conversion, see: [How does the の work in
「日本人の知らない日本語」?](https://japanese.stackexchange.com/q/12825/9831)

