Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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.

1 change: 1 addition & 0 deletions 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
89 changes: 89 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
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({
baseDirectory: path.dirname(fileURLToPath(import.meta.url)),
});

export default tseslint.config(
globalIgnores(["dist/", "node_modules/", "script/", "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,
tseslint.configs.recommendedTypeChecked,
{
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": {}
}
},
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
);
Loading