From a49a29f8d66f61d378855e6117715dfd9dd972b6 Mon Sep 17 00:00:00 2001 From: David Peleg Date: Wed, 26 Feb 2020 19:15:54 +0200 Subject: [PATCH] Add linter also to GitHub actions --- .eslintrc.json | 25 +++++++++++++++++++++++++ .github/workflows/expo.yml | 8 ++++++++ package.json | 5 ++++- 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 .eslintrc.json diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..e1b3dc4 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,25 @@ +{ + "plugins": [ + "react-native" + ], + "extends": [ + "eslint:recommended", + "plugin:react-native/all" + ], + "parser": "babel-eslint", + "env": { + "react-native/react-native": true + }, + "parserOptions": { + "ecmaFeatures": { + "jsx": true + } + }, + "rules":{ + "react-native/no-unused-styles": 2, + "react-native/split-platform-components": 2, + "react-native/no-inline-styles": 2, + "react-native/no-color-literals": 2, + "react-native/no-raw-text": 2 + } +} diff --git a/.github/workflows/expo.yml b/.github/workflows/expo.yml index a16fa92..7e7d1f9 100644 --- a/.github/workflows/expo.yml +++ b/.github/workflows/expo.yml @@ -2,6 +2,14 @@ name: Expo Build on: [push,pull_request] jobs: + eslint: + name: Linter + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: stefanoeb/eslint-action@1.0.2 + with: + files: src/ build: name: Build runs-on: ubuntu-latest diff --git a/package.json b/package.json index 010ec06..9d33f1e 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,9 @@ "version": "1.1.2", "private": true, "devDependencies": { + "babel-eslint": "^10.1.0", + "eslint": "^6.8.0", + "eslint-plugin-react-native": "^3.8.1", "jest-expo": "^35.0.0", "react-test-renderer": "16.0.0", "standard": "^14.3.1" @@ -47,4 +50,4 @@ "redux-thunk": "^2.3.0", "remote-redux-devtools": "^0.5.16" } -} \ No newline at end of file +}