Skip to content

Instantly share code, notes, and snippets.

@agrublev
Created March 7, 2019 02:08
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 agrublev/b0e76edc305a81df05b2b6d6fbaee690 to your computer and use it in GitHub Desktop.
Save agrublev/b0e76edc305a81df05b2b6d6fbaee690 to your computer and use it in GitHub Desktop.
eslint
module.exports = {
plugins: ["react","markdown"],
globals: {
importScripts: true
},
env: {
browser: true,
node: true,
es6: true
},
parserOptions: {
ecmaVersion: 6,
sourceType: "module",
ecmaFeatures: {
jsx: true,
experimentalObjectRestSpread: true
}
},
rules: {
"no-console": ["off"],
"react/jsx-indent": ["off"],
"react/destructuring-assignment": ["off"],
"import/no-named-as-default-member": ["off"],
"import/named": ["off"],
"import/order": ["off"],
"import/no-extraneous-dependencies": ["off"],
"import/no-named-as-default": ["off"],
"react/jsx-indent-props": ["off"],
"flowtype/require-return-type": ["off"],
camelcase: [
1,
{
properties: "always"
}
],
"react/jsx-one-expression-per-line": [
"warn",
{
allow: "none"
}
],
"react/prop-types": "off",
complexity: ["warn", 5],
"max-nested-callbacks": ["warn", 8],
"no-unused-vars": "warn",
"max-statements": [
"warn",
{
max: 4
}
],
"max-statements-per-line": [
"warn",
{
max: 1
}
],
"getter-return": "warn",
"jsx-quotes": ["warn", "prefer-double"]
},
extends: ["prettier", "react-app", "eslint:recommended", "plugin:react/recommended"],
settings: {
react: {
createClass: "createReactClass",
pragma: "React", // Pragma to use, default to "React"
version: "detect", // React version. "detect" automatically picks the version you have installed.
// You can also use `16.0`, `16.3`, etc, if you want to override the detected value.
flowVersion: "0.53" // Flow version
},
propWrapperFunctions: [
// The names of any function used to wrap propTypes, e.g. `forbidExtraProps`. If this isn't set, any propTypes wrapped in a function will be skipped.
"forbidExtraProps",
{ property: "freeze", object: "Object" },
{ property: "myFavoriteWrapper" }
]
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment