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.