A fully functional shopping cart that utilizes local storage.
I wanted to build out a functional shopping cart that includes adding and removing items from the cart as well as calculating the subtotal of all items. All of this is accomplished using TypeScript, React, JSON data for the custom store items, and local storage.
- TypeScript 5.3.3
- React 18.2.0
export default {
// other rules...
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
project: ["./tsconfig.json", "./tsconfig.node.json"],
tsconfigRootDir: __dirname,
},
};- Replace
plugin:@typescript-eslint/recommendedtoplugin:@typescript-eslint/recommended-type-checkedorplugin:@typescript-eslint/strict-type-checked - Optionally add
plugin:@typescript-eslint/stylistic-type-checked - Install eslint-plugin-react and add
plugin:react/recommended&plugin:react/jsx-runtimeto theextendslist