Skip to content

Instantly share code, notes, and snippets.

@jsonkao
Last active May 30, 2020 20:44
Show Gist options
  • Save jsonkao/1660440666a6e59e4476c28eedb5cc73 to your computer and use it in GitHub Desktop.
Save jsonkao/1660440666a6e59e4476c28eedb5cc73 to your computer and use it in GitHub Desktop.
An opinionated ESLint configuration.
{
"extends": "airbnb",
"rules": {
"import/no-named-as-default": 0,
"import/no-named-as-default-member": 0,
// allow files to have extension ".js"
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
// allow ommitted parentheses in single-argument arrow functions
"arrow-parens": [2, "as-needed"],
// allow <Link> components to act as anchors
"jsx-a11y/anchor-is-valid": [ "error", {
"components": [ "Link" ],
"specialLink": [ "to" ],
"aspects": [ "noHref", "invalidHref", "preferButton" ]
}]
},
// environments define allowed global variables
"env": {
"browser": true
}
}
@jsonkao
Copy link
Author

jsonkao commented May 30, 2020

mhkeller:

{
  "env": {
    "browser": true,
    "es6": true,
    "node": true
  },
  "extends": "airbnb-base",
  "rules": {
    "no-tabs": 0,
    "indent": [2, "tab", { "SwitchCase": 1, "VariableDeclarator": 1 }],
    "arrow-body-style": 0,
    "comma-dangle": 0,
    "import/extensions": 0,
    "arrow-parens": [2, "as-needed"],
    "import/no-mutable-exports": 0,
    "import/prefer-default-export": 0,
    "import/first": 0,
    "object-curly-newline": ["error", { "consistent": true }],
    "quotes": ["error", "single", { "allowTemplateLiterals": true }],
    "import/no-extraneous-dependencies": ["error", {"devDependencies": true}],
    "camelcase": 0,
    "max-len": 0,
    "one-var": 0,
    "one-var-declaration-per-line": 0,
    "no-param-reassign": 0,
    "prefer-destructuring": 0,
    "no-multi-assign": 0,
    "eol-last": 0,
    "no-await-in-loop": 0
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment