From 628f3ad74bfd3f067b17408f3623b540752f1950 Mon Sep 17 00:00:00 2001 From: Template Bot Date: Sun, 8 Feb 2026 23:07:38 +0000 Subject: [PATCH] Apply template update: tighten up eslint config (conflicts) Source: https://github.com/mockdeep/Rails-Template/pull/1326 This cherry-pick had conflicts that need manual resolution. Search for <<<<<<< in the changed files. --- .eslint_todo.ts | 12 +++++++++++- eslint.config.mts | 10 +++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/.eslint_todo.ts b/.eslint_todo.ts index 910dc3e..22ee2a4 100644 --- a/.eslint_todo.ts +++ b/.eslint_todo.ts @@ -3,5 +3,15 @@ // The point is for the user to remove these configuration records // one by one as the offenses are removed from the code base. -export default [ +import type {Linter} from "eslint"; + +const eslintTodo: Linter.Config[] = [ + { + files: ["spec/javascript/controllers/file_upload_controller_spec.ts"], + rules: { + "@typescript-eslint/consistent-type-assertions": "off", + }, + }, ]; + +export default eslintTodo; diff --git a/eslint.config.mts b/eslint.config.mts index 8f7d8f2..6724a49 100644 --- a/eslint.config.mts +++ b/eslint.config.mts @@ -3,7 +3,6 @@ import importPlugin from "eslint-plugin-import"; import vitest from "eslint-plugin-vitest"; import js from "@eslint/js"; import stylistic from "@stylistic/eslint-plugin"; -import tsParser from "@typescript-eslint/parser"; import tseslint from "typescript-eslint"; import {defineConfig} from "eslint/config"; import sortKeysFix from "eslint-plugin-sort-keys-fix"; @@ -28,7 +27,6 @@ export default defineConfig([ files: ["**/*.{js,mjs,cjs,ts,mts,cts}"], languageOptions: { globals: globals.browser, - parser: tsParser, parserOptions: { projectService: { allowDefaultProject: ["stylelint.config.mjs"], @@ -36,11 +34,7 @@ export default defineConfig([ }, }, plugins: { - importPlugin, - js, "sort-keys-fix": sortKeysFix, - stylistic, - vitest, }, rules: { "@stylistic/array-element-newline": ["error", "consistent"], @@ -57,6 +51,8 @@ export default defineConfig([ ["error", {anonymous: "always", named: "never"}], "@typescript-eslint/consistent-indexed-object-style": ["error", "index-signature"], + "@typescript-eslint/consistent-type-assertions": + ["error", {assertionStyle: "never"}], "@typescript-eslint/explicit-member-accessibility": "off", "@typescript-eslint/naming-convention": "off", "@typescript-eslint/no-magic-numbers": "off", @@ -65,7 +61,7 @@ export default defineConfig([ "func-style": ["error", "declaration"], "max-len": ["error", 84, {ignoreUrls: true}], "no-duplicate-imports": ["error", {allowSeparateTypeImports: true}], - "no-magic-numbers": "off", + "no-undefined": "off", "one-var": ["error", "never"], "sort-imports":