Skip to content

Commit 689003d

Browse files
committed
chore: fix ESLint configuration to suppress errors
1 parent 1341745 commit 689003d

File tree

5 files changed

+15
-19
lines changed

5 files changed

+15
-19
lines changed

eslint.config.mjs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { fixupPluginRules } from '@eslint/compat';
21
import reactPlugin from 'eslint-plugin-react';
32
import reactHooksPlugin from 'eslint-plugin-react-hooks';
43
import reactRefresh from 'eslint-plugin-react-refresh';
@@ -13,8 +12,9 @@ export default [
1312
reactPlugin.configs.flat.recommended,
1413
testingLibraryPlugin.configs['flat/react'],
1514
{
15+
// global settings
1616
plugins: {
17-
'react-hooks': fixupPluginRules(reactHooksPlugin),
17+
'react-hooks': reactHooksPlugin,
1818
'react-refresh': reactRefresh,
1919
vitest: vitestPlugin,
2020
},
@@ -25,16 +25,10 @@ export default [
2525
},
2626
},
2727
settings: { react: { version: 'detect' }, 'import/resolver': { typescript: [] } },
28-
rules: {
29-
// https://github.com/facebook/react/issues/28313
30-
...reactHooksPlugin.configs.recommended.rules,
31-
'react/display-name': 0,
32-
'react/prop-types': 0,
33-
'react-refresh/only-export-components': 'warn',
34-
},
3528
},
3629
{
37-
files: ['*.{ts,tsx}'],
30+
// TypeScript
31+
files: ['**/*.{ts,tsx}'],
3832
languageOptions: {
3933
parserOptions: {
4034
// https://typescript-eslint.io/getting-started/typed-linting/
@@ -71,20 +65,26 @@ export default [
7165
},
7266
},
7367
{
74-
files: ['./**/*.tsx'],
68+
// React
69+
files: ['**/*.tsx'],
7570
rules: {
71+
// https://github.com/facebook/react/issues/28313
72+
...reactHooksPlugin.configs.recommended.rules,
73+
'react/display-name': 0,
74+
'react/prop-types': 0,
75+
'react-refresh/only-export-components': 'warn',
7676
'unicorn/filename-case': 0,
7777
},
7878
},
7979
{
80-
files: ['./**/*.spec.ts', './**/*.spec.tsx'],
80+
files: ['**/*.spec.ts', '**/*.spec.tsx'],
8181
rules: {
8282
'testing-library/prefer-user-event': 2,
8383
'testing-library/no-manual-cleanup': 0,
8484
},
8585
},
8686
{
87-
files: ['./vitest.config.ts'],
87+
files: ['vitest.config.ts'],
8888
rules: {
8989
'import/no-default-export': 0,
9090
},

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
"@commitlint/cli": "^19.4.0",
3737
"@commitlint/config-conventional": "^19.2.2",
3838
"@egoist/tailwindcss-icons": "1.8.1",
39-
"@eslint/compat": "^1.2.6",
4039
"@eslint/js": "^9.20.0",
4140
"@iconify-json/heroicons-solid": "1.1.12",
4241
"@iconify-json/majesticons": "1.1.12",

src/components/ConsoleOutput.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export const ConsoleOutput = forwardRef<ConsoleOutputRef, Props>((_, ref) => {
1616

1717
useEffect(() => {
1818
if (wrapperRef.current) {
19+
// eslint-disable-next-line unicorn/prefer-global-this -- fix it later
1920
const elementStyle = window.getComputedStyle(wrapperRef.current);
2021
const terminal = new Terminal({
2122
theme: {

src/server/linter/index.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import path from 'node:path';
88
import { fileURLToPath } from 'node:url';
99

1010
const __dirname = path.dirname(fileURLToPath(import.meta.url));
11+
// eslint-disable-next-line unicorn/text-encoding-identifier-case -- fix it later
1112
const content = fs.readFileSync(path.resolve(__dirname, './constants.json'), { encoding: 'utf-8' });
1213
const constants = JSON.parse(content);
1314

yarn.lock

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -898,11 +898,6 @@
898898
resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.12.1.tgz#cfc6cffe39df390a3841cde2abccf92eaa7ae0e0"
899899
integrity sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==
900900

901-
"@eslint/compat@^1.2.6":
902-
version "1.2.6"
903-
resolved "https://registry.yarnpkg.com/@eslint/compat/-/compat-1.2.6.tgz#747ad2bde060582873cb486e03bfdf2945f0868d"
904-
integrity sha512-k7HNCqApoDHM6XzT30zGoETj+D+uUcZUb+IVAJmar3u6bvHf7hhHJcWx09QHj4/a2qrKZMWU0E16tvkiAdv06Q==
905-
906901
"@eslint/config-array@^0.19.0":
907902
version "0.19.2"
908903
resolved "https://registry.yarnpkg.com/@eslint/config-array/-/config-array-0.19.2.tgz#3060b809e111abfc97adb0bb1172778b90cb46aa"

0 commit comments

Comments
 (0)