@dareharu/eslint-config
Version:
Shareable ESLint configuration for Dareharu project
312 lines (310 loc) • 8.78 kB
JavaScript
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/common.ts
var common_exports = {};
__export(common_exports, {
commonRules: () => commonRules,
default: () => common_default
});
module.exports = __toCommonJS(common_exports);
var commonRules = {
"@typescript-eslint/adjacent-overload-signatures": "error",
"@typescript-eslint/array-type": [
"error",
{
default: "array-simple",
readonly: "generic"
}
],
"@typescript-eslint/ban-ts-comment": [
"error",
{
minimumDescriptionLength: 3,
"ts-check": true,
"ts-expect-error": "allow-with-description",
"ts-ignore": {
descriptionFormat: "^: \\(TS\\d+\\) .+$"
},
"ts-nocheck": true
}
],
"@typescript-eslint/class-literal-property-style": "error",
"@typescript-eslint/comma-dangle": "error",
"@typescript-eslint/consistent-generic-constructors": ["error", "type-annotation"],
"@typescript-eslint/consistent-indexed-object-style": ["warn", "record"],
"@typescript-eslint/consistent-type-assertions": [
"error",
{
assertionStyle: "as",
objectLiteralTypeAssertions: "allow-as-parameter"
}
],
"@typescript-eslint/consistent-type-definitions": "error",
"@typescript-eslint/consistent-type-exports": [
"error",
{
fixMixedExportsWithInlineTypeSpecifier: true
}
],
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/default-param-last": "error",
"@typescript-eslint/dot-notation": [
"error",
{
allowPattern: "(^[A-Z])|(^[a-z]+(_[a-z]+)+$)",
allowPrivateClassPropertyAccess: true
}
],
"@typescript-eslint/explicit-function-return-type": [
"error",
{
allowExpressions: true,
allowConciseArrowFunctionExpressionsStartingWithVoid: true
}
],
"@typescript-eslint/explicit-member-accessibility": "error",
"@typescript-eslint/explicit-module-boundary-types": [
"error",
{
allowDirectConstAssertionInArrowFunctions: false,
allowTypedFunctionExpressions: false
}
],
"@typescript-eslint/member-delimiter-style": [
"error",
{
multiline: {
delimiter: "none"
}
}
],
"@typescript-eslint/naming-convention": [
"error",
{
format: ["StrictPascalCase"],
prefix: ["is", "should", "has", "can", "did", "will"],
selector: "variable",
types: ["boolean"]
},
{
format: ["StrictPascalCase"],
selector: ["typeLike", "enumMember"]
},
{
custom: {
regex: "^I[A-Z]",
match: false
},
format: ["StrictPascalCase"],
selector: "interface"
},
{
custom: {
regex: "[- ]",
match: false
},
format: ["strictCamelCase"],
leadingUnderscore: "allow",
selector: ["variable", "parameter", "property"]
},
{
format: null,
modifiers: ["requiresQuotes"],
selector: ["property", "method", "accessor", "enumMember"]
},
{
format: ["strictCamelCase", "StrictPascalCase", "UPPER_CASE"],
modifiers: ["const", "global"],
selector: ["variable", "enumMember"]
},
{
format: ["StrictPascalCase"],
selector: "enum",
custom: {
regex: "(e)?s$",
match: false
}
},
{
format: ["strictCamelCase"],
modifiers: ["unused"],
leadingUnderscore: "require",
selector: "variableLike"
},
{
format: ["strictCamelCase"],
selector: "default",
leadingUnderscore: "forbid",
trailingUnderscore: "forbid"
}
],
"@typescript-eslint/no-base-to-string": "error",
"@typescript-eslint/no-confusing-non-null-assertion": "error",
"@typescript-eslint/no-confusing-void-expression": [
"error",
{
ignoreArrowShorthand: true,
ignoreVoidOperator: true
}
],
"@typescript-eslint/no-dupe-class-members": "error",
"@typescript-eslint/no-duplicate-enum-values": "error",
"@typescript-eslint/no-empty-function": [
"error",
{
allow: ["setters", "protected-constructors", "decoratedFunctions", "overrideMethods"]
}
],
"@typescript-eslint/no-empty-interface": [
"error",
{
allowSingleExtends: true
}
],
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-extra-parens": [
"error",
"all",
{
returnAssign: false
}
],
"@typescript-eslint/no-extraneous-class": "error",
"@typescript-eslint/no-invalid-this": "error",
"@typescript-eslint/no-invalid-void-type": "error",
"@typescript-eslint/no-magic-numbers": [
"warn",
{
enforceConst: true,
ignoreDefaultValues: true,
ignoreEnums: true,
ignoreNumericLiteralTypes: true,
ignoreReadonlyClassProperties: true
}
],
"@typescript-eslint/no-meaningless-void-operator": "error",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-non-null-asserted-nullish-coalescing": "error",
"@typescript-eslint/no-non-null-assertion": "error",
"@typescript-eslint/no-redundant-type-constituents": "error",
"@typescript-eslint/no-throw-literal": "error",
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "error",
"@typescript-eslint/no-unnecessary-condition": "error",
"@typescript-eslint/no-unnecessary-qualifier": "error",
"@typescript-eslint/no-unnecessary-type-arguments": "error",
"@typescript-eslint/no-unused-vars": [
"error",
{
args: "all",
argsIgnorePattern: "^_",
caughtErrors: "all",
ignoreRestSiblings: true
}
],
"@typescript-eslint/no-use-before-define": [
"error",
{
ignoreTypeReferences: false
}
],
"@typescript-eslint/no-useless-constructor": "error",
"@typescript-eslint/no-useless-empty-export": "error",
"@typescript-eslint/non-nullable-type-assertion-style": "error",
"@typescript-eslint/prefer-enum-initializers": "error",
"@typescript-eslint/prefer-for-of": "error",
"@typescript-eslint/prefer-literal-enum-member": [
"error",
{
allowBitwiseExpressions: true
}
],
"@typescript-eslint/prefer-nullish-coalescing": "error",
"@typescript-eslint/prefer-optional-chain": "error",
"@typescript-eslint/prefer-readonly": "error",
"@typescript-eslint/prefer-reduce-type-parameter": "error",
"@typescript-eslint/prefer-regexp-exec": "error",
"@typescript-eslint/prefer-return-this-type": "error",
"@typescript-eslint/prefer-string-starts-ends-with": "error",
"@typescript-eslint/promise-function-async": "error",
"@typescript-eslint/require-array-sort-compare": [
"error",
{
ignoreStringArrays: true
}
],
"@typescript-eslint/restrict-plus-operands": [
"error",
{
checkCompoundAssignments: true
}
],
"@typescript-eslint/sort-type-union-intersection-members": "error",
"@typescript-eslint/strict-boolean-expressions": [
"error",
{
allowString: false,
allowNumber: false
}
],
"@typescript-eslint/switch-exhaustiveness-check": "error",
"@typescript-eslint/unified-signatures": [
"error",
{
ignoreDifferentlyNamedParameters: true
}
],
"@typescript-eslint/lines-between-class-members": [
"error",
"always",
{
exceptAfterOverload: true,
exceptAfterSingleLine: true
}
],
"@typescript-eslint/object-curly-spacing": ["error", "always"],
"@typescript-eslint/padding-line-between-statements": [
"error",
{
blankLine: "always",
prev: ["const", "let", "var"],
next: "*"
},
{
blankLine: "any",
prev: ["const", "let", "var"],
next: ["const", "let", "var"]
},
{
blankLine: "always",
prev: "*",
next: ["class", "default", "function", "interface", "return", "type"]
}
],
"@typescript-eslint/space-infix-ops": [
"error",
{
int32Hint: true
}
]
};
var common_default = commonRules;
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
commonRules
});