eslint-config-brf
Version:
brf lint custom configurations
344 lines (343 loc) • 9.53 kB
JavaScript
module.exports = {
overrides: [
{
// GLOBAL
files: ["projects/application/src/app/**/*.ts"],
excludedFiles: [
"projects/application/src/app/application/language/locale/index.ts",
"projects/application/src/app/infrastructure/domain.routes.ts",
"projects/application/src/app/app.module.ts",
"projects/application/src/app/app.components.ts",
],
rules: {},
},
{
// TS
files: ["projects/application/src/app/**/*.ts"],
excludedFiles: [
"projects/application/src/app/application/language/locale/index.ts",
"projects/application/src/app/infrastructure/domain.routes.ts",
"projects/application/src/app/app.module.ts",
"projects/application/src/app/app.components.ts",
"*.spec.ts",
],
rules: {
"@angular-eslint/component-selector": [
"error",
{
prefix: "app",
style: "kebab-case",
type: "element",
},
],
"@angular-eslint/directive-selector": [
"error",
{
prefix: "app",
style: "camelCase",
type: "attribute",
},
],
"@typescript-eslint/naming-convention": [
"error",
{
selector: ["class"],
format: ["PascalCase"],
},
{
selector: ["class"],
format: ["PascalCase"],
prefix: ["Abstract"],
modifiers: ["abstract"],
},
{
selector: ["enum"],
format: ["PascalCase"],
suffix: ["Enum"],
},
{
selector: ["interface"],
format: ["PascalCase"],
prefix: ["I"],
},
{
selector: ["typeAlias"],
format: ["PascalCase"],
prefix: ["T"],
},
{
selector: ["memberLike", "variableLike"],
format: ["camelCase"],
custom: {
regex: "^((^fb$)|(^var$)|(^res$)|(^teste$)|(^objeto$))$",
match: false,
},
leadingUnderscore: "allow",
},
// {
// selector: ['objectLiteralProperty'],
// format: null
// }
],
},
},
{
// RESPONSE CONTRACT
files: [
"projects/application/src/app/application/*/contract/response/*.ts",
"projects/application/src/app/application/*/contract/response/*/*.ts",
],
excludedFiles: "*.spec.ts",
rules: {
"@typescript-eslint/naming-convention": [
"error",
{
selector: ["class"],
format: ["PascalCase"],
suffix: ["Response"],
modifiers: ["exported"],
},
{
selector: ["variableLike"],
format: ["camelCase"],
custom: {
regex:
"^((^fb$)|(^var$)|(^res$)|(^req$)|(^e$)|(^err$)|(^teste$)|(^objeto$)|(^objetos$))$",
match: false,
},
},
],
},
},
{
// REQUEST CONTRACT
files: [
"projects/application/src/app/application/*/contract/request/*.ts",
"projects/application/src/app/application/*/contract/request/*/*.ts",
],
excludedFiles: "*.spec.ts",
rules: {
"@typescript-eslint/naming-convention": [
"error",
{
selector: ["class"],
format: ["PascalCase"],
suffix: ["Request"],
modifiers: ["exported"],
},
{
selector: ["variableLike"],
format: ["camelCase"],
custom: {
regex: "^((^fb$)|(^var$)|(^res$)|(^teste$)|(^objeto$))$",
match: false,
},
},
],
},
},
{
// FACADE
files: [
"projects/application/src/app/application/*/abstract/*.ts",
"projects/application/src/app/application/*/abstract/*/*.ts",
],
excludedFiles: "*.spec.ts",
rules: {
"@typescript-eslint/naming-convention": [
"error",
{
selector: ["class"],
format: ["PascalCase"],
suffix: ["Facade"],
},
{
selector: ["memberLike", "variableLike"],
format: ["camelCase"],
custom: {
regex: "^((^fb$)|(^var$)|(^res$)|(^teste$)|(^objeto$))$",
match: false,
},
leadingUnderscore: "allow",
},
],
},
},
{
// INFRASTRUCTURE SERVICE
files: [
"projects/application/src/app/infrastructure/*/service/*.ts",
"projects/application/src/app/infrastructure/*/service/*/*.ts",
],
excludedFiles: "*.spec.ts",
rules: {
"@typescript-eslint/naming-convention": [
"error",
{
selector: ["class"],
format: ["PascalCase"],
suffix: ["Service"],
},
{
selector: ["memberLike", "variableLike"],
format: ["camelCase"],
custom: {
regex: "^((^fb$)|(^var$)|(^res$)|(^teste$)|(^objeto$))$",
match: false,
},
leadingUnderscore: "allow",
},
],
},
},
{
// RESOLVER
files: ["projects/application/src/app/application/*/resolver/*.ts"],
excludedFiles: "*.spec.ts",
rules: {
"@typescript-eslint/naming-convention": [
"error",
{
selector: ["class"],
format: ["PascalCase"],
suffix: ["Resolver"],
},
{
selector: ["memberLike", "variableLike"],
format: ["camelCase"],
custom: {
regex: "^((^fb$)|(^var$)|(^res$)|(^teste$)|(^objeto$))$",
match: false,
},
leadingUnderscore: "allow",
},
],
},
},
{
// INTERCEPTOR
files: ["projects/application/src/app/application/*/interceptor/*.ts"],
excludedFiles: "*.spec.ts",
rules: {
"@typescript-eslint/naming-convention": [
"error",
{
selector: ["class"],
format: ["PascalCase"],
suffix: ["Interceptor"],
},
{
selector: ["memberLike", "variableLike"],
format: ["camelCase"],
custom: {
regex: "^((^fb$)|(^var$)|(^res$)|(^teste$)|(^objeto$))$",
match: false,
},
leadingUnderscore: "allow",
},
],
},
},
{
// GUARD
files: ["projects/application/src/app/application/*/guard/*.ts"],
excludedFiles: "*.spec.ts",
rules: {
"@typescript-eslint/naming-convention": [
"error",
{
selector: ["class"],
format: ["PascalCase"],
suffix: ["Guard"],
},
{
selector: ["memberLike", "variableLike"],
format: ["camelCase"],
custom: {
regex: "^((^fb$)|(^var$)|(^res$)|(^teste$)|(^objeto$))$",
match: false,
},
leadingUnderscore: "allow",
},
],
},
},
{
// VALIDATOR
files: [
"projects/application/src/app/infrastructure/shared/validator/*.ts",
],
excludedFiles: "*.spec.ts",
rules: {
"@typescript-eslint/naming-convention": [
"error",
{
selector: ["class"],
format: ["PascalCase"],
suffix: ["Validator"],
},
{
selector: ["memberLike", "variableLike"],
format: ["camelCase"],
custom: {
regex: "^((^fb$)|(^var$)|(^res$)|(^teste$)|(^objeto$))$",
match: false,
},
leadingUnderscore: "allow",
},
],
},
},
{
// PIPE
files: ["projects/application/src/app/infrastructure/shared/pipe/*.ts"],
excludedFiles: [
"*.spec.ts",
"projects/application/src/app/infrastructure/shared/pipe/pipe.module.ts",
],
rules: {
"@typescript-eslint/naming-convention": [
"error",
{
selector: ["class"],
format: ["PascalCase"],
suffix: ["Pipe"],
},
{
selector: ["memberLike", "variableLike"],
format: ["camelCase"],
custom: {
regex: "^((^fb$)|(^var$)|(^res$)|(^teste$)|(^objeto$))$",
match: false,
},
leadingUnderscore: "allow",
},
],
},
},
{
// UTIL
files: ["projects/application/src/app/infrastructure/shared/util/*.ts"],
excludedFiles: ["*.spec.ts"],
rules: {
"@typescript-eslint/naming-convention": [
"error",
{
selector: ["class"],
format: ["PascalCase"],
suffix: ["Util"],
},
{
selector: ["memberLike", "variableLike"],
format: ["camelCase"],
custom: {
regex: "^((^fb$)|(^var$)|(^res$)|(^teste$)|(^objeto$))$",
match: false,
},
leadingUnderscore: "allow",
},
],
},
},
],
};