Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(remix-example): update eslint to v9 and typescript-eslint to v8 #6456

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
80 changes: 0 additions & 80 deletions examples/remix-ts/.eslintrc.cjs

This file was deleted.

2 changes: 1 addition & 1 deletion examples/remix-ts/app/routes/_index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const loader = async () => {
}, 1500);
});

return json({ data: { todos } });
return json({ data: { todos: todoList } });
};

export default function Index() {
Expand Down
101 changes: 101 additions & 0 deletions examples/remix-ts/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
import js from '@eslint/js';
import importPlugin from 'eslint-plugin-import';
import jsxA11y from 'eslint-plugin-jsx-a11y';
import reactPlugin from 'eslint-plugin-react';
import reactHooks from 'eslint-plugin-react-hooks';
import globals from 'globals';
import tseslint from 'typescript-eslint';

export default tseslint.config(
{
ignores: ['!**/.server', '!**/.client', 'build', 'node_modules']
},
js.configs.recommended,
{
languageOptions: {
globals: {
...globals.browser,
...globals.commonjs
},

ecmaVersion: 'latest',
sourceType: 'module',

parserOptions: {
ecmaFeatures: {
jsx: true
}
}
}
},
{
extends: [
reactPlugin.configs.flat.recommended,
reactPlugin.configs.flat['jsx-runtime'],
jsxA11y.flatConfigs.recommended
],
files: ['**/*.{js,jsx,ts,tsx}'],

plugins: {
'react-hooks': reactHooks
},

settings: {
react: {
version: 'detect'
},

formComponents: ['Form'],

linkComponents: [
{
name: 'Link',
linkAttribute: 'to'
},
{
name: 'NavLink',
linkAttribute: 'to'
}
],

'import/resolver': {
typescript: {}
},
rules: {
...reactHooks.configs.recommended.rules
}
}
},
// Typescript
{
extends: [
js.configs.recommended,
...tseslint.configs.recommended,
importPlugin.flatConfigs.recommended,
importPlugin.flatConfigs.typescript
],
files: ['**/*.{ts,tsx}'],
settings: {
'import/internal-regex': '^~/',

'import/resolver': {
node: {
extensions: ['.ts', '.tsx']
},

typescript: {
alwaysTryTypes: true
}
}
}
},
// Node
{
files: ['**/.eslintrc.cjs'],
languageOptions: {
globals: {
...globals.node
}
}
}
);
Loading
Loading