diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index ba611ba6..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,17 +0,0 @@ -version: 2.1 -orbs: - node: circleci/node@1.1.6 -jobs: - build-and-test: - executor: - name: node/default - steps: - - checkout - - node/with-cache: - steps: - - run: npm install --legacy-peer-deps - - run: npm test -workflows: - build-and-test: - jobs: - - build-and-test diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index ef152d9e..00000000 --- a/.eslintignore +++ /dev/null @@ -1,47 +0,0 @@ -.DS_Store - -# Logs -logs -*.log - -# Runtime data -pids -*.pid -*.seed - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage - -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (http://nodejs.org/api/addons.html) -build/Release - -# Dependency directory -# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git -/node_modules - -# Xcode -*.xcuserstate -examples/ios/swiper.xcodeproj/project.xcworkspace/ -examples/ios/swiper.xcodeproj/xcuserdata - -# IntelliJ -.idea/ - -# VSCode -.vscode -jsconfig.json -.expo/ -lib/ -web-build/ - -./eslintrc.js -/scripts/ \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 2cb22d6e..00000000 --- a/.eslintrc.js +++ /dev/null @@ -1,276 +0,0 @@ -/* -👋 Hi! This file was autogenerated by tslint-to-eslint-config. -https://github.com/typescript-eslint/tslint-to-eslint-config - -It represents the closest reasonable ESLint configuration to this -project's original TSLint configuration. - -We recommend eventually switching this configuration to extend from -the recommended rulesets in typescript-eslint. -https://github.com/typescript-eslint/tslint-to-eslint-config/blob/master/docs/FAQs.md - -Happy linting! 💖 -*/ -module.exports = { - env: { - browser: true, - es6: true, - }, - extends: [ - 'plugin:@typescript-eslint/recommended', - 'plugin:@typescript-eslint/recommended-requiring-type-checking', - 'prettier', - ], - parser: '@typescript-eslint/parser', - parserOptions: { - project: true, - tsconfigRootDir: __dirname, - sourceType: 'module', - }, - plugins: [ - 'eslint-plugin-import', - 'eslint-plugin-jsdoc', - 'eslint-plugin-prefer-arrow', - 'eslint-plugin-react', - '@typescript-eslint', - ], - root: true, - ignorePatterns: ['.eslintrc.js', '*.test.tsx', '*.config.js'], - rules: { - '@typescript-eslint/unbound-method': 'off', - '@typescript-eslint/no-unsafe-assignment': 'off', - '@typescript-eslint/adjacent-overload-signatures': 'error', - '@typescript-eslint/array-type': [ - 'error', - { - default: 'array', - }, - ], - '@typescript-eslint/ban-types': [ - 'error', - { - types: { - Object: { - message: 'Avoid using the `Object` type. Did you mean `object`?', - }, - Function: { - message: - 'Avoid using the `Function` type. Prefer a specific function type, like `() => void`.', - }, - Boolean: { - message: 'Avoid using the `Boolean` type. Did you mean `boolean`?', - }, - Number: { - message: 'Avoid using the `Number` type. Did you mean `number`?', - }, - String: { - message: 'Avoid using the `String` type. Did you mean `string`?', - }, - Symbol: { - message: 'Avoid using the `Symbol` type. Did you mean `symbol`?', - }, - }, - }, - ], - '@typescript-eslint/consistent-type-assertions': 'error', - '@typescript-eslint/dot-notation': 'off', - '@typescript-eslint/explicit-function-return-type': 'off', - '@typescript-eslint/explicit-member-accessibility': [ - 'off', - { - accessibility: 'explicit', - }, - ], - '@typescript-eslint/explicit-module-boundary-types': 'off', - '@typescript-eslint/indent': 'off', - '@typescript-eslint/member-delimiter-style': [ - 'off', - { - multiline: { - delimiter: 'none', - requireLast: true, - }, - singleline: { - delimiter: 'semi', - requireLast: false, - }, - }, - ], - '@typescript-eslint/naming-convention': [ - 'off', - { - selector: 'variable', - format: ['camelCase', 'UPPER_CASE'], - leadingUnderscore: 'forbid', - trailingUnderscore: 'forbid', - }, - ], - '@typescript-eslint/no-empty-function': 'off', - '@typescript-eslint/no-empty-interface': 'error', - '@typescript-eslint/no-explicit-any': 'off', - '@typescript-eslint/no-misused-new': 'error', - '@typescript-eslint/no-namespace': 'error', - '@typescript-eslint/no-parameter-properties': 'off', - '@typescript-eslint/no-shadow': [ - 'off', - { - hoist: 'all', - }, - ], - '@typescript-eslint/no-unused-expressions': 'error', - '@typescript-eslint/no-use-before-define': 'off', - '@typescript-eslint/no-var-requires': 'off', - '@typescript-eslint/prefer-for-of': 'error', - '@typescript-eslint/prefer-function-type': 'error', - '@typescript-eslint/prefer-namespace-keyword': 'error', - '@typescript-eslint/quotes': 'off', - '@typescript-eslint/semi': ['off', null], - '@typescript-eslint/triple-slash-reference': [ - 'error', - { - path: 'always', - types: 'prefer-import', - lib: 'always', - }, - ], - '@typescript-eslint/type-annotation-spacing': 'off', - '@typescript-eslint/typedef': 'off', - '@typescript-eslint/unified-signatures': 'error', - 'arrow-parens': ['off', 'always'], - 'brace-style': ['off', 'off'], - 'comma-dangle': 'off', - complexity: 'off', - 'constructor-super': 'error', - 'dot-notation': 'off', - 'eol-last': 'off', - eqeqeq: ['error', 'smart'], - 'guard-for-in': 'error', - 'id-denylist': 'off', - 'id-match': 'off', - 'import/order': [ - 'off', - { - alphabetize: { - caseInsensitive: true, - order: 'asc', - }, - 'newlines-between': 'ignore', - groups: [ - ['builtin', 'external', 'internal', 'unknown', 'object', 'type'], - 'parent', - ['sibling', 'index'], - ], - distinctGroup: false, - pathGroupsExcludedImportTypes: [], - pathGroups: [ - { - pattern: './', - patternOptions: { - nocomment: true, - dot: true, - }, - group: 'sibling', - position: 'before', - }, - { - pattern: '.', - patternOptions: { - nocomment: true, - dot: true, - }, - group: 'sibling', - position: 'before', - }, - { - pattern: '..', - patternOptions: { - nocomment: true, - dot: true, - }, - group: 'parent', - position: 'before', - }, - { - pattern: '../', - patternOptions: { - nocomment: true, - dot: true, - }, - group: 'parent', - position: 'before', - }, - ], - }, - ], - indent: 'off', - 'jsdoc/check-alignment': 'error', - 'jsdoc/check-indentation': 'error', - 'linebreak-style': 'off', - 'max-classes-per-file': ['error', 1], - 'max-len': 'off', - 'new-parens': 'off', - 'newline-per-chained-call': 'off', - 'no-bitwise': 'error', - 'no-caller': 'error', - 'no-cond-assign': 'error', - 'no-console': 'off', - 'no-debugger': 'error', - 'no-empty': 'off', - 'no-empty-function': 'off', - 'no-eval': 'error', - 'no-extra-semi': 'off', - 'no-fallthrough': 'off', - 'no-invalid-this': 'off', - 'no-irregular-whitespace': 'off', - 'no-multiple-empty-lines': 'off', - 'no-new-wrappers': 'error', - 'no-shadow': 'off', - 'no-throw-literal': 'error', - 'no-trailing-spaces': 'off', - 'no-undef-init': 'error', - 'no-underscore-dangle': 'off', - 'no-unsafe-finally': 'error', - 'no-unused-expressions': 'off', - 'no-unused-labels': 'error', - 'no-use-before-define': 'off', - 'no-var': 'error', - 'object-shorthand': 'error', - 'one-var': ['off', 'never'], - 'padded-blocks': [ - 'off', - { - blocks: 'never', - }, - { - allowSingleLineBlocks: true, - }, - ], - 'prefer-arrow/prefer-arrow-functions': 'error', - 'prefer-const': 'error', - 'quote-props': 'off', - quotes: 'off', - radix: 'error', - 'react/jsx-curly-spacing': 'off', - 'react/jsx-equals-spacing': 'off', - 'react/jsx-tag-spacing': [ - 'off', - { - afterOpening: 'allow', - closingSlash: 'allow', - }, - ], - 'react/jsx-wrap-multilines': 'off', - semi: 'off', - 'space-before-function-paren': 'off', - 'space-in-parens': ['off', 'never'], - 'spaced-comment': [ - 'error', - 'always', - { - markers: ['/'], - }, - ], - 'use-isnan': 'error', - 'valid-typeof': 'off', - }, -} diff --git a/.expo-shared/assets.json b/.expo-shared/assets.json deleted file mode 100644 index c776cec1..00000000 --- a/.expo-shared/assets.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "9440367d86e003d6e8c2fe9c722a8a5ebfe940e60ab2abebbe24f30fb2ed410b": true, - "8451634c66d23221fcf5552d4cbe8548c79bfc99f3bd91fbc691fd2c71045726": true, - "7adc6cdde1172c646f8dda7fcb1186d148e59e6d2a40774bd7e03281a653f19c": true, - "89ed26367cdb9b771858e026f2eb95bfdb90e5ae943e716575327ec325f39c44": true, - "7f3e4ab2a3a7f88f5b19dde9b9f4853e92838b72e042f583db153175fcd1fe71": true, - "f95d3f46cda7f19f03e865e399ca5c3e92beddece0713bfde024e38b5cc1cef6": true, - "c8d42c7f747168b8b8ab827d311068b21d455af0e66cbb89cd2ee28bb64383e4": true, - "463b438602e9a83ff11b7fda9433386c564ef3789c9a017375a4dbc37cad8c5d": true, - "3347e2a09aed534f770fc26a84f78fc255a71ba8992534111bc77df1b063c23d": true, - "e04c5e91fc6dc1d9f505834b5c05b2655aa1e5a5e32ed53a2200ba2a42283c4e": true, - "1dc05ba7da4e73a5a31dc50407254a7ce6429980ffebe2c64208fd3f35d60192": true, - "59aab44f170793d969cfd764c224999d9e77c7eb17e9adf3e299b6cb5f7d0110": true, - "efc8b9f34431f1bea1f5889373dbb67c8f798df4104d73e46401d204cad9e660": true, - "0644f0750efdcb2212c2492d91e6b7088b05406e09a0fd9d9427efef8c542cac": true, - "e06c14a56ff8f3b8b82c95ab25d68e96f90f40216d80ca5a396afb6aadba985c": true, - "50b41d4ef9a47247f1f7c5ed10e9b1584bd2dfb7b4881b9ed6a8e0e4e5ce25e9": true, - "7263abf0c966a736f97959b4ed1d06b311003b85d6e0d1ac83c61f00b2cf06c1": true, - "cb0ab9f97c6f6fbf3ce788303af39d27ba32e4e42ddb4e6371fb9c0b1722ed6f": true, - "462ec7f66a06dd61c80a392b89750eb089d34ec64d1e340db7ee148da0e966e2": true -} \ No newline at end of file diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index fadfab59..00000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,12 +0,0 @@ -# These are supported funding model platforms - -github: xcarpentier -patreon: # Replace with a single Patreon username -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username -custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/.github/stale.yml b/.github/stale.yml deleted file mode 100644 index 9d23fb5a..00000000 --- a/.github/stale.yml +++ /dev/null @@ -1,17 +0,0 @@ -# Number of days of inactivity before an issue becomes stale -daysUntilStale: 30 -# Number of days of inactivity before a stale issue is closed -daysUntilClose: 7 -# Issues with these labels will never be considered stale -exemptLabels: - - pinned - - security -# Label to use when marking an issue as stale -staleLabel: wontfix -# Comment to post when marking an issue as stale. Set to `false` to disable -markComment: > - This issue has been automatically marked as stale because it has not had - recent activity. It will be closed if no further activity occurs. Thank you - for your contributions. -# Comment to post when closing a stale issue. Set to `false` to disable -closeComment: false diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 1baf9560..00000000 --- a/.gitignore +++ /dev/null @@ -1,44 +0,0 @@ -.DS_Store - -# Logs -logs -*.log - -# Runtime data -pids -*.pid -*.seed - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage - -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (http://nodejs.org/api/addons.html) -build/Release - -# Dependency directory -# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git -/node_modules - -# Xcode -*.xcuserstate -examples/ios/swiper.xcodeproj/project.xcworkspace/ -examples/ios/swiper.xcodeproj/xcuserdata - -# IntelliJ -.idea/ - -# VSCode -.vscode -jsconfig.json -.expo/ -lib/ -web-build/ \ No newline at end of file diff --git a/.npmignore b/.npmignore deleted file mode 100644 index d97762cc..00000000 --- a/.npmignore +++ /dev/null @@ -1,38 +0,0 @@ -.DS_Store -logs -*.log -pids -*.pid -*.seed -lib-cov -coverage -.lock-wscript -build/Release -node_modules -res -examples -example -exp-example -scripts -babel.config.js -metro.config.js -scripts/ -src/ -data/ -App.tsx -tsconfig.json -tslint.json -.editorconfig -app.json -CODE_OF_CONDUCT.md -typings.d.ts -__tests__/ -.expo/ -.github/ -.vscode/ -web-build/ -lib/assets/data/countries-image.json -.prettierrc -lib/assets/images/icon.png -lib/assets/images/splash.png -.expo-shared/assets.json \ No newline at end of file diff --git a/.npmrc b/.npmrc deleted file mode 100644 index 9cf94950..00000000 --- a/.npmrc +++ /dev/null @@ -1 +0,0 @@ -package-lock=false \ No newline at end of file diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index 028ecd95..00000000 --- a/.prettierrc +++ /dev/null @@ -1,11 +0,0 @@ -{ - "trailingComma": "all", - "semi": false, - "singleQuote": true, - "tabWidth": 2, - "useTabs": false, - "bracketSpacing": true, - "jsxBracketSameLine": false, - "jsxSingleQuote": true, - "printWidth": 80 -} diff --git a/App.tsx b/App.tsx deleted file mode 100644 index 550e4e74..00000000 --- a/App.tsx +++ /dev/null @@ -1,189 +0,0 @@ -import React, { useState } from 'react' -import { - Text, - StyleSheet, - PixelRatio, - Switch, - Button, - ScrollView, -} from 'react-native' -import CountryPicker, { CountryModalProvider } from './src/' -import { CountryCode, Country } from './src/types' -import { Row } from './src/Row' -import { DARK_THEME } from './src/CountryTheme' - -const styles = StyleSheet.create({ - container: { - paddingVertical: 10, - justifyContent: 'center', - alignItems: 'center', - }, - welcome: { - fontSize: 17, - textAlign: 'center', - margin: 5, - }, - instructions: { - fontSize: 10, - textAlign: 'center', - color: '#888', - marginBottom: 0, - }, - data: { - maxWidth: 250, - padding: 10, - marginTop: 7, - backgroundColor: '#ddd', - borderColor: '#888', - borderWidth: 1 / PixelRatio.get(), - color: '#777', - }, -}) - -interface OptionProps { - title: string - value: boolean - onValueChange(value: boolean): void -} -const Option = ({ value, onValueChange, title }: OptionProps) => ( - - {title} - - -) - -const App = () => { - const [countryCode, setCountryCode] = useState('US') - const [country, setCountry] = useState() - const [withCountryNameButton, setWithCountryNameButton] = - useState(false) - const [withCurrencyButton, setWithCurrencyButton] = useState(false) - const [withFlagButton, setWithFlagButton] = useState(true) - const [withCallingCodeButton, setWithCallingCodeButton] = - useState(false) - const [withFlag, setWithFlag] = useState(true) - const [withEmoji, setWithEmoji] = useState(true) - const [withFilter, setWithFilter] = useState(true) - const [withAlphaFilter, setWithAlphaFilter] = useState(false) - const [withCallingCode, setWithCallingCode] = useState(false) - const [withCurrency, setWithCurrency] = useState(false) - const [withModal, setWithModal] = useState(true) - const [visible, setVisible] = useState(false) - const [dark, setDark] = useState(false) - const [allowFontScaling, setFontScaling] = useState(true) - const [disableNativeModal, setDisableNativeModal] = useState(false) - const onSelect = (country: Country) => { - setCountryCode(country.cca2) - setCountry(country) - } - const switchVisible = () => setVisible(!visible) - - return ( - - - Welcome to Country Picker ! -