Skip to content

Instantly share code, notes, and snippets.

@epreston
Last active August 6, 2023 18:16
Show Gist options
  • Save epreston/2c8cbb54fc7b8ba0f2d6294ec20f6380 to your computer and use it in GitHub Desktop.
Save epreston/2c8cbb54fc7b8ba0f2d6294ec20f6380 to your computer and use it in GitHub Desktop.
eslintrc.json - root template, config and rules for prettier, helpful extras
{
"root": true,
"env": {
"es2022": true,
"browser": true,
"node": true
},
"parserOptions": {
"ecmaVersion": 2022,
"sourceType": "module"
},
"extends": ["eslint:recommended", "prettier"],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"rules": {
"no-debugger": "error",
"no-console": ["error", { "allow": ["warn", "error"] }],
"semi": "error",
"quotes": ["error", "single", { "avoidEscape": true, "allowTemplateLiterals": true }],
"quote-props": ["error", "consistent-as-needed"],
"no-throw-literal": ["error"],
"arrow-body-style": "off",
"prefer-arrow-callback": "off",
"no-unused-vars": "off",
"no-duplicate-imports": "warn",
"no-new-native-nonconstructor": "error",
"yoda": ["error", "never", { "exceptRange": true }],
"prefer-const": [
"error",
{
"destructuring": "any",
"ignoreReadBeforeAssign": false
}
]
}
}
@epreston
Copy link
Author

Rules required by prettier

    "arrow-body-style": "off",
    "prefer-arrow-callback": "off",
    "no-unused-vars": "off",

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