diff --git a/.eslintrc.json b/.eslintrc.json index cd27de37..9591a317 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -8,8 +8,7 @@ "plugin:react/recommended", "plugin:react-hooks/recommended", "plugin:@typescript-eslint/eslint-recommended", - "plugin:@typescript-eslint/recommended", - "plugin:@typescript-eslint/recommended-requiring-type-checking" + "plugin:@typescript-eslint/recommended" ], "parser": "@typescript-eslint/parser", "settings": { @@ -26,7 +25,7 @@ "jsx": true } }, - "plugins": ["react", "@typescript-eslint", "react-hooks"], + "plugins": ["react", "@typescript-eslint", "react-hooks", "prettier"], "rules": { "@typescript-eslint/semi": ["error", "always"], "@typescript-eslint/space-before-function-paren": 0, diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b8943a69..d50fc1aa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,10 @@ jobs: with: node-version: 18 - name: Install dependencies - run: npm ci + run: npm ci --ignore-scripts + - name: Rebuild & Prepare dependencies + run: npm rebuild && npm run prepare --if-present + - name: Run lint + run: npm run lint - name: Compile run: npm run tsc diff --git a/.prettierrc.json b/.prettierrc.json index 23581c70..7962720a 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -4,7 +4,7 @@ "printWidth": 100, "tabWidth": 4, "trailingComma": "all", - "endOfLine": "crlf", + "endOfLine": "lf", "overrides": [ { "files": "*.json", diff --git a/package-lock.json b/package-lock.json index a995ca11..b2e715ed 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@zerogachis/smartway-react-native-ui", - "version": "0.3.4", + "version": "0.4.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@zerogachis/smartway-react-native-ui", - "version": "0.3.4", + "version": "0.4.0", "devDependencies": { "@types/jest": "^28.1.2", "@types/react": "~17.0.21", @@ -16,6 +16,7 @@ "eslint": "^8.34.0", "eslint-config-prettier": "^8.6.0", "eslint-config-standard-with-typescript": "19.0.1", + "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-react": "^7.32.2", "eslint-plugin-react-hooks": "^4.6.0", "jest": "^28.1.1", @@ -7326,6 +7327,27 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/eslint-plugin-prettier": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz", + "integrity": "sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==", + "dev": true, + "dependencies": { + "prettier-linter-helpers": "^1.0.0" + }, + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "eslint": ">=7.28.0", + "prettier": ">=2.0.0" + }, + "peerDependenciesMeta": { + "eslint-config-prettier": { + "optional": true + } + } + }, "node_modules/eslint-plugin-promise": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-6.1.1.tgz", @@ -7900,6 +7922,12 @@ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, + "node_modules/fast-diff": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", + "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", + "dev": true + }, "node_modules/fast-glob": { "version": "3.2.12", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", @@ -13762,6 +13790,18 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, + "node_modules/prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "dev": true, + "dependencies": { + "fast-diff": "^1.1.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/pretty-format": { "version": "28.1.3", "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-28.1.3.tgz", @@ -21634,6 +21674,15 @@ } } }, + "eslint-plugin-prettier": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz", + "integrity": "sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==", + "dev": true, + "requires": { + "prettier-linter-helpers": "^1.0.0" + } + }, "eslint-plugin-promise": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-6.1.1.tgz", @@ -21969,6 +22018,12 @@ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, + "fast-diff": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", + "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", + "dev": true + }, "fast-glob": { "version": "3.2.12", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", @@ -26359,6 +26414,15 @@ "integrity": "sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw==", "dev": true }, + "prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "dev": true, + "requires": { + "fast-diff": "^1.1.2" + } + }, "pretty-format": { "version": "28.1.3", "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-28.1.3.tgz", diff --git a/package.json b/package.json index 494abd55..ac9521be 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,8 @@ ], "scripts": { "test": "jest", - "tsc": "tsc --project tsconfig.build.json" + "tsc": "tsc --project tsconfig.build.json", + "lint": "prettier --check ." }, "keywords": [ "react-native", @@ -51,6 +52,7 @@ "eslint": "^8.34.0", "eslint-config-prettier": "^8.6.0", "eslint-config-standard-with-typescript": "19.0.1", + "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-react": "^7.32.2", "eslint-plugin-react-hooks": "^4.6.0", "jest": "^28.1.1", diff --git a/tsconfig.json b/tsconfig.json index e4697c31..c0550de8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -26,5 +26,6 @@ "skipLibCheck": true, "strict": true, "target": "esnext" - } + }, + "include": ["src", "example"] }