Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 52 additions & 17 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,83 @@
version: 2
version: 2.1

defaults: &defaults
docker:
- image: circleci/node:10
- image: cimg/node:20.11
working_directory: ~/react-native-fbads

jobs:
install-dependencies:
<<: *defaults
steps:
- checkout
- attach_workspace:
at: ~/react-native-fbads
- restore_cache:
keys:
- dependencies-{{ checksum "package.json" }}
- dependencies-
- run: |
yarn install --frozen-lockfile
- npm-deps-v1-{{ checksum "package-lock.json" }}
- npm-deps-v1-
- run:
name: Install dependencies
command: npm ci
- save_cache:
key: dependencies-{{ checksum "package.json" }}
paths: node_modules
key: npm-deps-v1-{{ checksum "package-lock.json" }}
paths:
- ~/.npm
- node_modules
- persist_to_workspace:
root: .
paths: .
paths:
- .

lint:
<<: *defaults
steps:
- attach_workspace:
at: ~/react-native-fbads
- run: |
yarn lint
flow:
- run:
name: Lint
command: npm run lint

type-check:
<<: *defaults
steps:
- attach_workspace:
at: ~/react-native-fbads
- run:
name: Type check
command: npm run type-check

test:
<<: *defaults
steps:
- attach_workspace:
at: ~/react-native-fbads
- run:
name: Unit tests
command: npm run test -- --runInBand

package-integrity:
<<: *defaults
steps:
- attach_workspace:
at: ~/react-native-fbads
- run: |
yarn flow
- run:
name: Package dry run
command: npm pack --dry-run

workflows:
version: 2
build-and-test:
jobs:
- install-dependencies
- lint:
requires:
- install-dependencies
- type-check:
requires:
- install-dependencies
- test:
requires:
- install-dependencies
- package-integrity:
requires:
- lint
- type-check
- test
10 changes: 10 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
node_modules/
dist/
build/
*.min.js
*.bundle.js
android/
ios/
example/
jest.setup.js
jest.config.js
37 changes: 37 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"parser": "@typescript-eslint/parser",
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react-hooks/recommended",
"prettier"
],
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
},
"project": "./tsconfig.json"
},
"env": {
"es2020": true,
"node": true,
"jest": true
},
"plugins": ["@typescript-eslint", "react-hooks"],
"ignorePatterns": ["dist", "build", "node_modules", "src/__tests__"],
"rules": {
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-floating-promises": "warn",
"@typescript-eslint/no-unused-vars": [
"error",
{ "argsIgnorePattern": "^_" }
],
"no-console": ["warn", { "allow": ["warn", "error"] }],
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn"
}
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ project.xcworkspace
*.iml
.idea
.gradle
android/.gradle/
local.properties

# node.js
Expand Down
9 changes: 9 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
node_modules
dist
build
*.d.ts
android/
ios/
example/node_modules
*.min.js
*.bundle.js
11 changes: 11 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5",
"printWidth": 100,
"arrowParens": "always",
"bracketSpacing": true,
"jsxSingleQuote": false,
"quoteProps": "as-needed"
}
Loading