using System;
using UnityEngine;
[CreateAssetMenu(fileName = "Weapon", menuName = "Item/Weapon")]
public class WeaponItemSprite : ItemTypeScriptableObject
{
public GameObject gameObject;
public Sprite sprite;
public string weaponName = "Weapon name";
public Rarity rarity = Rarity.Normal;
public ItemType itemType = ItemType.Weapon;
[Range(0f, 1000f)]
public float damage = 1f;
[Range(0f, 20f)]
public int cost = 1;
}

I want it so that Item.type will be shown in the Inspector and be "greyed out" and you cannot change it.
You need a custom Editor or PropertyDrawer for this using e.g.
EditorGUI.DisabledGroupScopeor if going for UIElementsVisualElement.SetEnabled(false)There are assets that already implement handy decorator drawers like e.g. NaughtyAtttributes
As a complete alternative approach - assuming that this "field" is actually to be implemented by all inheritors of
ItemTypeScriptableObjectanyway - you could rather use a propertyand then inheritors can still decide whether they want to expose it
or - like in your case - have a fixed value (not visible in the Inspector, though)