Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

91 changes: 0 additions & 91 deletions .eslintrc.json

This file was deleted.

3 changes: 2 additions & 1 deletion build.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { rm } from "node:fs/promises";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";

import * as esbuild from "esbuild";

const __filename = fileURLToPath(import.meta.url);
Expand Down Expand Up @@ -31,7 +32,7 @@ const context = await esbuild.context({
outdir: "dist",
platform: "node",
format: "cjs",
sourcemap: !!process.env.CODEQL_VARIANT_ANALYSIS_ACTION_GENERATE_SOURCEMAPS
sourcemap: process.env.CODEQL_VARIANT_ANALYSIS_ACTION_GENERATE_SOURCEMAPS
Copy link

Copilot AI Jun 10, 2025

Choose a reason for hiding this comment

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

Using the raw environment variable string here will always be truthy when set. Wrap it in a boolean conversion (!!process.env...) to ensure correct conditional behavior.

Suggested change
sourcemap: process.env.CODEQL_VARIANT_ANALYSIS_ACTION_GENERATE_SOURCEMAPS
sourcemap: !!process.env.CODEQL_VARIANT_ANALYSIS_ACTION_GENERATE_SOURCEMAPS

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hmm, I think eslint --fix made this change, but I'm not sure why. I'll revert it back to using !!

? "external"
: false,
chunkNames: "chunks/[name]-[hash]",
Expand Down
82 changes: 82 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
import path from "path";
import { fileURLToPath } from "url";

import { FlatCompat } from "@eslint/eslintrc";
import eslint from "@eslint/js";
import { globalIgnores } from "eslint/config";
import github from "eslint-plugin-github";
import tseslint from "typescript-eslint";

const compat = new FlatCompat({
Comment thread Fixed
baseDirectory: path.dirname(fileURLToPath(import.meta.url)),
});

export default tseslint.config(
globalIgnores(["dist/", "node_modules/", "jest.config.ts", "eslint.config.mjs", "build.mjs"]),
...compat.plugins("no-async-foreach"),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we still need the no-async-foreach plugin? It seems like this is caught by at least three different rules now:

Image

Image

github.getFlatConfigs().recommended,
...github.getFlatConfigs().typescript,
{
extends: [eslint.configs.recommended, tseslint.configs.recommended],
},
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why do we need to use extends here, but not for any of the other configs?

{
rules: {
"sort-imports": "off",
"i18n-text/no-en": "off",
"import/extensions": [
"error",
{
json: "always",
},
],
"import/named": "off",
"import/no-amd": "error",
"import/no-commonjs": "error",
"import/no-dynamic-require": "error",
"import/no-extraneous-dependencies": [
"error",
{
devDependencies: true,
},
],
"import/no-namespace": "off",
"import/no-unresolved": "error",
"import/no-webpack-loader-syntax": "error",
"import/order": [
"error",
{
alphabetize: {
order: "asc",
},
"newlines-between": "always",
},
],
"no-async-foreach/no-async-foreach": "error",
"no-console": "off",
"no-sequences": "error",
"no-shadow": "off",
"@typescript-eslint/naming-convention": "error",
"eslint-comments/no-use": [
"error",
{
allow: [
"eslint-disable",
"eslint-enable",
"eslint-disable-next-line",
],
},
],
"@typescript-eslint/no-shadow": "error",
"one-var": ["error", "never"],
"@typescript-eslint/restrict-template-expressions": "off",
},
"settings": {
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"]
},
"import/resolver": {
"typescript": {}
}
},
},
);
Loading