Skip to content

Commit 149cb11

Browse files
chore(remix-example): update eslint to v9 and typescript-eslint to v8 (#6456)
1 parent 6ca32ce commit 149cb11

File tree

6 files changed

+540
-571
lines changed

6 files changed

+540
-571
lines changed

.github/workflows/examples.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ jobs:
4343
working-directory: examples/${{ matrix.path }}
4444

4545
- name: ESLint
46-
if: ${{ matrix.path != 'remix-ts'}}
4746
run: npm run lint --if-present
4847
working-directory: examples/${{ matrix.path }}
4948

examples/remix-ts/.eslintrc.cjs

Lines changed: 0 additions & 80 deletions
This file was deleted.

examples/remix-ts/app/routes/_index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const loader = async () => {
1616
}, 1500);
1717
});
1818

19-
return json({ data: { todos } });
19+
return json({ data: { todos: todoList } });
2020
};
2121

2222
export default function Index() {

examples/remix-ts/eslint.config.mjs

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
import js from '@eslint/js';
2+
import importPlugin from 'eslint-plugin-import';
3+
import jsxA11y from 'eslint-plugin-jsx-a11y';
4+
import reactPlugin from 'eslint-plugin-react';
5+
import reactHooks from 'eslint-plugin-react-hooks';
6+
import globals from 'globals';
7+
import tseslint from 'typescript-eslint';
8+
9+
export default tseslint.config(
10+
{
11+
ignores: ['build', '**/node_modules']
12+
},
13+
js.configs.recommended,
14+
{
15+
languageOptions: {
16+
globals: {
17+
...globals.browser,
18+
...globals.commonjs
19+
},
20+
21+
ecmaVersion: 'latest',
22+
sourceType: 'module',
23+
24+
parserOptions: {
25+
ecmaFeatures: {
26+
jsx: true
27+
}
28+
}
29+
}
30+
},
31+
{
32+
extends: [
33+
reactPlugin.configs.flat.recommended,
34+
reactPlugin.configs.flat['jsx-runtime'],
35+
jsxA11y.flatConfigs.recommended
36+
],
37+
files: ['**/*.{js,jsx,ts,tsx}'],
38+
39+
plugins: {
40+
'react-hooks': reactHooks
41+
},
42+
43+
settings: {
44+
react: {
45+
version: 'detect'
46+
},
47+
48+
formComponents: ['Form'],
49+
50+
linkComponents: [
51+
{
52+
name: 'Link',
53+
linkAttribute: 'to'
54+
},
55+
{
56+
name: 'NavLink',
57+
linkAttribute: 'to'
58+
}
59+
],
60+
61+
'import/resolver': {
62+
typescript: {}
63+
},
64+
rules: {
65+
...reactHooks.configs.recommended.rules
66+
}
67+
}
68+
},
69+
// Typescript
70+
{
71+
extends: [
72+
js.configs.recommended,
73+
...tseslint.configs.recommended,
74+
importPlugin.flatConfigs.recommended,
75+
importPlugin.flatConfigs.typescript
76+
],
77+
files: ['**/*.{ts,tsx}'],
78+
settings: {
79+
'import/internal-regex': '^~/',
80+
81+
'import/resolver': {
82+
node: {
83+
extensions: ['.ts', '.tsx']
84+
},
85+
86+
typescript: {
87+
alwaysTryTypes: true
88+
}
89+
}
90+
}
91+
},
92+
// Node
93+
{
94+
files: ['**/.eslintrc.cjs'],
95+
languageOptions: {
96+
globals: {
97+
...globals.node
98+
}
99+
}
100+
}
101+
);

0 commit comments

Comments
 (0)