0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-04 10:39:43 +08:00
discourse/eslint.config.mjs
Sérgio Saquetim ca748e8203
DEV: Enforce the ui-kit -internals boundary with a lint rule
ui-kit groups keep private collaborators under -internals/, importable
only within their own group and from tests. A repo-local rule
(`discourse-local/no-cross-group-internals`) turns a violation into a
lint failure, scoped to ui-kit groups so `@ember/-internals` and other
unrelated internals imports stay untouched; node-run tests pin the
containment, exemption and re-export shapes. The developer guides gain
the three-tier group policy (one core per group, facades composing only
the core's public API, private collaborators in -internals) that the
rule enforces.
2026-08-03 17:45:03 -03:00

58 lines
1.2 KiB
JavaScript
Vendored

import DiscourseRecommended from "@discourse/lint-configs/eslint";
import noCrossGroupInternals from "./frontend/lint-rules/no-cross-group-internals.mjs";
export default [
...DiscourseRecommended,
{
files: ["**/*.{js,gjs,ts,gts}"],
plugins: {
"discourse-local": {
rules: {
"no-cross-group-internals": noCrossGroupInternals,
},
},
},
rules: {
"discourse-local/no-cross-group-internals": "error",
},
},
{
rules: {
"ember/template-no-capital-arguments": "off",
"ember/template-require-button-type": "off",
},
},
{
ignores: [
"plugins/**/lib/javascripts/locale",
"plugins/discourse-math/public",
"public/",
"vendor/",
"**/node_modules/",
"spec/",
"frontend/discourse/dist/",
"**/*.d.ts",
"frontend/discourse-types/external-types",
"frontend/discourse-types/dts-generator.{js,ts}",
"tmp/",
],
},
{
files: ["themes/**/*.{js,gjs,ts,gts}"],
languageOptions: {
globals: {
settings: "readonly",
themePrefix: "readonly",
},
},
},
{
languageOptions: {
parserOptions: {
babelOptions: {
configFile: false,
},
},
},
},
];