Skip to content

Commit

Permalink
Configure ESLint and Prettier for code consistency and quality
Browse files Browse the repository at this point in the history
  • Loading branch information
shyambhongle committed Mar 10, 2024
1 parent aeffd83 commit e2336bc
Show file tree
Hide file tree
Showing 6 changed files with 8,459 additions and 1 deletion.
43 changes: 43 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
module.exports = {
root: true,
env: {
node: true,
browser: true,
es2021: true,
},
extends: [
"plugin:react/recommended",
"prettier",
"eslint:recommended",
"plugin:jest/recommended",
"plugin:@typescript-eslint/recommended"
],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint','react'],
rules: {
'react/no-unescaped-entities': 0,
'react-native/no-inline-styles': 0,
},
ignorePatterns: [
'**/__mocks__/*.ts',
'src/platform/polyfills.ts',
'src/third-party',
'ios',
'android',
'coverage',
'*.lock',
'.husky',
'patches',
'bskyweb',
'*.html',
'bskyweb',
'src/locale/locales/_build/',
'src/locale/locales/**/*.js',
],
settings: {
componentWrapperFunctions: ['observer'],
"jest": {
"version": "latest"
}
},
}
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn lint-staged
12 changes: 12 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
ios
android
src/third-party
src/app.json
public
/bskyweb/templates
/dist/
/.watchmanconfig
/app.json

web/index.html
web-build/*
8 changes: 8 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
semi: false,
arrowParens: 'avoid',
bracketSameLine: true,
bracketSpacing: false,
singleQuote: true,
trailingComma: 'all',
}
18 changes: 17 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web"
"web": "expo start --web",
"prepare": "husky",
"lint": "eslint ./src --ext .js,.jsx,.ts,.tsx"
},
"dependencies": {
"expo": "~49.0.23",
Expand All @@ -16,8 +18,22 @@
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@react-native-community/eslint-config": "^3.2.0",
"@types/react": "~18.2.14",
"@typescript-eslint/eslint-plugin": "^7.1.1",
"@typescript-eslint/parser": "^7.1.1",
"eslint": "^8.19.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jest": "^27.9.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react": "^7.34.0",
"husky": "^9.0.11",
"lint-staged": "^15.2.2",
"prettier": "^3.2.5",
"typescript": "^5.1.3"
},
"lint-staged": {
"*{.js,.jsx,.ts,.tsx}": "yarn eslint --fix"
},
"private": true
}
Loading

0 comments on commit e2336bc

Please sign in to comment.