Sen. Barry M. Goldwater (R-Ariz.) and 14 other conservative lawmakers filed suit yesterday to block President Carter from terminating America's defense treaty with Taiwan, an action Goldwater termed "one of the worst power grabs in history."

The seven senators and eight representatives-all but one of them Republicans-charged in their suit that Carter was violating U.S. law and ignoring the precedent for terminating other treaties by not giving Congress a chance to vote on any possible end of the U.S. Taiwan pact.

Carter announced last week that as of Jan. 1 the United States and the People's Republic of China will have diplomatic relations and that the Taiwan-U.S. defense treaty would be terminated a year later. The treaty permits "either party" to end the pact after a year's notice is given the other country.

"Just as the president alone cannot repeal a law," Goldwater said, "he cannot repeal a treaty, which itself is a law. He first must ask Congress, or at least the Senate, which was a partner with him in ratifying the treaty, for approval to cancel it."

Goldwater contended that if Carter's action stands, then no country that has a treaty with the United States "can be assured that [a treaty] will last any longer than the whim of the single person who happens to sit in the Oval Office at any given moment of history."

Carter and Secretary of State Cyrus R. Vance were named as defendants in the suit. The White house had not immediate comment on it, but previously has cited the one-year notification provision as authority to terminate the treaty.

The lawmakers claimed in their suit that when the treaty said that "either party" could terminate the pact, it did not mean that a president could do that unilaterally. The suit cited a provision of the Vienna Convention on the Law of Treaties which defines the term "party" as "a state which has consented to be bound by the treaty and for which the treaty is in force."

Moreover, the senators and representatives said that a provision of the International Security Assistance Act of 1978 also prohibits Carter from acting alone to end the defense treaty.

An amendment was attached to the measure saying that "it is the sense of the Congress that there should be prior consultation between the Congress and the executive branch" on any changes affecting the Taiwan-U.S. treaty.

The suit claimed that "under past practice" presidents have acted with the Senate or Congress to end treaties. Of 48 treaties that have been terminated, the suit said, 30 have been ended by congressional legislation, eight by joint House and Senate resolutions, two by Senate resolutions and four superseded by new treaties or laws. Another four have been ended by presidents, the suit said, "but under circumstances where it became impossible to perform the obligations specified in those treaties, and thus went unchallenged."

The lawmakers asked U.S. District Court Judge Oliver Gasch to declare that Carter cannot unilaterally end the treaty and that any decision to terminate it must be approved by Congress.

Besides Goldwater, those suing to block the end to the defense treaty included Republican Sens. Jake Garn and Orrin Hatch of Utah, Strom Thurmond of South Carolina, Jesse A. Helms of north Carolina, Carl Curtis of Nebraska and Sen-elect Gordon Humphrey of New Hampshire. Also joining the suit were Republican Reps. Robert Bauman of Maryland, Steve Symms and George Hansen of Idaho, Larry Mcdonald of Georgia, Robert Daniel of Virginia, Eldon Rudd of Arizona and John Ashbrook of Ohio and Democratic Rep. Bob Stump of Arizona.