Skip to content

Instantly share code, notes, and snippets.

@abh006
Created September 16, 2022 14:14
Show Gist options
  • Save abh006/93aae6ef9d8b4c85cf29528b0ad6d348 to your computer and use it in GitHub Desktop.
Save abh006/93aae6ef9d8b4c85cf29528b0ad6d348 to your computer and use it in GitHub Desktop.
eslintrc.cjs
module.exports = {
env: {
es6: true,
node: true,
},
parser: "@typescript-eslint/parser",
parserOptions: {
sourceType: "module",
tsconfigRootDir: __dirname,
project: ["./tsconfig.json"],
},
plugins: ["@typescript-eslint", "unused-imports"],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"prettier",
],
rules: {
curly: "error",
"@typescript-eslint/naming-convention": [
"error",
{
selector: "default",
format: ["camelCase"],
leadingUnderscore: "allow",
trailingUnderscore: "forbid",
},
{
selector: "variable",
format: ["camelCase", "UPPER_CASE"],
leadingUnderscore: "allow",
trailingUnderscore: "forbid",
},
{
selector: ["typeLike", "class"],
format: ["PascalCase"],
leadingUnderscore: "allow",
trailingUnderscore: "forbid",
},
{
selector: "memberLike",
modifiers: ["private"],
format: ["camelCase"],
leadingUnderscore: "require",
},
{
selector: ["objectLiteralProperty"],
format: null,
modifiers: ["requiresQuotes"],
},
],
eqeqeq: ["error", "always", { null: "ignore" }],
"@typescript-eslint/unbound-method": "off",
"no-return-await": "error",
"no-use-before-define": "error",
"no-undef": "error",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_$",
varsIgnorePattern: "^_$",
},
],
"@typescript-eslint/explicit-module-boundary-types": "error",
"prefer-arrow-callback": "error",
"prefer-const": "error",
"require-await": "error",
"@typescript-eslint/ban-ts-comment": "off",
"sort-imports": [
"error",
{
ignoreDeclarationSort: true,
},
],
"@typescript-eslint/no-empty-function": "warn",
"@typescript-eslint/explicit-module-boundary-types": "error",
"unused-imports/no-unused-imports": "error",
"unused-imports/no-unused-vars": [
"error",
{
vars: "all",
varsIgnorePattern: "^_",
args: "after-used",
argsIgnorePattern: "^_",
},
],
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment