UNPKG

@jupri-lab/eslint-config-typescript

Version:

Curated eslint config for typescript projects.

83 lines (80 loc) 2.69 kB
module.exports = { parser: "@typescript-eslint/parser", plugins: [ "@typescript-eslint", "sort-keys", "sort-destructure-keys", "typescript-sort-keys", ], extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"], rules: { "sort-keys": 0, "sort-keys/sort-keys-fix": 1, "typescript-sort-keys/interface": "error", "sort-destructure-keys/sort-destructure-keys": [ "error", { caseSensitive: false }, ], "no-console": "warn", semi: ["error", "always"], quotes: ["error", "double"], "no-extra-semi": "error", "comma-dangle": ["error", "always-multiline"], "no-empty-function": "off", "@typescript-eslint/no-empty-function": "error", "no-unused-vars": "off", "@typescript-eslint/no-unused-vars": [ "error", { args: "all", argsIgnorePattern: "^_", caughtErrors: "all", caughtErrorsIgnorePattern: "^_", destructuredArrayIgnorePattern: "^_", varsIgnorePattern: "^_", ignoreRestSiblings: true, }, ], "no-return-await": "off", "@typescript-eslint/return-await": "error", "@typescript-eslint/no-throw-literal": "error", "@typescript-eslint/consistent-indexed-object-style": ["error", "record"], "@typescript-eslint/consistent-type-definitions": ["error", "interface"], "@typescript-eslint/consistent-type-exports": "error", "@typescript-eslint/consistent-type-imports": "error", "@typescript-eslint/no-confusing-non-null-assertion": "error", "@typescript-eslint/no-empty-interface": "error", "@typescript-eslint/no-import-type-side-effects": "error", "@typescript-eslint/no-inferrable-types": "error", "@typescript-eslint/no-misused-promises": [ "error", { checksVoidReturn: false, }, ], "@typescript-eslint/no-explicit-any": [ "error", { fixToUnknown: true, ignoreRestArgs: true, }, ], "@typescript-eslint/no-redundant-type-constituents": "error", "@typescript-eslint/no-unnecessary-boolean-literal-compare": "error", "@typescript-eslint/no-unnecessary-condition": "error", "@typescript-eslint/no-unnecessary-type-constraint": "error", "@typescript-eslint/no-useless-empty-export": "error", "@typescript-eslint/prefer-find": "error", "@typescript-eslint/prefer-includes": "error", "@typescript-eslint/sort-type-constituents": "error", }, env: { browser: true, es6: true, node: true, }, parserOptions: { sourceType: "module", ecmaVersion: 2023, }, };