diff --git a/.eslintrc.js b/.eslintrc.js index 689bc71..7636922 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,10 +1,11 @@ module.exports = { root: true, extends: ['@react-native', 'prettier'], - plugins: ['unused-imports'], + plugins: ['unused-imports', 'prettier'], rules: { 'react-hooks/exhaustive-deps': 'off', 'react-native/no-inline-styles': 'off', + 'no-unused-vars': 'off', 'unused-imports/no-unused-imports': 'error', 'prettier/prettier': [ 'error', diff --git a/.husky/pre-commit b/.husky/pre-commit index d0a7784..c58e8ce 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1 +1 @@ -npx lint-staged \ No newline at end of file +yarn lint \ No newline at end of file diff --git a/.lintstagedrc.json b/.lintstagedrc.json new file mode 100644 index 0000000..d6470b9 --- /dev/null +++ b/.lintstagedrc.json @@ -0,0 +1,4 @@ +{ + "*.{js, jsx,ts,tsx}": ["prettier --write", "eslint --fix"], + "*.{json,html}": ["prettier --write --ignore-unknown"] +} diff --git a/package.json b/package.json index 35d18aa..d956dd0 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "packages/*" ], "scripts": { - "lint": "eslint \"**/*.{js,ts,tsx}\"", + "lint": "lint-staged", "release": "yarn build && npm run release --workspaces && release-it", "snackbar-example": "expo start packages/snackbar/example -w", "build": "yarn workspaces foreach run build", @@ -28,7 +28,7 @@ "eslint": "^8.51.0", "eslint-config-prettier": "^9.0.0", "eslint-plugin-prettier": "^5.0.1", - "eslint-plugin-unused-imports": "2.0.0", + "eslint-plugin-unused-imports": "^3.2.0", "expo": "~49.0.15", "expo-status-bar": "~1.6.0", "husky": "^9.1.5", diff --git a/packages/snackbar/.lintstagedjs.json b/packages/snackbar/.lintstagedrc.json similarity index 100% rename from packages/snackbar/.lintstagedjs.json rename to packages/snackbar/.lintstagedrc.json diff --git a/yarn.lock b/yarn.lock index 0d8a7bd..733e44c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7639,18 +7639,18 @@ __metadata: languageName: node linkType: hard -"eslint-plugin-unused-imports@npm:2.0.0": - version: 2.0.0 - resolution: "eslint-plugin-unused-imports@npm:2.0.0" +"eslint-plugin-unused-imports@npm:^3.2.0": + version: 3.2.0 + resolution: "eslint-plugin-unused-imports@npm:3.2.0" dependencies: eslint-rule-composer: ^0.3.0 peerDependencies: - "@typescript-eslint/eslint-plugin": ^5.0.0 - eslint: ^8.0.0 + "@typescript-eslint/eslint-plugin": 6 - 7 + eslint: 8 peerDependenciesMeta: "@typescript-eslint/eslint-plugin": optional: true - checksum: 8aa1e03e75da2a62a354065e0cb8fe370118c6f8d9720a32fe8c1da937de6adb81a4fed7d0d391d115ac9453b49029fb19f970d180a2cf3dba451fd4c20f0dc4 + checksum: e85ae4f3af489294ef5e0969ab904fa87f9fa7c959ca0804f30845438db4aeb0428ddad7ab06a70608e93121626799977241b442fdf126a4d0667be57390c3d6 languageName: node linkType: hard @@ -8460,7 +8460,7 @@ __metadata: eslint: ^8.51.0 eslint-config-prettier: ^9.0.0 eslint-plugin-prettier: ^5.0.1 - eslint-plugin-unused-imports: 2.0.0 + eslint-plugin-unused-imports: ^3.2.0 expo: ~49.0.15 expo-status-bar: ~1.6.0 husky: ^9.1.5