Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

1.7 KB
Raw Blame
const lintFix =
  "oxlint --disable-nested-config --no-error-on-unmatched-pattern --max-warnings 0 --report-unused-disable-directives --fix";

module.exports = {
  "+(frontend|enterprise)/**/*.styled.tsx": [
    "stylelint --customSyntax postcss-styled-syntax --fix",
  ],
  "+(frontend|enterprise/frontend|e2e)/**/*.css": [
    "stylelint --fix",
    "oxfmt --write",
  ],
  "+(frontend|enterprise/frontend)/**/*.{js,jsx,ts,tsx}": [
    `cross-env LINT_CSS_MODULES=true ${lintFix}`,
    "oxfmt --write",
    "bun bin/verify-doc-links/verify-doc-links.ts",
  ],
  "e2e/**/!(cypress_sample_instance_data).{js,jsx,ts,tsx}": [
    lintFix,
    "oxfmt --write",
  ],
  "**/*.{clj,cljc,cljs,bb}": [
    "./bin/mage cljfmt-files",
    "./bin/mage fix-unused-requires",
  ],
  "e2e/test/scenarios/**/*.{js,ts}": ["node e2e/validate-e2e-test-files.js"],
  "enterprise/frontend/src/embedding-sdk-package/README.md": ["oxfmt --write"],
  "+(frontend|enterprise/frontend|e2e)/**/*.{mjs,cjs,mts,cts}": [
    "oxfmt --write",
  ],
  "!(frontend|enterprise|e2e)/**/*.{js,jsx,ts,tsx,mjs,cjs,mts,cts,css}": [
    "oxfmt --write",
  ],
  "*.{js,jsx,ts,tsx,mjs,cjs,mts,cts,css}": ["oxfmt --write"],
  "**/*": [
    /**
     * Run mage token-scan for each staged file individually.
     * lint-staged passes staged file paths as an array, but executing the command
     * once per file avoids shell parsing issues with paths containing spaces or
     * special characters (e.g. parentheses), and keeps the invocation explicit.
     */
    (files) =>
      `./bin/mage -token-scan ${files.map((item) => `"${item}"`).join(" ")}`,
    // TODO (Bryan 12/12/25) -- reenable this when we can completely verify correctness
    "./bin/mage -uninstall-merge-drivers",
  ],
};