diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..7706513 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,34 @@ +const path = require('path'); + +const modulePath = 'modules/@shopify/checkout-sheet-kit'; +const moduleAbsolutePath = path.join(__dirname, modulePath); + +module.exports = { + root: true, + parser: '@typescript-eslint/parser', + extends: '@react-native', + rules: { + '@typescript-eslint/consistent-type-imports': 'error', + 'no-console': 'error', + }, + overrides: [ + // Sample app files + { + files: ['sample/**/*.ts', 'sample/**/*.tsx'], + rules: { + 'no-console': 'off', + '@typescript-eslint/no-shadow': 'off', + }, + }, + // Module files + { + files: [ + path.join(modulePath, 'src/**/*.ts'), + path.join(modulePath, 'src/**/*.tsx'), + ], + parserOptions: { + project: path.join(moduleAbsolutePath, 'tsconfig.build.json'), + }, + }, + ], +}; diff --git a/modules/@shopify/checkout-sheet-kit/.eslintignore b/modules/@shopify/checkout-sheet-kit/.eslintignore new file mode 100644 index 0000000..a65b417 --- /dev/null +++ b/modules/@shopify/checkout-sheet-kit/.eslintignore @@ -0,0 +1 @@ +lib diff --git a/modules/@shopify/checkout-sheet-kit/package.json b/modules/@shopify/checkout-sheet-kit/package.json index 2537d3d..540daef 100644 --- a/modules/@shopify/checkout-sheet-kit/package.json +++ b/modules/@shopify/checkout-sheet-kit/package.json @@ -1,7 +1,7 @@ { "name": "@shopify/checkout-sheet-kit", "license": "MIT", - "version": "3.2.0", + "version": "3.1.0", "main": "lib/commonjs/index.js", "types": "src/index.ts", "source": "src/index.ts", @@ -16,7 +16,7 @@ "clean": "rm -rf lib", "build": "bob build", "lint:swift": "./../../../sample/ios/Pods/SwiftLint/swiftlint --strict --quiet ios", - "lint": "yarn typecheck && eslint src", + "lint": "yarn typecheck && eslint .", "typecheck": "tsc --noEmit" }, "files": [ @@ -49,7 +49,7 @@ }, "devDependencies": { "react-native-builder-bob": "^0.23.1", - "typescript": "^5.6.3" + "typescript": "5.5.2" }, "react-native-builder-bob": { "source": "src", diff --git a/package.json b/package.json index 6eb8ab6..df5234f 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "react-test-renderer": "18.3.1", "ts-jest": "^29.2.5", "turbo": "^1.10.16", - "typescript": "^5.6.3" + "typescript": "5.5.2" }, "engines": { "node": ">=18" @@ -74,14 +74,5 @@ "shopify", "checkout" ], - "eslintConfig": { - "root": true, - "extends": "@react-native", - "rules": { - "@typescript-eslint/no-shadow": "off", - "@typescript-eslint/consistent-type-imports": "error", - "no-console": "error" - } - }, "packageManager": "yarn@4.4.1" } diff --git a/sample/package.json b/sample/package.json index 0bea3f5..34f6d01 100644 --- a/sample/package.json +++ b/sample/package.json @@ -55,10 +55,5 @@ }, "engines": { "node": ">= 18" - }, - "eslintConfig": { - "rules": { - "no-console": "off" - } } } diff --git a/sample/src/screens/CartScreen.tsx b/sample/src/screens/CartScreen.tsx index 25e55a6..35fe896 100644 --- a/sample/src/screens/CartScreen.tsx +++ b/sample/src/screens/CartScreen.tsx @@ -38,7 +38,6 @@ import Icon from 'react-native-vector-icons/Entypo'; import {useShopifyCheckoutSheet} from '@shopify/checkout-sheet-kit'; import useShopify from '../hooks/useShopify'; -// eslint-disable-next-line @typescript-eslint/consistent-type-imports import type {CartLineItem, CartItem} from '../../@types'; import type {Colors} from '../context/Theme'; import {useTheme} from '../context/Theme'; diff --git a/yarn.lock b/yarn.lock index 2c9f70b..c93d304 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4445,7 +4445,7 @@ __metadata: resolution: "@shopify/checkout-sheet-kit@workspace:modules/@shopify/checkout-sheet-kit" dependencies: react-native-builder-bob: "npm:^0.23.1" - typescript: "npm:^5.6.3" + typescript: "npm:5.5.2" peerDependencies: react: "*" react-native: "*" @@ -5759,7 +5759,7 @@ __metadata: react-test-renderer: "npm:18.3.1" ts-jest: "npm:^29.2.5" turbo: "npm:^1.10.16" - typescript: "npm:^5.6.3" + typescript: "npm:5.5.2" languageName: unknown linkType: soft @@ -12374,23 +12374,23 @@ __metadata: languageName: node linkType: hard -"typescript@npm:^5.6.3": - version: 5.6.3 - resolution: "typescript@npm:5.6.3" +"typescript@npm:5.5.2": + version: 5.5.2 + resolution: "typescript@npm:5.5.2" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 10c0/44f61d3fb15c35359bc60399cb8127c30bae554cd555b8e2b46d68fa79d680354b83320ad419ff1b81a0bdf324197b29affe6cc28988cd6a74d4ac60c94f9799 + checksum: 10c0/8ca39b27b5f9bd7f32db795045933ab5247897660627251e8254180b792a395bf061ea7231947d5d7ffa5cb4cc771970fd4ef543275f9b559f08c9325cccfce3 languageName: node linkType: hard -"typescript@patch:typescript@npm%3A^5.6.3#optional!builtin": - version: 5.6.3 - resolution: "typescript@patch:typescript@npm%3A5.6.3#optional!builtin::version=5.6.3&hash=8c6c40" +"typescript@patch:typescript@npm%3A5.5.2#optional!builtin": + version: 5.5.2 + resolution: "typescript@patch:typescript@npm%3A5.5.2#optional!builtin::version=5.5.2&hash=379a07" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 10c0/7c9d2e07c81226d60435939618c91ec2ff0b75fbfa106eec3430f0fcf93a584bc6c73176676f532d78c3594fe28a54b36eb40b3d75593071a7ec91301533ace7 + checksum: 10c0/a7b7ede75dc7fc32a76d0d0af6b91f5fbd8620890d84c906f663d8783bf3de6d7bd50f0430b8bb55eac88a38934af847ff709e7156e5138b95ae94cbd5f73e5b languageName: node linkType: hard