Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
janisievins committed Apr 8, 2024
0 parents commit 9b222b0
Show file tree
Hide file tree
Showing 4 changed files with 2,586 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
84 changes: 84 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
const OFF = 0
const WARNING = 1
const ERROR = 2

module.exports = {
env: {
jest: true,
},
root: true,
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint", "import"],
extends: [
"prettier",
"standard",
"@react-native",
"eslint:recommended",
"eslint-config-prettier",
"plugin:react/recommended",
"plugin:prettier/recommended",
"plugin:@typescript-eslint/recommended",
],
rules: {
"no-shadow": OFF,
"no-duplicate-imports": ERROR,
"react/jsx-boolean-value": ERROR,
"jest/no-disabled-tests": WARNING,
"@typescript-eslint/no-shadow": ERROR,
"react-native/no-unused-styles": ERROR,
"react/jsx-curly-brace-presence": ERROR,
"react/jsx-max-depth": [ERROR, { max: 5 }],
"react/jsx-pascal-case": [ERROR, { allowAllCaps: false }],
"react/jsx-no-duplicate-props": [ERROR, { ignoreCase: true }],
"react/jsx-one-expression-per-line": [ERROR, { allow: "single-child" }],
"react/jsx-filename-extension": [ERROR, { extensions: [".js", ".tsx"] }],
"react/jsx-handler-names": [
ERROR,
{
eventHandlerPrefix: "on",
eventHandlerPropPrefix: "on",
},
],
"import/order": [
ERROR,
{
groups: ["builtin", "external", "internal"],
pathGroups: [
{
group: "external",
position: "before",
pattern: "@(react|react-native)",
},
],
pathGroupsExcludedImportTypes: ["internal"],
"newlines-between": "always",
alphabetize: {
order: "asc",
caseInsensitive: true,
},
},
],
"react/jsx-sort-props": [
ERROR,
{
ignoreCase: true,
callbacksLast: true,
reservedFirst: true,
shorthandFirst: true,
noSortAlphabetically: true,
},
],
"react/jsx-wrap-multilines": [
ERROR,
{
arrow: "parens",
return: "parens",
assignment: "parens",
declaration: "parens",
prop: "parens-new-line",
logical: "parens-new-line",
condition: "parens-new-line",
},
],
},
}
34 changes: 34 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "@mitigate-dev/react-native-eslint-config",
"version": "0.0.0",
"description": "ESLint config for React Native projects at Mitigate.",
"main": "index.js",
"author": "Jānis Ieviņš <[email protected]>",
"license": "MIT",
"files": [
"index.js",
"package.json",
"README.md"
],
"repository": {
"type": "git",
"url": "git+https://github.com/mitigate-dev/react-native-eslint-config.git"
},
"dependencies": {
"@react-native/eslint-config": "0.73.2",
"@typescript-eslint/eslint-plugin": "^7.5.0",
"@typescript-eslint/parser": "^7.5.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-react-native": "^4.1.0"
},
"devDependencies": {
"eslint": "^9.0.0"
},
"peerDependencies": {
"eslint": ">=9",
"prettier": ">=2"
}
}
Loading

0 comments on commit 9b222b0

Please sign in to comment.