Skip to content

Commit

Permalink
chore: update configuration files
Browse files Browse the repository at this point in the history
update configuration for Typescript files
  • Loading branch information
ahmad-kashkoush committed Nov 10, 2024
1 parent 3b60dcb commit 0019217
Show file tree
Hide file tree
Showing 6 changed files with 423 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ trim_trailing_whitespace = true
insert_final_newline = true

# Settings for JavaScript and JSX files
[*.{js,jsx}]
[*.{js,jsx,ts,tsx}]
indent_size = 2

# Settings for JSON files
Expand Down
21 changes: 20 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,13 +1,32 @@
{
"parser": "@typescript-eslint/parser",
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"prettier"
],
"plugins": [
"prettier"
"prettier",
"@typescript-eslint"
],
"rules": {
"prettier/prettier": "error"
},
"overrides": [
{
"files": [
"*.ts",
"*.tsx"
],
"rules": {
// Add any TypeScript-specific rules here if needed
}
}
],
"settings": {
"react": {
"version": "detect"
}
}
}
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
"tabWidth": 2,
"printWidth": 80,
"bracketSpacing": true,
"arrowParens": "always"
"arrowParens": "always",
"endOfLine": "lf"
}
9 changes: 8 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ import globals from 'globals';
import react from 'eslint-plugin-react';
import reactHooks from 'eslint-plugin-react-hooks';
import reactRefresh from 'eslint-plugin-react-refresh';
import typescriptParser from '@typescript-eslint/parser';
import typescriptPlugin from '@typescript-eslint/eslint-plugin';

export default [
{ ignores: ['dist'] },
{
files: ['**/*.{js,jsx}'],
files: ['**/*.{js,jsx,ts,tsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
Expand All @@ -16,18 +18,23 @@ export default [
ecmaFeatures: { jsx: true },
sourceType: 'module',
},
parser: typescriptParser,
},
settings: { react: { version: '18.3' } },
plugins: {
react,
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
'@typescript-eslint': typescriptPlugin,
},
rules: {
...js.configs.recommended.rules,
...react.configs.recommended.rules,
...react.configs['jsx-runtime'].rules,
...reactHooks.configs.recommended.rules,
...typescriptPlugin.configs.recommended.rules,

// Customize rules as needed
'react/jsx-no-target-blank': 'off',
'react-refresh/only-export-components': [
'warn',
Expand Down
Loading

0 comments on commit 0019217

Please sign in to comment.