Add baseline ESLint config (no boundary rules yet)
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
dist/
|
||||
node_modules/
|
||||
ClientApp/
|
||||
wwwroot/
|
||||
*.cjs
|
||||
pnpm-lock.yaml
|
||||
@@ -0,0 +1,34 @@
|
||||
/** @type {import('eslint').Linter.Config} */
|
||||
module.exports = {
|
||||
root: true,
|
||||
parser: "@typescript-eslint/parser",
|
||||
parserOptions: {
|
||||
ecmaVersion: 2023,
|
||||
sourceType: "module",
|
||||
project: "./tsconfig.json",
|
||||
ecmaFeatures: { jsx: true },
|
||||
},
|
||||
plugins: ["@typescript-eslint", "unused-imports"],
|
||||
extends: [
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
],
|
||||
rules: {
|
||||
"@typescript-eslint/no-unused-vars": "off",
|
||||
"unused-imports/no-unused-imports": "error",
|
||||
"unused-imports/no-unused-vars": [
|
||||
"warn",
|
||||
{
|
||||
vars: "all",
|
||||
varsIgnorePattern: "^_",
|
||||
args: "after-used",
|
||||
argsIgnorePattern: "^_",
|
||||
},
|
||||
],
|
||||
"@typescript-eslint/consistent-type-imports": ["error", { prefer: "type-imports" }],
|
||||
"@typescript-eslint/no-explicit-any": "warn",
|
||||
"@typescript-eslint/no-non-null-assertion": "warn",
|
||||
"no-console": ["warn", { allow: ["warn", "error"] }],
|
||||
},
|
||||
ignorePatterns: ["dist/", "node_modules/", "ClientApp/", "wwwroot/", "*.cjs"],
|
||||
};
|
||||
@@ -0,0 +1,37 @@
|
||||
// ESLint v9 flat-config shim that loads the legacy `.eslintrc.cjs` via FlatCompat.
|
||||
// The plan (`docs/superpowers/plans/2026-04-14-phase-1a1-skeleton.md`, Task 4)
|
||||
// specifies `.eslintrc.cjs` verbatim, but ESLint v9 requires a flat config file
|
||||
// to be present. This shim preserves the plan's rule set without modifying
|
||||
// package.json's `lint` script. A future batch can migrate fully to flat config.
|
||||
|
||||
import { FlatCompat } from "@eslint/eslintrc";
|
||||
import js from "@eslint/js";
|
||||
import { createRequire } from "node:module";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import path from "node:path";
|
||||
|
||||
const require = createRequire(import.meta.url);
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
|
||||
const legacyConfig = require("./.eslintrc.cjs");
|
||||
|
||||
const compat = new FlatCompat({
|
||||
baseDirectory: __dirname,
|
||||
resolvePluginsRelativeTo: __dirname,
|
||||
recommendedConfig: js.configs.recommended,
|
||||
});
|
||||
|
||||
export default [
|
||||
{
|
||||
ignores: [
|
||||
"dist/",
|
||||
"node_modules/",
|
||||
"ClientApp/",
|
||||
"wwwroot/",
|
||||
"**/*.cjs",
|
||||
"pnpm-lock.yaml",
|
||||
],
|
||||
},
|
||||
...compat.config(legacyConfig),
|
||||
];
|
||||
Reference in New Issue
Block a user