Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
29 changes: 29 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Lint & Format

on:
pull_request:
push:
branches: [ main ]

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- name: Install dependencies
run: npm ci || npm install

- name: Run ESLint
run: npm run lint

- name: Prettier Check
run: npm run format
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
nbproject/
build.xml
*.properties
*.properties
node_modules/
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
web/dist
web/vendor
web/**/*.min.js
9 changes: 9 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

{
"printWidth": 100,
"tabWidth": 2,
"singleQuote": true,
"trailingComma": "es5",
"semi": true,
"arrowParens": "always"
}
34 changes: 34 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
const prettierPlugin = require("eslint-plugin-prettier");
const prettierConfig = require("eslint-config-prettier");

module.exports = [
{
files: ["web/**/*.js"],
languageOptions: {
ecmaVersion: "latest",
sourceType: "module",
globals: {
window: "readonly",
document: "readonly",
localStorage: "readonly",
fetch: "readonly",
console: "readonly",
alert: "readonly",
setTimeout: "readonly",
CustomEvent: "readonly",
}
},
plugins: {
prettier: prettierPlugin
},
rules: {
...prettierConfig.rules,
"no-unused-vars": ["warn", { argsIgnorePattern: "^_", varsIgnorePattern: "^_" }],
"no-undef": "error",
eqeqeq: "warn",
curly: ["warn", "all"],
"prettier/prettier": "warn"
},
ignores: ["node_modules/", "web/dist/", "web/vendor/", "web/**/*.min.js", "web/**/*.test.js"]
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ignores property is placed inside the configuration object, but in ESLint's flat config format, ignores should be a top-level property in a separate configuration object. This should be:

module.exports = [
  {
    ignores: ["node_modules/", "web/dist/", "web/vendor/", "web/**/*.min.js", "web/**/*.test.js"]
  },
  {
    files: ["web/**/*.js"],
    // ... rest of config
  }
];

Copilot uses AI. Check for mistakes.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good suggestion. ESLint supports "ignores" inside the same config object in Flat Config as well as in a separate top-level block. Since the current placement of code works and keeps the PR minimal, I will not be making this change now. We can revisit this later if needed for clarity.

}
];
Loading
Loading