Skip to content

Instantly share code, notes, and snippets.

@kyo504
Last active May 29, 2018 15:34
Show Gist options
  • Save kyo504/aec1e1df71ea01bc584bd4db1746e602 to your computer and use it in GitHub Desktop.
Save kyo504/aec1e1df71ea01bc584bd4db1746e602 to your computer and use it in GitHub Desktop.
Prettier + ESLint for React Native
{
"extends": [
"plugin:flowtype/recommended",
"plugin:react/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"prettier",
"prettier/flowtype",
"prettier/react"
],
"plugins": ["flowtype", "react", "prettier"],
"globals": {
"document": false
},
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true,
"experimentalDecorators": true
}
},
"env": {
"jest": true,
"node": true
},
"rules": {
"no-unused-vars": 1,
"no-duplicate-imports": 0,
"import/no-duplicates": 2,
"import/named": 0,
"import/no-unresolved": 0,
"react/prop-types": [1, { "skipUndeclared": true }],
"react/display-name": 0
}
}
{
"printWidth": 100,
"trailingComma": "es5",
"singleQuote": true
}
{
"name": "ReactNativePrettier",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest",
"precommit": "lint-staged"
},
"dependencies": {
"react": "16.3.1",
"react-native": "0.55.4"
},
"devDependencies": {
"babel-eslint": "^8.2.3",
"babel-jest": "23.0.0",
"babel-preset-react-native": "4.0.0",
"eslint": "^4.19.1",
"eslint-config-prettier": "^2.9.0",
"eslint-plugin-babel": "^5.1.0",
"eslint-plugin-flowtype": "^2.46.3",
"eslint-plugin-import": "^2.12.0",
"eslint-plugin-prettier": "^2.6.0",
"eslint-plugin-react": "^7.8.2",
"flow-bin": "^0.67.1",
"husky": "^0.14.3",
"jest": "23.0.0",
"lint-staged": "^7.1.1",
"prettier": "^1.12.1",
"react-test-renderer": "16.3.1"
},
"jest": {
"preset": "react-native"
},
"lint-staged": {
"linters": {
"**/*.{js,json,md}": ["eslint --fix", "git add"]
},
"ignore": ["package.json"]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment