From 7158acaeaf6fb51a7cae91aff63b211520be9260 Mon Sep 17 00:00:00 2001 From: Arjun Singh Saluja Date: Fri, 12 Sep 2025 11:51:31 +0530 Subject: [PATCH] chore(templates): add .eslintrc.cjs example template to fix broken links (#10739) --- templates/remix/.eslintrc.cjs | 46 +++++++++++++++++++++++++++++++++++ templates/remix/README.md | 7 ++++++ 2 files changed, 53 insertions(+) create mode 100644 templates/remix/.eslintrc.cjs create mode 100644 templates/remix/README.md diff --git a/templates/remix/.eslintrc.cjs b/templates/remix/.eslintrc.cjs new file mode 100644 index 00000000000..360959b9389 --- /dev/null +++ b/templates/remix/.eslintrc.cjs @@ -0,0 +1,46 @@ +// ESLint configuration recommended for Remix templates +// This is a minimal, modern example that works for both JavaScript and TypeScript projects. +// Adjust parser/plugins according to your project's needs. + +module.exports = { + root: true, + env: { + browser: true, + node: true, + es2024: true, + }, + extends: [ + "eslint:recommended", + "plugin:react/recommended", + "plugin:react-hooks/recommended", + "plugin:jsx-a11y/recommended", + "prettier" + ], + settings: { + react: { + version: "detect" + } + }, + parserOptions: { + ecmaVersion: "latest", + sourceType: "module" + }, + rules: { + "react/react-in-jsx-scope": "off" + }, + overrides: [ + { + files: ["*.ts", "*.tsx"], + parser: "@typescript-eslint/parser", + extends: ["plugin:@typescript-eslint/recommended"], + parserOptions: { + project: "./tsconfig.json", + tsconfigRootDir: __dirname, + } + }, + { + files: [".eslintrc.cjs", "scripts/**/*.js"], + env: { node: true } + } + ] +}; diff --git a/templates/remix/README.md b/templates/remix/README.md new file mode 100644 index 00000000000..a54e8f60358 --- /dev/null +++ b/templates/remix/README.md @@ -0,0 +1,7 @@ +# Remix template ESLint example + +This directory contains an example `.eslintrc.cjs` file used by the Remix templates. +It provides a starting point for ESLint configuration for both JavaScript and TypeScript projects. + +If you use `create-remix` to generate a new project and need an ESLint config, copy `.eslintrc.cjs` +from this folder into your project root and adjust the `overrides` and `parserOptions.project` as needed.