Skip to content

Commit

Permalink
#362: working with all rules
Browse files Browse the repository at this point in the history
  • Loading branch information
basmasking committed Jan 3, 2025
1 parent ab063e8 commit 85b2c1e
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import eslint from '@eslint/js';
import * as tseslint from '@typescript-eslint/eslint-plugin';
import tsparser from '@typescript-eslint/parser';
import react from 'eslint-plugin-react';
import reactHooks from 'eslint-plugin-react-hooks';
import sonarjs from 'eslint-plugin-sonarjs';

export default [
{
ignores: [
"**/dist/**/*",
"**/node_modules/**/*",
"**/coverage/**/*",
"**/*config*"
]
},
{
files: ["**/*.{ts,tsx}"],
plugins: {
'@typescript-eslint': tseslint,
'react': react,
'react-hooks': reactHooks,
'sonarjs': sonarjs
},
languageOptions: {
parser: tsparser,
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
ecmaFeatures: {
jsx: true
}
}
},
rules: {
...eslint.configs.recommended.rules,
...tseslint.configs.recommended.rules,
...tseslint.configs.stylistic.rules,
...sonarjs.configs.recommended.rules,
...react.configs.recommended.rules,
...reactHooks.configs.recommended.rules,
"@typescript-eslint/no-unsafe-function-type": "off",
"@typescript-eslint/consistent-type-definitions": "off",
"no-return-await": "error",
"semi": ["error", "always"],
"eol-last": ["error", "always"],
"brace-style": ["error", "allman", { "allowSingleLine": true }],
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off",
"sonarjs/assertions-in-tests": "off",

// typescript handles this for us
"no-undef": "off",
},
settings: {
react: {
version: 'detect'
}
}
}
];

0 comments on commit 85b2c1e

Please sign in to comment.