Last active
January 9, 2020 20:00
-
-
Save maxarouca/569f962ba400f797e5f2ada23837553a to your computer and use it in GitHub Desktop.
React + Eslint + Prettier + editorConfig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root = true | |
[*] | |
end_of_line = lf | |
indent_style = space | |
indent_size = 2 | |
charset = utf-8 | |
trim_trailing_whitespace = true | |
insert_final_newline = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"singleQuote": true, | |
"trailingComma": "es5" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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