222 lines
5.7 KiB
JSON
222 lines
5.7 KiB
JSON
{
|
|
"extends": [
|
|
"next/core-web-vitals",
|
|
"plugin:import/recommended",
|
|
"plugin:import/typescript"
|
|
],
|
|
"ignorePatterns": [
|
|
"lib/types/generated/**",
|
|
"**/*.test.ts",
|
|
"**/*.test.tsx",
|
|
"eslint-rules/**"
|
|
],
|
|
"overrides": [
|
|
{
|
|
"files": [
|
|
"app/**/page.*",
|
|
"app/**/layout.*",
|
|
"app/**/loading.*",
|
|
"app/**/error.*",
|
|
"app/**/not-found.*",
|
|
"app/**/global-error.*",
|
|
"app/**/template.*",
|
|
"app/**/default.*"
|
|
],
|
|
"rules": {
|
|
"import/no-default-export": "off",
|
|
"no-restricted-syntax": "off"
|
|
}
|
|
},
|
|
{
|
|
"files": [
|
|
"lib/builders/view-models/*.ts",
|
|
"lib/builders/view-models/*.tsx"
|
|
],
|
|
"rules": {
|
|
"gridpilot-rules/view-model-builder-contract": "error"
|
|
}
|
|
},
|
|
{
|
|
"files": [
|
|
"lib/builders/view-data/*.ts",
|
|
"lib/builders/view-data/*.tsx"
|
|
],
|
|
"rules": {
|
|
"gridpilot-rules/view-data-builder-contract": "error"
|
|
}
|
|
},
|
|
{
|
|
"files": [
|
|
"lib/mutations/**/*.ts"
|
|
],
|
|
"rules": {
|
|
"gridpilot-rules/mutation-contract": "error",
|
|
"gridpilot-rules/filename-service-match": "error"
|
|
}
|
|
},
|
|
{
|
|
"files": [
|
|
"templates/**/*.tsx"
|
|
],
|
|
"rules": {
|
|
"gridpilot-rules/template-no-direct-mutations": "error",
|
|
"gridpilot-rules/template-no-side-effects": "error",
|
|
"gridpilot-rules/template-no-async-render": "error",
|
|
"gridpilot-rules/template-no-external-state": "error",
|
|
"gridpilot-rules/template-no-global-objects": "error",
|
|
"gridpilot-rules/template-no-mutation-props": "error",
|
|
"gridpilot-rules/template-no-unsafe-html": "error",
|
|
"gridpilot-rules/component-no-data-manipulation": "error"
|
|
}
|
|
},
|
|
{
|
|
"files": [
|
|
"components/**/*.tsx"
|
|
],
|
|
"rules": {
|
|
"gridpilot-rules/component-no-data-manipulation": "error"
|
|
}
|
|
},
|
|
{
|
|
"files": [
|
|
"app/**/page.tsx",
|
|
"app/**/layout.tsx"
|
|
],
|
|
"rules": {
|
|
"gridpilot-rules/rsc-no-container-manager": "error",
|
|
"gridpilot-rules/rsc-no-page-data-fetcher": "error",
|
|
"gridpilot-rules/rsc-no-view-models": "error",
|
|
"gridpilot-rules/rsc-no-presenters": "error",
|
|
"gridpilot-rules/rsc-no-intl": "error",
|
|
"gridpilot-rules/rsc-no-sorting-filtering": "error",
|
|
"gridpilot-rules/rsc-no-display-objects": "error",
|
|
"gridpilot-rules/rsc-no-unsafe-services": "error",
|
|
"gridpilot-rules/rsc-no-di": "error",
|
|
"gridpilot-rules/rsc-no-local-helpers": "error",
|
|
"gridpilot-rules/rsc-no-object-construction": "error",
|
|
"gridpilot-rules/rsc-no-container-manager-calls": "error"
|
|
}
|
|
},
|
|
{
|
|
"files": [
|
|
"lib/display-objects/**/*.ts",
|
|
"lib/display-objects/**/*.tsx"
|
|
],
|
|
"rules": {
|
|
"gridpilot-rules/display-no-domain-models": "error",
|
|
"gridpilot-rules/display-no-business-logic": "error",
|
|
"gridpilot-rules/model-no-domain-in-display": "error"
|
|
}
|
|
},
|
|
{
|
|
"files": [
|
|
"lib/page-queries/**/*.ts"
|
|
],
|
|
"rules": {
|
|
"gridpilot-rules/page-query-no-null-returns": "error",
|
|
"gridpilot-rules/page-query-filename": "error",
|
|
"gridpilot-rules/page-query-contract": "error",
|
|
"gridpilot-rules/page-query-execute": "error",
|
|
"gridpilot-rules/page-query-return-type": "error"
|
|
}
|
|
},
|
|
{
|
|
"files": [
|
|
"templates/**/*.ts",
|
|
"templates/**/*.tsx"
|
|
],
|
|
"rules": {
|
|
"gridpilot-rules/view-data-location": "error"
|
|
}
|
|
},
|
|
{
|
|
"files": [
|
|
"lib/services/**/*.ts"
|
|
],
|
|
"rules": {
|
|
"gridpilot-rules/services-no-external-api": "error",
|
|
"gridpilot-rules/services-must-be-pure": "error",
|
|
"gridpilot-rules/filename-service-match": "error"
|
|
}
|
|
},
|
|
{
|
|
"files": [
|
|
"app/**/*.tsx",
|
|
"app/**/*.ts"
|
|
],
|
|
"rules": {
|
|
"gridpilot-rules/client-only-no-server-code": "error",
|
|
"gridpilot-rules/client-only-must-have-directive": "error",
|
|
"gridpilot-rules/server-actions-must-use-mutations": "error"
|
|
}
|
|
},
|
|
{
|
|
"files": [
|
|
"lib/write-boundaries/**/*.ts"
|
|
],
|
|
"rules": {
|
|
"gridpilot-rules/write-boundary-no-direct-mutations": "error",
|
|
"gridpilot-rules/write-boundary-must-use-repository": "error"
|
|
}
|
|
},
|
|
{
|
|
"files": [
|
|
"lib/domain/**/*.ts",
|
|
"lib/models/**/*.ts"
|
|
],
|
|
"rules": {
|
|
"gridpilot-rules/model-no-display-in-domain": "error"
|
|
}
|
|
}
|
|
],
|
|
"plugins": [
|
|
"boundaries",
|
|
"import",
|
|
"@typescript-eslint",
|
|
"unused-imports",
|
|
"gridpilot-rules"
|
|
],
|
|
"root": true,
|
|
"rules": {
|
|
"@next/next/no-img-element": "error",
|
|
"@typescript-eslint/no-explicit-any": "error",
|
|
"@typescript-eslint/no-unused-vars": "error",
|
|
"boundaries/element-types": [
|
|
2,
|
|
{
|
|
"default": "disallow",
|
|
"rules": [
|
|
{
|
|
"allow": [
|
|
"website"
|
|
],
|
|
"from": [
|
|
"website"
|
|
]
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"import/no-default-export": "error",
|
|
"import/no-named-as-default-member": "error",
|
|
"no-restricted-syntax": "error",
|
|
"react-hooks/exhaustive-deps": "error",
|
|
"react-hooks/rules-of-hooks": "error",
|
|
"react/no-unescaped-entities": "error",
|
|
"unused-imports/no-unused-imports": "off",
|
|
"unused-imports/no-unused-vars": "off"
|
|
},
|
|
"settings": {
|
|
"boundaries/elements": [
|
|
{
|
|
"pattern": [
|
|
"**/*"
|
|
],
|
|
"type": "website"
|
|
}
|
|
],
|
|
"import/resolver": {
|
|
"typescript": {}
|
|
}
|
|
}
|
|
} |