@addon24/eslint-config
Version:
ESLint configuration rules for WorldOfTextcraft projects - Centralized configuration for all project types
147 lines (146 loc) • 4.28 kB
JavaScript
// TypeScript ESLint Rules
export default {
rules: {
"@typescript-eslint/prefer-readonly-parameter-types": "off",
"@typescript-eslint/no-magic-numbers": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
args: "all",
argsIgnorePattern: "^_",
caughtErrors: "all",
caughtErrorsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
varsIgnorePattern: "^_",
ignoreRestSiblings: true,
},
],
"@typescript-eslint/naming-convention": [
"error",
{
selector: "default",
format: ["strictCamelCase"],
},
{
selector: "function",
format: ["StrictPascalCase"],
filter: {
regex: "^[A-Z][a-zA-Z0-9]*$",
match: true
},
modifiers: ["exported"]
},
{
selector: "classicAccessor",
format: ["strictCamelCase"],
},
{
selector: ["class"],
format: ["StrictPascalCase"],
},
{
selector: ["enum", "interface", "typeAlias"],
format: ["StrictPascalCase"],
},
{
selector: ["enumMember"],
format: ["StrictPascalCase"],
},
{
selector: "parameter",
format: ["camelCase"],
leadingUnderscore: "allow",
trailingUnderscore: "allow",
},
{
selector: "typeParameter",
format: ["PascalCase"],
custom: {
regex: "^T[A-Z][a-zA-Z]*$|^[A-Z]$",
match: true,
},
},
{
selector: "import",
format: null,
},
{
selector: "variable",
format: ["StrictPascalCase"],
filter: {
regex: "^((?!Props$)[A-Z][A-Za-z0-9]*)$",
match: true
}
},
{
selector: "variable",
format: ["StrictPascalCase"],
modifiers: ["const"],
types: ["function"],
filter: {
regex: "^[A-Z][A-Za-z]+$",
match: true,
},
},
{
selector: "variable",
format: ["strictCamelCase"],
modifiers: ["const"],
types: ["function"],
filter: {
regex: "^[A-Z][A-Za-z]+$",
match: false,
},
},
{
selector: "objectLiteralProperty",
format: ["strictCamelCase"],
filter: {
regex: "^(Mui|&|@|#|\\.).*",
match: false,
},
},
],
"@typescript-eslint/max-params": [
"error",
{
max: 10,
},
],
"@typescript-eslint/no-misused-promises": [
"error",
{
checksVoidReturn: false,
},
],
"@typescript-eslint/unbound-method": "off",
"@typescript-eslint/no-extraneous-class": "off",
"@typescript-eslint/no-redeclare": "off",
"@typescript-eslint/array-type": "error",
"@typescript-eslint/no-empty-function": ["error", {
"allow": ["arrowFunctions", "functions", "methods"]
}],
"@typescript-eslint/no-empty-interface": "error",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-non-null-asserted-optional-chain": "error",
"@typescript-eslint/adjacent-overload-signatures": "error",
"@typescript-eslint/ban-ts-comment": "error",
"@typescript-eslint/ban-tslint-comment": "error",
"@typescript-eslint/explicit-module-boundary-types": "error",
"@typescript-eslint/explicit-member-accessibility": "off",
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/object-literal-sort-keys": "off",
"@typescript-eslint/no-unsafe-call": "error",
"@typescript-eslint/no-unsafe-return": "error",
"@typescript-eslint/no-unsafe-assignment": "error",
"@typescript-eslint/no-unsafe-argument": "error",
"@typescript-eslint/no-unsafe-member-access": "error",
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-use-before-define": "error",
"@typescript-eslint/class-methods-use-this": "off",
"no-warning-comments": ["error", { terms: ["todo", "fixme", "xxx"], location: "anywhere" }],
},
};