Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
import { defineConfig } from "eslint/config";

// Root ESLint config.
//
// Scope: this config only lints repository-root JavaScript (config files,
// helper scripts). Each sub-package (backend/, frontend/, contract/) owns and
// runs its own lint setup, so they are ignored here to avoid double-linting
// with a weaker root ruleset. The baseline below is intentionally dependency
// free (no @eslint/js / globals packages) so `pnpm run lint` works at the root
// with only the already-installed `eslint` package and no lockfile changes.
const eslintConfig = defineConfig([
{
ignores: [
Expand All @@ -10,8 +18,34 @@ const eslintConfig = defineConfig([
"**/dist/**",
"**/target/**",
"**/.git/**",
// Sub-packages have their own ESLint configs and CI lint steps.
"backend/**",
"frontend/**",
"contract/**",
],
},
{
files: ["**/*.{js,mjs,cjs}"],
languageOptions: {
ecmaVersion: "latest",
sourceType: "module",
globals: {
process: "readonly",
console: "readonly",
module: "readonly",
require: "readonly",
__dirname: "readonly",
__filename: "readonly",
},
},
rules: {
"no-unused-vars": "error",
"no-undef": "error",
"no-var": "error",
"prefer-const": "error",
eqeqeq: ["error", "always"],
},
},
]);

export default eslintConfig;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"scripts": {
"lint": "pnpm --recursive --stream lint",
"lint": "eslint .",
"test": "pnpm --recursive --stream test",
"build": "pnpm --recursive --stream build",
"prepare": "husky install",
Expand Down