Skip to content

Commit 3195e44

Browse files
chore(vite-examples): update eslint to v9 and typescript-eslint to v8 (#6454)
1 parent e6913f5 commit 3195e44

File tree

12 files changed

+1214
-811
lines changed

12 files changed

+1214
-811
lines changed

.github/workflows/examples.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
path:
2121
- nextjs-app
2222
- nextjs-pages
23+
- remix-ts
2324
- vite-ts
2425
fail-fast: false
2526
steps:
@@ -41,6 +42,10 @@ jobs:
4142
run: npm run test --if-present
4243
working-directory: examples/${{ matrix.path }}
4344

45+
- name: ESLint
46+
run: npm run lint --if-present
47+
working-directory: examples/${{ matrix.path }}
48+
4449
templates:
4550
runs-on: ubuntu-latest
4651
strategy:
@@ -68,3 +73,7 @@ jobs:
6873
- name: Test
6974
run: npm run test --if-present
7075
working-directory: templates/${{ matrix.path }}
76+
77+
- name: ESLint
78+
run: npm run lint --if-present
79+
working-directory: templates/${{ matrix.path }}

examples/vite-ts/.eslintrc.cjs

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

examples/vite-ts/cypress.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default defineConfig({
1313

1414
e2e: {
1515
baseUrl: 'http://localhost:5173/',
16-
setupNodeEvents(on, config) {
16+
setupNodeEvents() {
1717
// implement node event listeners here
1818
}
1919
}

examples/vite-ts/cypress/support/component.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import './commands';
2626
// Alternatively, can be defined in cypress/support/component.d.ts
2727
// with a <reference path="./component" /> at the top of your spec.
2828
declare global {
29+
// eslint-disable-next-line @typescript-eslint/no-namespace
2930
namespace Cypress {
3031
interface Chainable {
3132
mount: typeof mount;

examples/vite-ts/eslint.config.mjs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import js from '@eslint/js';
2+
import globals from 'globals';
3+
import reactHooks from 'eslint-plugin-react-hooks';
4+
import reactRefresh from 'eslint-plugin-react-refresh';
5+
import tseslint from 'typescript-eslint';
6+
7+
export default tseslint.config(
8+
{ ignores: ['dist'] },
9+
{
10+
extends: [js.configs.recommended, ...tseslint.configs.recommended],
11+
files: ['**/*.{ts,tsx}'],
12+
languageOptions: {
13+
ecmaVersion: 2020,
14+
globals: globals.browser
15+
},
16+
plugins: {
17+
'react-hooks': reactHooks,
18+
'react-refresh': reactRefresh
19+
},
20+
rules: {
21+
...reactHooks.configs.recommended.rules,
22+
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }]
23+
}
24+
}
25+
);

0 commit comments

Comments
 (0)