Skip to content

Instantly share code, notes, and snippets.

@maxarouca
Last active January 9, 2020 20:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxarouca/569f962ba400f797e5f2ada23837553a to your computer and use it in GitHub Desktop.
Save maxarouca/569f962ba400f797e5f2ada23837553a to your computer and use it in GitHub Desktop.
React + Eslint + Prettier + editorConfig
root = true
[*]
end_of_line = lf
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
{
"singleQuote": true,
"trailingComma": "es5"
}
module.exports = {
env: {
browser: true,
es6: true
},
extends: ["plugin:react/recommended", "airbnb", "prettier", "prettier/react"],
globals: {
Atomics: "readonly",
SharedArrayBuffer: "readonly"
},
parser: "babel-eslint",
parserOptions: {
ecmaFeatures: {
jsx: true
},
ecmaVersion: 2018,
sourceType: "module"
},
plugins: ["react", "prettier"],
rules: {
"prettier/prettier": "error",
"react/jsx-filename-extension": ["error", { extensions: [".js", ".jsx"] }],
"import/prefer-default-export": "off",
"no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
"react/jsx-one-expression-per-line": "off",
"global-require": "off",
"react-native/no-raw-text": "off",
"no-param-reassign": "off",
"no-underscore-dangle": "off",
camelcase: "off",
"no-console": ["error", { allow: ["tron"] }],
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn"
}
};
yarn add eslint prettier eslint-config-prettier eslint-plugin-prettier babel-eslint -D
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment