mirror of
https://github.com/vercel/commerce.git
synced 2025-05-18 23:46:58 +00:00
revert: revert eslint config and prettier config
This commit is contained in:
parent
fa68bb1f1d
commit
ca5787dbaa
@ -1,9 +0,0 @@
|
|||||||
{
|
|
||||||
"trailingComma": "es5",
|
|
||||||
"useTabs": false,
|
|
||||||
"tabWidth": 2,
|
|
||||||
"semi": true,
|
|
||||||
"singleQuote": false,
|
|
||||||
"printWidth": 80,
|
|
||||||
"plugins": ["prettier-plugin-tailwindcss"]
|
|
||||||
}
|
|
23
eslintrc.js
Normal file
23
eslintrc.js
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
module.exports = {
|
||||||
|
extends: ["next", "prettier"],
|
||||||
|
plugins: ["unicorn"],
|
||||||
|
rules: {
|
||||||
|
"no-unused-vars": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
args: "after-used",
|
||||||
|
caughtErrors: "none",
|
||||||
|
ignoreRestSiblings: true,
|
||||||
|
vars: "all",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
"prefer-const": "error",
|
||||||
|
"react-hooks/exhaustive-deps": "error",
|
||||||
|
"unicorn/filename-case": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
case: "kebabCase",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
};
|
@ -1,64 +0,0 @@
|
|||||||
{
|
|
||||||
"parser": "@typescript-eslint/parser",
|
|
||||||
"overrides": [
|
|
||||||
{
|
|
||||||
"files": ["*.ts", "*.tsx"],
|
|
||||||
"parserOptions": {
|
|
||||||
"ecmaFeatures": {
|
|
||||||
"jsx": true
|
|
||||||
},
|
|
||||||
"ecmaVersion": "latest",
|
|
||||||
"sourceType": "module",
|
|
||||||
"project": ["./tsconfig.json"]
|
|
||||||
},
|
|
||||||
"extends": [
|
|
||||||
"next",
|
|
||||||
"plugin:import/typescript",
|
|
||||||
"plugin:prettier/recommended",
|
|
||||||
"eslint:recommended",
|
|
||||||
"plugin:@typescript-eslint/recommended"
|
|
||||||
],
|
|
||||||
"settings": {
|
|
||||||
"mdx/codeblocks": true
|
|
||||||
},
|
|
||||||
"env": {
|
|
||||||
"es2021": true,
|
|
||||||
"browser": true
|
|
||||||
},
|
|
||||||
"rules": {
|
|
||||||
"prettier/prettier": "warn",
|
|
||||||
"quotes": [
|
|
||||||
"error",
|
|
||||||
"double",
|
|
||||||
{
|
|
||||||
"avoidEscape": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"@typescript-eslint/quotes": [
|
|
||||||
"error",
|
|
||||||
"double",
|
|
||||||
{
|
|
||||||
"avoidEscape": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"@typescript-eslint/no-shadow": "off",
|
|
||||||
"no-underscore-dangle": "off",
|
|
||||||
"class-methods-use-this": "off",
|
|
||||||
"@typescript-eslint/no-unused-vars": "warn",
|
|
||||||
"@typescript-eslint/no-explicit-any": "off",
|
|
||||||
"@typescript-eslint/naming-convention": [
|
|
||||||
"warn",
|
|
||||||
{
|
|
||||||
"selector": "typeProperty",
|
|
||||||
"format": ["PascalCase", "UPPER_CASE", "camelCase", "snake_case"],
|
|
||||||
"leadingUnderscore": "allow",
|
|
||||||
"trailingUnderscore": "allow"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"import/no-extraneous-dependencies": "off"
|
|
||||||
},
|
|
||||||
"plugins": ["@typescript-eslint", "prettier"]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"extends": []
|
|
||||||
}
|
|
@ -1,2 +0,0 @@
|
|||||||
|
|
||||||
|
|
@ -1,108 +1,107 @@
|
|||||||
export type Cart = {
|
export type Cart = {
|
||||||
id: string;
|
id: string;
|
||||||
checkoutUrl: string;
|
checkoutUrl: string;
|
||||||
cost: {
|
cost: {
|
||||||
subtotalAmount: Money;
|
subtotalAmount: Money;
|
||||||
totalAmount: Money;
|
totalAmount: Money;
|
||||||
totalTaxAmount: Money;
|
totalTaxAmount: Money;
|
||||||
};
|
|
||||||
lines: CartItem[];
|
|
||||||
totalQuantity: number;
|
|
||||||
};
|
};
|
||||||
|
lines: CartItem[];
|
||||||
|
totalQuantity: number;
|
||||||
|
};
|
||||||
|
|
||||||
export type CartItem = {
|
export type CartItem = {
|
||||||
id: string;
|
id: string;
|
||||||
quantity: number;
|
quantity: number;
|
||||||
cost: {
|
cost: {
|
||||||
totalAmount: Money;
|
totalAmount: Money;
|
||||||
};
|
|
||||||
merchandise: {
|
|
||||||
id: string;
|
|
||||||
title: string;
|
|
||||||
selectedOptions: {
|
|
||||||
name: string;
|
|
||||||
value: string;
|
|
||||||
}[];
|
|
||||||
product: Product;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
merchandise: {
|
||||||
export type Collection = {
|
|
||||||
handle: string;
|
|
||||||
title: string;
|
|
||||||
description: string;
|
|
||||||
seo: SEO;
|
|
||||||
updatedAt: string;
|
|
||||||
path: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type Image = {
|
|
||||||
url: string;
|
|
||||||
altText: string;
|
|
||||||
width: number;
|
|
||||||
height: number;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type Menu = {
|
|
||||||
title: string;
|
|
||||||
path: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type Money = {
|
|
||||||
amount: string;
|
|
||||||
currencyCode: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type Page = {
|
|
||||||
id: string;
|
id: string;
|
||||||
title: string;
|
title: string;
|
||||||
handle: string;
|
|
||||||
body: string;
|
|
||||||
bodySummary: string;
|
|
||||||
seo?: SEO;
|
|
||||||
createdAt: string;
|
|
||||||
updatedAt: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type Product = {
|
|
||||||
id: string;
|
|
||||||
handle: string;
|
|
||||||
availableForSale: boolean;
|
|
||||||
title: string;
|
|
||||||
description: string;
|
|
||||||
descriptionHtml: string;
|
|
||||||
options: ProductOption[];
|
|
||||||
priceRange: {
|
|
||||||
maxVariantPrice: Money;
|
|
||||||
minVariantPrice: Money;
|
|
||||||
};
|
|
||||||
variants: ProductVariant[];
|
|
||||||
featuredImage: Image;
|
|
||||||
images: Image[];
|
|
||||||
seo: SEO;
|
|
||||||
tags: string[];
|
|
||||||
updatedAt: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type ProductOption = {
|
|
||||||
id: string;
|
|
||||||
name: string;
|
|
||||||
values: string[];
|
|
||||||
};
|
|
||||||
|
|
||||||
export type ProductVariant = {
|
|
||||||
id: string;
|
|
||||||
title: string;
|
|
||||||
availableForSale: boolean;
|
|
||||||
selectedOptions: {
|
selectedOptions: {
|
||||||
name: string;
|
name: string;
|
||||||
value: string;
|
value: string;
|
||||||
}[];
|
}[];
|
||||||
price: Money;
|
product: Product;
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
export type SEO = {
|
export type Collection = {
|
||||||
title: string;
|
handle: string;
|
||||||
description: string;
|
title: string;
|
||||||
|
description: string;
|
||||||
|
seo: SEO;
|
||||||
|
updatedAt: string;
|
||||||
|
path: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type Image = {
|
||||||
|
url: string;
|
||||||
|
altText: string;
|
||||||
|
width: number;
|
||||||
|
height: number;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type Menu = {
|
||||||
|
title: string;
|
||||||
|
path: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type Money = {
|
||||||
|
amount: string;
|
||||||
|
currencyCode: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type Page = {
|
||||||
|
id: string;
|
||||||
|
title: string;
|
||||||
|
handle: string;
|
||||||
|
body: string;
|
||||||
|
bodySummary: string;
|
||||||
|
seo?: SEO;
|
||||||
|
createdAt: string;
|
||||||
|
updatedAt: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type Product = {
|
||||||
|
id: string;
|
||||||
|
handle: string;
|
||||||
|
availableForSale: boolean;
|
||||||
|
title: string;
|
||||||
|
description: string;
|
||||||
|
descriptionHtml: string;
|
||||||
|
options: ProductOption[];
|
||||||
|
priceRange: {
|
||||||
|
maxVariantPrice: Money;
|
||||||
|
minVariantPrice: Money;
|
||||||
};
|
};
|
||||||
|
variants: ProductVariant[];
|
||||||
|
featuredImage: Image;
|
||||||
|
images: Image[];
|
||||||
|
seo: SEO;
|
||||||
|
tags: string[];
|
||||||
|
updatedAt: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type ProductOption = {
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
values: string[];
|
||||||
|
};
|
||||||
|
|
||||||
|
export type ProductVariant = {
|
||||||
|
id: string;
|
||||||
|
title: string;
|
||||||
|
availableForSale: boolean;
|
||||||
|
selectedOptions: {
|
||||||
|
name: string;
|
||||||
|
value: string;
|
||||||
|
}[];
|
||||||
|
price: Money;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type SEO = {
|
||||||
|
title: string;
|
||||||
|
description: string;
|
||||||
|
};
|
||||||
|
@ -38,9 +38,6 @@
|
|||||||
"@types/node": "20.8.9",
|
"@types/node": "20.8.9",
|
||||||
"@types/react": "18.2.33",
|
"@types/react": "18.2.33",
|
||||||
"@types/react-dom": "18.2.14",
|
"@types/react-dom": "18.2.14",
|
||||||
"@types/eslint": "^8.44.7",
|
|
||||||
"@typescript-eslint/eslint-plugin": "^6.11.0",
|
|
||||||
"@typescript-eslint/parser": "^6.11.0",
|
|
||||||
"@vercel/git-hooks": "^1.0.0",
|
"@vercel/git-hooks": "^1.0.0",
|
||||||
"autoprefixer": "^10.4.16",
|
"autoprefixer": "^10.4.16",
|
||||||
"eslint": "^8.52.0",
|
"eslint": "^8.52.0",
|
||||||
|
96
pnpm-lock.yaml
generated
96
pnpm-lock.yaml
generated
@ -40,9 +40,6 @@ devDependencies:
|
|||||||
'@tailwindcss/typography':
|
'@tailwindcss/typography':
|
||||||
specifier: ^0.5.10
|
specifier: ^0.5.10
|
||||||
version: 0.5.10(tailwindcss@3.3.5)
|
version: 0.5.10(tailwindcss@3.3.5)
|
||||||
'@types/eslint':
|
|
||||||
specifier: ^8.44.7
|
|
||||||
version: 8.44.7
|
|
||||||
'@types/node':
|
'@types/node':
|
||||||
specifier: 20.8.9
|
specifier: 20.8.9
|
||||||
version: 20.8.9
|
version: 20.8.9
|
||||||
@ -52,12 +49,6 @@ devDependencies:
|
|||||||
'@types/react-dom':
|
'@types/react-dom':
|
||||||
specifier: 18.2.14
|
specifier: 18.2.14
|
||||||
version: 18.2.14
|
version: 18.2.14
|
||||||
'@typescript-eslint/eslint-plugin':
|
|
||||||
specifier: ^6.11.0
|
|
||||||
version: 6.11.0(@typescript-eslint/parser@6.11.0)(eslint@8.52.0)(typescript@5.2.2)
|
|
||||||
'@typescript-eslint/parser':
|
|
||||||
specifier: ^6.11.0
|
|
||||||
version: 6.11.0(eslint@8.52.0)(typescript@5.2.2)
|
|
||||||
'@vercel/git-hooks':
|
'@vercel/git-hooks':
|
||||||
specifier: ^1.0.0
|
specifier: ^1.0.0
|
||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
@ -430,21 +421,6 @@ packages:
|
|||||||
tailwindcss: 3.3.5
|
tailwindcss: 3.3.5
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@types/eslint@8.44.7:
|
|
||||||
resolution: {integrity: sha512-f5ORu2hcBbKei97U73mf+l9t4zTGl74IqZ0GQk4oVea/VS8tQZYkUveSYojk+frraAVYId0V2WC9O4PTNru2FQ==}
|
|
||||||
dependencies:
|
|
||||||
'@types/estree': 1.0.5
|
|
||||||
'@types/json-schema': 7.0.15
|
|
||||||
dev: true
|
|
||||||
|
|
||||||
/@types/estree@1.0.5:
|
|
||||||
resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==}
|
|
||||||
dev: true
|
|
||||||
|
|
||||||
/@types/json-schema@7.0.15:
|
|
||||||
resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==}
|
|
||||||
dev: true
|
|
||||||
|
|
||||||
/@types/json5@0.0.29:
|
/@types/json5@0.0.29:
|
||||||
resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==}
|
resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==}
|
||||||
dev: true
|
dev: true
|
||||||
@ -481,39 +457,6 @@ packages:
|
|||||||
resolution: {integrity: sha512-s/FPdYRmZR8SjLWGMCuax7r3qCWQw9QKHzXVukAuuIJkXkDRwp+Pu5LMIVFi0Fxbav35WURicYr8u1QsoybnQw==}
|
resolution: {integrity: sha512-s/FPdYRmZR8SjLWGMCuax7r3qCWQw9QKHzXVukAuuIJkXkDRwp+Pu5LMIVFi0Fxbav35WURicYr8u1QsoybnQw==}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@types/semver@7.5.5:
|
|
||||||
resolution: {integrity: sha512-+d+WYC1BxJ6yVOgUgzK8gWvp5qF8ssV5r4nsDcZWKRWcDQLQ619tvWAxJQYGgBrO1MnLJC7a5GtiYsAoQ47dJg==}
|
|
||||||
dev: true
|
|
||||||
|
|
||||||
/@typescript-eslint/eslint-plugin@6.11.0(@typescript-eslint/parser@6.11.0)(eslint@8.52.0)(typescript@5.2.2):
|
|
||||||
resolution: {integrity: sha512-uXnpZDc4VRjY4iuypDBKzW1rz9T5YBBK0snMn8MaTSNd2kMlj50LnLBABELjJiOL5YHk7ZD8hbSpI9ubzqYI0w==}
|
|
||||||
engines: {node: ^16.0.0 || >=18.0.0}
|
|
||||||
peerDependencies:
|
|
||||||
'@typescript-eslint/parser': ^6.0.0 || ^6.0.0-alpha
|
|
||||||
eslint: ^7.0.0 || ^8.0.0
|
|
||||||
typescript: '*'
|
|
||||||
peerDependenciesMeta:
|
|
||||||
typescript:
|
|
||||||
optional: true
|
|
||||||
dependencies:
|
|
||||||
'@eslint-community/regexpp': 4.10.0
|
|
||||||
'@typescript-eslint/parser': 6.11.0(eslint@8.52.0)(typescript@5.2.2)
|
|
||||||
'@typescript-eslint/scope-manager': 6.11.0
|
|
||||||
'@typescript-eslint/type-utils': 6.11.0(eslint@8.52.0)(typescript@5.2.2)
|
|
||||||
'@typescript-eslint/utils': 6.11.0(eslint@8.52.0)(typescript@5.2.2)
|
|
||||||
'@typescript-eslint/visitor-keys': 6.11.0
|
|
||||||
debug: 4.3.4
|
|
||||||
eslint: 8.52.0
|
|
||||||
graphemer: 1.4.0
|
|
||||||
ignore: 5.2.4
|
|
||||||
natural-compare: 1.4.0
|
|
||||||
semver: 7.5.4
|
|
||||||
ts-api-utils: 1.0.3(typescript@5.2.2)
|
|
||||||
typescript: 5.2.2
|
|
||||||
transitivePeerDependencies:
|
|
||||||
- supports-color
|
|
||||||
dev: true
|
|
||||||
|
|
||||||
/@typescript-eslint/parser@6.11.0(eslint@8.52.0)(typescript@5.2.2):
|
/@typescript-eslint/parser@6.11.0(eslint@8.52.0)(typescript@5.2.2):
|
||||||
resolution: {integrity: sha512-+whEdjk+d5do5nxfxx73oanLL9ghKO3EwM9kBCkUtWMRwWuPaFv9ScuqlYfQ6pAD6ZiJhky7TZ2ZYhrMsfMxVQ==}
|
resolution: {integrity: sha512-+whEdjk+d5do5nxfxx73oanLL9ghKO3EwM9kBCkUtWMRwWuPaFv9ScuqlYfQ6pAD6ZiJhky7TZ2ZYhrMsfMxVQ==}
|
||||||
engines: {node: ^16.0.0 || >=18.0.0}
|
engines: {node: ^16.0.0 || >=18.0.0}
|
||||||
@ -543,26 +486,6 @@ packages:
|
|||||||
'@typescript-eslint/visitor-keys': 6.11.0
|
'@typescript-eslint/visitor-keys': 6.11.0
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@typescript-eslint/type-utils@6.11.0(eslint@8.52.0)(typescript@5.2.2):
|
|
||||||
resolution: {integrity: sha512-nA4IOXwZtqBjIoYrJcYxLRO+F9ri+leVGoJcMW1uqr4r1Hq7vW5cyWrA43lFbpRvQ9XgNrnfLpIkO3i1emDBIA==}
|
|
||||||
engines: {node: ^16.0.0 || >=18.0.0}
|
|
||||||
peerDependencies:
|
|
||||||
eslint: ^7.0.0 || ^8.0.0
|
|
||||||
typescript: '*'
|
|
||||||
peerDependenciesMeta:
|
|
||||||
typescript:
|
|
||||||
optional: true
|
|
||||||
dependencies:
|
|
||||||
'@typescript-eslint/typescript-estree': 6.11.0(typescript@5.2.2)
|
|
||||||
'@typescript-eslint/utils': 6.11.0(eslint@8.52.0)(typescript@5.2.2)
|
|
||||||
debug: 4.3.4
|
|
||||||
eslint: 8.52.0
|
|
||||||
ts-api-utils: 1.0.3(typescript@5.2.2)
|
|
||||||
typescript: 5.2.2
|
|
||||||
transitivePeerDependencies:
|
|
||||||
- supports-color
|
|
||||||
dev: true
|
|
||||||
|
|
||||||
/@typescript-eslint/types@6.11.0:
|
/@typescript-eslint/types@6.11.0:
|
||||||
resolution: {integrity: sha512-ZbEzuD4DwEJxwPqhv3QULlRj8KYTAnNsXxmfuUXFCxZmO6CF2gM/y+ugBSAQhrqaJL3M+oe4owdWunaHM6beqA==}
|
resolution: {integrity: sha512-ZbEzuD4DwEJxwPqhv3QULlRj8KYTAnNsXxmfuUXFCxZmO6CF2gM/y+ugBSAQhrqaJL3M+oe4owdWunaHM6beqA==}
|
||||||
engines: {node: ^16.0.0 || >=18.0.0}
|
engines: {node: ^16.0.0 || >=18.0.0}
|
||||||
@ -589,25 +512,6 @@ packages:
|
|||||||
- supports-color
|
- supports-color
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@typescript-eslint/utils@6.11.0(eslint@8.52.0)(typescript@5.2.2):
|
|
||||||
resolution: {integrity: sha512-p23ibf68fxoZy605dc0dQAEoUsoiNoP3MD9WQGiHLDuTSOuqoTsa4oAy+h3KDkTcxbbfOtUjb9h3Ta0gT4ug2g==}
|
|
||||||
engines: {node: ^16.0.0 || >=18.0.0}
|
|
||||||
peerDependencies:
|
|
||||||
eslint: ^7.0.0 || ^8.0.0
|
|
||||||
dependencies:
|
|
||||||
'@eslint-community/eslint-utils': 4.4.0(eslint@8.52.0)
|
|
||||||
'@types/json-schema': 7.0.15
|
|
||||||
'@types/semver': 7.5.5
|
|
||||||
'@typescript-eslint/scope-manager': 6.11.0
|
|
||||||
'@typescript-eslint/types': 6.11.0
|
|
||||||
'@typescript-eslint/typescript-estree': 6.11.0(typescript@5.2.2)
|
|
||||||
eslint: 8.52.0
|
|
||||||
semver: 7.5.4
|
|
||||||
transitivePeerDependencies:
|
|
||||||
- supports-color
|
|
||||||
- typescript
|
|
||||||
dev: true
|
|
||||||
|
|
||||||
/@typescript-eslint/visitor-keys@6.11.0:
|
/@typescript-eslint/visitor-keys@6.11.0:
|
||||||
resolution: {integrity: sha512-+SUN/W7WjBr05uRxPggJPSzyB8zUpaYo2hByKasWbqr3PM8AXfZt8UHdNpBS1v9SA62qnSSMF3380SwDqqprgQ==}
|
resolution: {integrity: sha512-+SUN/W7WjBr05uRxPggJPSzyB8zUpaYo2hByKasWbqr3PM8AXfZt8UHdNpBS1v9SA62qnSSMF3380SwDqqprgQ==}
|
||||||
engines: {node: ^16.0.0 || >=18.0.0}
|
engines: {node: ^16.0.0 || >=18.0.0}
|
||||||
|
9
prettier.config.js
Normal file
9
prettier.config.js
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
/** @type {import('prettier').Config} */
|
||||||
|
module.exports = {
|
||||||
|
singleQuote: false,
|
||||||
|
arrowParens: 'always',
|
||||||
|
trailingComma: 'none',
|
||||||
|
printWidth: 100,
|
||||||
|
tabWidth: 2,
|
||||||
|
plugins: ['prettier-plugin-tailwindcss']
|
||||||
|
};
|
Loading…
x
Reference in New Issue
Block a user