Skip to content

Commit 0019217

Browse files
chore: update configuration files
update configuration for Typescript files
1 parent 3b60dcb commit 0019217

File tree

6 files changed

+423
-4
lines changed

6 files changed

+423
-4
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ trim_trailing_whitespace = true
2121
insert_final_newline = true
2222

2323
# Settings for JavaScript and JSX files
24-
[*.{js,jsx}]
24+
[*.{js,jsx,ts,tsx}]
2525
indent_size = 2
2626

2727
# Settings for JSON files

.eslintrc

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,32 @@
11
{
2+
"parser": "@typescript-eslint/parser",
23
"extends": [
34
"eslint:recommended",
5+
"plugin:@typescript-eslint/recommended",
46
"plugin:react/recommended",
57
"prettier"
68
],
79
"plugins": [
8-
"prettier"
10+
"prettier",
11+
"@typescript-eslint"
912
],
1013
"rules": {
1114
"prettier/prettier": "error"
15+
},
16+
"overrides": [
17+
{
18+
"files": [
19+
"*.ts",
20+
"*.tsx"
21+
],
22+
"rules": {
23+
// Add any TypeScript-specific rules here if needed
24+
}
25+
}
26+
],
27+
"settings": {
28+
"react": {
29+
"version": "detect"
30+
}
1231
}
1332
}

.prettierrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@
66
"tabWidth": 2,
77
"printWidth": 80,
88
"bracketSpacing": true,
9-
"arrowParens": "always"
9+
"arrowParens": "always",
10+
"endOfLine": "lf"
1011
}

eslint.config.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ import globals from 'globals';
33
import react from 'eslint-plugin-react';
44
import reactHooks from 'eslint-plugin-react-hooks';
55
import reactRefresh from 'eslint-plugin-react-refresh';
6+
import typescriptParser from '@typescript-eslint/parser';
7+
import typescriptPlugin from '@typescript-eslint/eslint-plugin';
68

79
export default [
810
{ ignores: ['dist'] },
911
{
10-
files: ['**/*.{js,jsx}'],
12+
files: ['**/*.{js,jsx,ts,tsx}'],
1113
languageOptions: {
1214
ecmaVersion: 2020,
1315
globals: globals.browser,
@@ -16,18 +18,23 @@ export default [
1618
ecmaFeatures: { jsx: true },
1719
sourceType: 'module',
1820
},
21+
parser: typescriptParser,
1922
},
2023
settings: { react: { version: '18.3' } },
2124
plugins: {
2225
react,
2326
'react-hooks': reactHooks,
2427
'react-refresh': reactRefresh,
28+
'@typescript-eslint': typescriptPlugin,
2529
},
2630
rules: {
2731
...js.configs.recommended.rules,
2832
...react.configs.recommended.rules,
2933
...react.configs['jsx-runtime'].rules,
3034
...reactHooks.configs.recommended.rules,
35+
...typescriptPlugin.configs.recommended.rules,
36+
37+
// Customize rules as needed
3138
'react/jsx-no-target-blank': 'off',
3239
'react-refresh/only-export-components': [
3340
'warn',

0 commit comments

Comments
 (0)