The Key "Unit Of Measure" is not sorted alphabetically

Viewed 60

Maybe I am loosing my mind but I keep getting an error that says:

Failed to compile
/Users/matthewlemke/Desktop/Projects/novamud-mudman-workspace/web/react- 
app/src/Components/Main/Admin/Products/AdminProducts.tsx
(74,9): The key 'UnitOfMeasure' is not sorted alphabetically

I have moved it around everywhere and I dont get it, this is what makes sense to me:

public state = {
    editing: false,
    expenseTypes: [] as IEBPExpenseType[],
    formattedExpenseTypeData: undefined as unknown as IList,
    formattedProductsData: this.productList,
    modal: false,
    products: this.products,
    regionData: this.productList,
    regions: [] as IRegion[],
    rowIndex: 0,
    // selectedUnitOfMeasure: [] as boolean[],
    showDefault: false,
    showExpense: false,
    showRegion: true,
    showUOM: true,
    UnitOfMeasure: this.UnitOfMeasure,
};

what am I not seeing here?

1 Answers

The object-literal-sort-keys linting rule is case-sensitive. You can disable this by using the ignore-case config option.

The reason you're getting an error is because uppercase letters have a lower ASCII value than lowercase letters, so UnitOfMeasure should be first (since it's the only uppercase property name in your example).

It might also help to look at an ASCII table in order to get a better understanding.

Related