diff --git a/.eslintrc.js b/.eslintrc.js index e654650..d2b91fc 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,9 +1,4 @@ module.exports = { root: true, extends: 'react-app', - rules: { - 'prettier/prettier': 0, - '@typescript-eslint/no-unused-vars': 0, - 'no-trailing-spaces': 0, - }, }; diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..adb9cf4 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,49 @@ +name: Code Linting, Type Checking and Tests + +on: + push: + branches: + - develop + paths: + - '.github/workflows/lint.yml' + - '**.js' + - '**.json' + - '**.ts' + - '**.tsx' + pull_request: + branches: + - develop + paths: + - '.github/workflows/lint.yml' + - '**.js' + - '**.json' + - '**.ts' + - '**.tsx' + types: + - opened + - reopened + - synchronize + +concurrency: + group: lint-${{ github.ref }} + cancel-in-progress: true + +jobs: + lint: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Node + uses: actions/setup-node@v3 + with: + cache: 'yarn' + - name: Install dependencies + run: yarn + - name: Run ESLint + run: yarn lint + - name: Run TypeScript Compiler (TSC) + run: yarn type-check + - name: Run Tests + run: yarn test diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..8fdd954 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +22 \ No newline at end of file diff --git a/package.json b/package.json index 28271e6..d5109c4 100644 --- a/package.json +++ b/package.json @@ -35,8 +35,10 @@ } }, "scripts": { + "lint": "eslint . --ext .ts,.tsx", + "prepare": "rm -rf ./dist/* && tsc -p tsconfig.build.json", "test": "vitest", - "prepare": "rm -rf ./dist/* && tsc -p tsconfig.build.json" + "type-check": "tsc" }, "devDependencies": { "@babel/plugin-proposal-private-property-in-object": "7.21.11", diff --git a/src/types/react-native-globals.d.ts b/src/types/react-native-globals.d.ts index 02dd7f1..b867229 100644 --- a/src/types/react-native-globals.d.ts +++ b/src/types/react-native-globals.d.ts @@ -1 +1 @@ -const __DEV__: boolean; +declare const __DEV__: boolean;