Skip to content

Instantly share code, notes, and snippets.

@kevinmcampos
Created June 25, 2018 23:37
Show Gist options
  • Save kevinmcampos/7576da8ef9991a3d6db6c84d3b70ef45 to your computer and use it in GitHub Desktop.
Save kevinmcampos/7576da8ef9991a3d6db6c84d3b70ef45 to your computer and use it in GitHub Desktop.
ESLint React-Native
{
"env": {
"node": true,
"es6": true,
"commonjs": true,
"browser": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended"
],
"parserOptions": {
"ecmaVersion": 7,
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"jsx": true
},
"sourceType": "module"
},
"plugins": [
"react"
],
"rules": {
"indent": ["error", 4, {"SwitchCase": 1}], // Four spaces indent and one indent level on switch's case
"camelcase": ["error", {"properties": "always"}], // Use camelcase even in object properties
"eqeqeq": ["error", "smart"], // Use type-safe equality with some exceptions
"quotes": ["error", "single"], // Single quote for strings
"semi": ["error", "always"], // Semicolons on the end of the lines
"comma-dangle": ["error", "always-multiline"], // Use comma even at the last element on objects and arrays with multilines. Avoid commas on single line.
"arrow-parens": ["error", "as-needed"], // No parentheses on functions with a single argument
"no-console": 0, // Allow console calls
"complexity": ["error", {"max": 10}], // Enforce a maximum cyclomatic complexity allowed in a program
"max-depth": ["error", {"max": 4}], // Enforce a maximum depth that blocks can be nested
"max-nested-callbacks": ["error", {"max": 3}], // Enforce a maximum depth that callbacks can be nested
"block-scoped-var": ["error"], // Enforce the use of variables within the scope they are defined
"dot-location": ["error", "object"], // Enforce newlines to be after the dot (the dot remains with the object, not with the property)
"no-else-return": ["error"], // Disallow else blocks after return statements in if statements
"no-unused-vars": ["error", {"vars": "all", "args": "after-used", "caughtError": "all" }], //
"strict": ["error", "global"], // Requires strict mode
"vars-on-top": ["error"], // Require var declarations be placed at the top of their containing scope
"linebreak-style": ["error", "unix"] // No Windows line breaks
}
}
{
"name": "monalisa-app",
"version": "0.1.0",
"private": true,
"devDependencies": {
"eslint": "^4.8.0",
"eslint-plugin-react": "^7.4.0",
"jest-expo": "^21.0.2",
"react-native-scripts": "1.5.0",
"react-test-renderer": "16.0.0-alpha.12"
},
"main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
"scripts": {
"start": "react-native-scripts start",
"eject": "react-native-scripts eject",
"android": "react-native-scripts android",
"ios": "react-native-scripts ios",
"test": "node node_modules/jest/bin/jest.js --watch"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"expo": "^21.0.0",
"react": "16.0.0-alpha.12",
"react-native": "^0.48.4"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment